::Free Statistics and Forecasting Software::

v1.1.23-r7
Secure website (SSL) | Donate to wessa.net

:: Linear Regression Graphical Model Validation - Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

This free online software (calculator) computes the Simple Linear Regression model (Y = a + b X) and various diagnostic tools from the perspective of Explorative Data Analysis. Note that the lagplot of X and the Autocorrelation Function only make sense when working with time series. All other diagnostics (scatterplots, histogram, kernel density, and QQ normality plot) can be used for data series with or without time dimension.

Enter (or paste) your data delimited by hard returns.

 Send output to: Browser Blue - Charts White Browser Black/White CSV MS Excel MS Word Data X (click to load default data) 80 60 10 20 30 10 10 50 80 90 30 Data Y: 50 20 10 50 30 50 70 20 30 10 50 Sample Range:(leave blank to include all observations) From: To: bandwidth of density plot (?) Chart options Width: Height:

Click here to edit the underlying code of this R Module.

 Source code of R module par1 <- as.numeric(par1) library(lattice) z <- as.data.frame(cbind(x,y)) m <- lm(y~x) summary(m) bitmap(file="test1.png") plot(z,main="Scatterplot, lowess, and regression line") lines(lowess(z),col="red") abline(m) grid() dev.off() bitmap(file="test2.png") m2 <- lm(m\$fitted.values ~ x) summary(m2) z2 <- as.data.frame(cbind(x,m\$fitted.values)) names(z2) <- list("x","Fitted") plot(z2,main="Scatterplot, lowess, and regression line") lines(lowess(z2),col="red") abline(m2) grid() dev.off() bitmap(file="test3.png") m3 <- lm(m\$residuals ~ x) summary(m3) z3 <- as.data.frame(cbind(x,m\$residuals)) names(z3) <- list("x","Residuals") plot(z3,main="Scatterplot, lowess, and regression line") lines(lowess(z3),col="red") abline(m3) grid() dev.off() bitmap(file="test4.png") m4 <- lm(m\$fitted.values ~ m\$residuals) summary(m4) z4 <- as.data.frame(cbind(m\$residuals,m\$fitted.values)) names(z4) <- list("Residuals","Fitted") plot(z4,main="Scatterplot, lowess, and regression line") lines(lowess(z4),col="red") abline(m4) grid() dev.off() bitmap(file="test5.png") myr <- as.ts(m\$residuals) z5 <- as.data.frame(cbind(lag(myr,1),myr)) names(z5) <- list("Lagged Residuals","Residuals") plot(z5,main="Lag plot") m5 <- lm(z5) summary(m5) abline(m5) grid() dev.off() bitmap(file="test6.png") hist(m\$residuals,main="Residual Histogram",xlab="Residuals") dev.off() bitmap(file="test7.png") if (par1 > 0) { densityplot(~m\$residuals,col="black",main=paste("Density Plot bw = ",par1),bw=par1) } else { densityplot(~m\$residuals,col="black",main="Density Plot") } dev.off() bitmap(file="test8.png") acf(m\$residuals,main="Residual Autocorrelation Function") dev.off() bitmap(file="test9.png") qqnorm(x) qqline(x) grid() dev.off() load(file="createtable") a<-table.start() a<-table.row.start(a) a<-table.element(a,"Simple Linear Regression",5,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"Statistics",1,TRUE) a<-table.element(a,"Estimate",1,TRUE) a<-table.element(a,"S.D.",1,TRUE) a<-table.element(a,"T-STAT (H0: coeff=0)",1,TRUE) a<-table.element(a,"P-value (two-sided)",1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"constant term",header=TRUE) a<-table.element(a,m\$coefficients[[1]]) sd <- sqrt(vcov(m)[1,1]) a<-table.element(a,sd) tstat <- m\$coefficients[[1]]/sd a<-table.element(a,tstat) pval <- 2*(1-pt(abs(tstat),length(x)-2)) a<-table.element(a,pval) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"slope",header=TRUE) a<-table.element(a,m\$coefficients[[2]]) sd <- sqrt(vcov(m)[2,2]) a<-table.element(a,sd) tstat <- m\$coefficients[[2]]/sd a<-table.element(a,tstat) pval <- 2*(1-pt(abs(tstat),length(x)-2)) a<-table.element(a,pval) a<-table.row.end(a) a<-table.end(a) table.save(a,file="mytable.tab")
 Top | Output | Charts | References | History | Feedback

 Cite this software as: Wessa P., (2012), Linear Regression Graphical Model Validation (v1.0.7) in Free Statistics Software (v1.1.23-r7), Office for Research Development and Education, URL http://www.wessa.net/rwasp_linear_regression.wasp/ The R code is based on : NIST/SEMATECH e-Handbook of Statistical Methods, http://www.itl.nist.gov/div898/handbook/, 2006-10-03. Deepayan Sarkar (2006). lattice: Lattice Graphics. R package version 0.13-8. Diethelm Wuertz, many others and see the SOURCE file (2006). fExtremes: Rmetrics - Extreme Financial Market Data. R package version 221.10065. http://www.rmetrics.org
 Top | Output | Charts | References | History | Feedback
 Top | Output | Charts | References | History | Feedback
 To cite Wessa.net in publications use:Wessa, P. (2013), Free Statistics Software, Office for Research Development and Education, version 1.1.23-r7, URL http://www.wessa.net/ © All rights reserved. Academic license for non-commercial use only. The free use of the scientific content, services, and applications in this website is granted for non commercial use only. In any case, the source (url) should always be clearly displayed. Under no circumstances are you allowed to reproduce, copy or redistribute the design, layout, or any content of this website (for commercial use) including any materials contained herein without the express written permission. Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. We make no warranties or representations as to the accuracy or completeness of such information (or software), and it assumes no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site. Software Version : 1.1.23-r7Algorithms & Software : Patrick Wessa, PhDServer : www.wessa.net
 © Wessa.Net 2002-2013

 [Select module] Main Menu Equation Plotter   Scientific Forecasting   Descriptive Statistics -Central Tendency -Variability -Skewness/Kurtosis -Quartiles -Percentiles -Stem and Leaf -Histogram -Kernel Density -Harrell-Davis -Univariate EDA -Bootstrap -Blocked Bootstrap -Mean Plot -SD Plot -(P)ACF -Spectrum -SD Mean-Plot -Variance Reduction -Correlation -Kendall Rank Corr. -Simple Regression -Bivariate KDE -Box-Cox Linearity -Regression Validation -Back-Back Histo. -Partial Correlation -Trivariate Scatter -Kendall tau Matrix -Notched Boxplots -Star Plot   Distributions -Normal ML Fit -Beta ML Fit -Cauchy ML Fit -Exponential ML Fit -Gamma ML Fit -Lognormal ML Fit -Logistic ML Fit -Neg. Binom. ML Fit -Poisson ML Fit -Weibull ML Fit -Tukey lambda PPCC -Box-Cox Normality   Hypothesis Tests -Mean -Skewness/Kurtosis   Multiple Regression -Estimate Equation   About this server

 Home Page Equation Plotter Time Series Analysis Multiple Regression Descriptive Statistics Statistical Distributions Hypothesis Testing Simon Fraser University Aston University Academic citations Computations Archive Search Computations R Project FAQ About Wessa.net Powered by Linux Server status page Any R Server'Herman Ole Andreas Wold''Gwilym Jenkins''Sir Ronald Aylmer Fisher''George Udny Yule''Gertrude Mary Cox''Sir Maurice George Kendall'Installed PackagesHistory list Edit R Code