Home » date » 2008 » Nov » 24 »

q3

*The author of this computation has been verified*
R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Mon, 24 Nov 2008 15:37:41 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i.htm/, Retrieved Mon, 24 Nov 2008 22:40:59 +0000
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i.htm/},
    year = {2008},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2008},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
 
Feedback Forum:

Post a new message
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
94,5 0 114,2 0 104,9 0 106,2 0 99,9 0 97,6 0 103,6 0 192,4 0 113,4 0 106,5 0 104,1 0 98,8 0 92,2 0 120,8 0 97,1 0 89,7 0 105 0 86,2 0 95,1 0 155 0 116,5 0 92,6 0 96 0 82,9 0 81,7 0 106,5 0 96,2 0 84,9 0 93 0 80,9 0 73,9 0 157,4 0 98,2 0 88,3 0 92,6 0 78,4 0 79,2 0 105,5 0 80,6 0 80,9 0 84,6 0 71,2 0 71,4 0 148 0 83,7 0 83,3 0 92,3 0 74,8 0 82,1 0 100 0 71,7 0 79,1 0 86,8 0 64,2 0 75,4 0 139,3 1 77,3 1 112,4 1 98,6 1 77,3 1 73,5 1 100,1 1 76,5 1 77,7 1 80,4 1 72,2 1 65,4 1 181,2 1 96,3 1 106,4 1 90,9 1 75,3 1 71,2 1 96,1 1 80,6 1 77,7 1 83 1 67,5 1 88,5 1 167,6 1 96,4 1 91 1 90,3 1 92,3 1 84,5 1 100,9 1 90 1 84,2 1 97,4 1 78,2 1 90 1 182,4 1 100,2 1 95,1 1 105 1 86,9 1 80,7 1
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 96.5818181818182 -1.85562770562771x[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)96.58181818181823.34480228.875200
x-1.855627705627715.083134-0.36510.7158810.357941


Multiple Linear Regression - Regression Statistics
Multiple R0.0374276924948006
R-squared0.00140083216548536
Adjusted R-squared-0.00911073802224638
F-TEST (value)0.133265738654373
F-TEST (DF numerator)1
F-TEST (DF denominator)95
p-value0.715881210233916
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation24.8057130534709
Sum Squared Residuals58455.723008658


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
194.596.581818181818-2.08181818181796
2114.296.581818181818217.6181818181818
3104.996.58181818181828.31818181818182
4106.296.58181818181829.61818181818182
599.996.58181818181823.31818181818182
697.696.58181818181821.01818181818181
7103.696.58181818181827.01818181818181
8192.496.581818181818295.8181818181818
9113.496.581818181818216.8181818181818
10106.596.58181818181829.91818181818181
11104.196.58181818181827.51818181818181
1298.896.58181818181822.21818181818181
1392.296.5818181818182-4.38181818181818
14120.896.581818181818224.2181818181818
1597.196.58181818181820.518181818181808
1689.796.5818181818182-6.88181818181818
1710596.58181818181828.41818181818181
1886.296.5818181818182-10.3818181818182
1995.196.5818181818182-1.48181818181819
2015596.581818181818258.4181818181818
21116.596.581818181818219.9181818181818
2292.696.5818181818182-3.98181818181819
239696.5818181818182-0.581818181818186
2482.996.5818181818182-13.6818181818182
2581.796.5818181818182-14.8818181818182
26106.596.58181818181829.91818181818181
2796.296.5818181818182-0.381818181818183
2884.996.5818181818182-11.6818181818182
299396.5818181818182-3.58181818181819
3080.996.5818181818182-15.6818181818182
3173.996.5818181818182-22.6818181818182
32157.496.581818181818260.8181818181818
3398.296.58181818181821.61818181818182
3488.396.5818181818182-8.28181818181819
3592.696.5818181818182-3.98181818181819
3678.496.5818181818182-18.1818181818182
3779.296.5818181818182-17.3818181818182
38105.596.58181818181828.91818181818181
3980.696.5818181818182-15.9818181818182
4080.996.5818181818182-15.6818181818182
4184.696.5818181818182-11.9818181818182
4271.296.5818181818182-25.3818181818182
4371.496.5818181818182-25.1818181818182
4414896.581818181818251.4181818181818
4583.796.5818181818182-12.8818181818182
4683.396.5818181818182-13.2818181818182
4792.396.5818181818182-4.28181818181819
4874.896.5818181818182-21.7818181818182
4982.196.5818181818182-14.4818181818182
5010096.58181818181823.41818181818181
5171.796.5818181818182-24.8818181818182
5279.196.5818181818182-17.4818181818182
5386.896.5818181818182-9.78181818181819
5464.296.5818181818182-32.3818181818182
5575.496.5818181818182-21.1818181818182
56139.394.726190476190544.5738095238095
5777.394.7261904761905-17.4261904761905
58112.494.726190476190517.6738095238095
5998.694.72619047619053.87380952380952
6077.394.7261904761905-17.4261904761905
6173.594.7261904761905-21.2261904761905
62100.194.72619047619055.37380952380952
6376.594.7261904761905-18.2261904761905
6477.794.7261904761905-17.0261904761905
6580.494.7261904761905-14.3261904761905
6672.294.7261904761905-22.5261904761905
6765.494.7261904761905-29.3261904761905
68181.294.726190476190586.4738095238095
6996.394.72619047619051.57380952380952
70106.494.726190476190511.6738095238095
7190.994.7261904761905-3.82619047619047
7275.394.7261904761905-19.4261904761905
7371.294.7261904761905-23.5261904761905
7496.194.72619047619051.37380952380952
7580.694.7261904761905-14.1261904761905
7677.794.7261904761905-17.0261904761905
778394.7261904761905-11.7261904761905
7867.594.7261904761905-27.2261904761905
7988.594.7261904761905-6.22619047619048
80167.694.726190476190572.8738095238095
8196.494.72619047619051.67380952380953
829194.7261904761905-3.72619047619048
8390.394.7261904761905-4.42619047619048
8492.394.7261904761905-2.42619047619048
8584.594.7261904761905-10.2261904761905
86100.994.72619047619056.17380952380953
879094.7261904761905-4.72619047619048
8884.294.7261904761905-10.5261904761905
8997.494.72619047619052.67380952380953
9078.294.7261904761905-16.5261904761905
919094.7261904761905-4.72619047619048
92182.494.726190476190587.6738095238095
93100.294.72619047619055.47380952380952
9495.194.72619047619050.373809523809516
9510594.726190476190510.2738095238095
9686.994.7261904761905-7.82619047619047
9780.794.7261904761905-14.0261904761905
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/1rxl11227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/1rxl11227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/29adz1227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/29adz1227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/3vr521227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/3vr521227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/4i57z1227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/4i57z1227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/58j5m1227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/58j5m1227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/6x8j81227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/6x8j81227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/70flg1227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/70flg1227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/8cgzq1227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/8cgzq1227566257.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/9trnt1227566257.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t12275664505l16d2pknz6hk6i/9trnt1227566257.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

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. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume 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.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by