Home » date » 2007 » Dec » 13 » attachments

paper

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 13 Dec 2007 08:07:19 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4.htm/, Retrieved Thu, 13 Dec 2007 16:01:17 +0100
 
User-defined keywords:
multiple regression
 
Dataseries X:
» Textbox « » Textfile « » CSV «
103.1 98.6 98.1 98.6 0 100.6 98 101.1 98 0 103.1 106.8 111.1 106.8 0 95.5 96.6 93.3 96.7 0 90.5 100.1 100 100.2 0 90.9 107.7 108 107.7 0 88.8 91.5 70.4 92 0 90.7 97.8 75.4 98.4 0 94.3 107.4 105.5 107.4 0 104.6 117.5 112.3 117.7 0 111.1 105.6 102.5 105.7 0 110.8 97.4 93.5 97.5 0 107.2 99.5 86.7 99.9 1 99 98 95.2 98.2 1 99 104.3 103.8 104.5 1 91 100.6 97 100.8 1 96.2 101.1 95.5 101.5 1 96.9 103.9 101 103.9 1 96.2 96.9 67.5 99.6 1 100.1 95.5 64 98.4 1 99 108.4 106.7 112.7 1 115.4 117 100.6 118.4 1 106.9 103.8 101.2 108.1 1 107.1 100.8 93.1 105.4 1 99.3 110.6 84.2 114.6 1 99.2 104 85.8 106.9 1 108.3 112.6 91.8 115.9 1 105.6 107.3 92.4 109.8 1 99.5 98.9 80.3 101.8 1 107.4 109.8 79.7 114.2 1 93.1 104.9 62.5 110.8 1 88.1 102.2 57.1 108.4 1 110.7 123.9 100.8 127.5 1 113.1 124.9 100.7 128.6 1 99.6 112.7 86.2 116.6 1 93.6 121.9 83.2 127.4 1 98.6 100.6 71.7 105 1 99.6 104.3 77.5 108.3 1 114.3 120.4 89.8 125 1 107.8 107.5 80.3 111.6 1 101.2 102.9 78.7 106.5 1 112.5 125.6 93.8 130.3 1 100.5 107.5 57.6 115 1 93.9 108.8 60.6 116.1 1 116.2 128.4 91 134 1 112 121.1 85.3 126.5 1 106.4 119.5 77.4 125.8 1 95.7 128.7 77.3 136.4 1 96 108.7 68.3 114.9 1 95.8 105.5 69.9 110.9 1 103 119.8 81.7 125.5 1 102.2 111.3 75.1 116.8 1 98.4 110.6 69.9 116.8 1 111.4 120.1 84 125.5 1 86.6 97.5 54.3 104.2 1 91.3 107.7 60 115.1 1 107.9 127.3 89.9 132.8 1 101.8 117.2 77 123.3 1 104.4 119.8 85.3 124.8 1 93.4 116.2 77.6 122 1 100.1 111 69.2 117.4 1 98.5 112.4 75.5 117.9 1 112.9 130.6 85.7 137.4 1 101.4 109.1 72.2 114.6 1 107.1 118.8 79.9 124.7 1 110.8 123.9 85.3 129.6 1 90.3 101.6 52.2 109.4 1 95.5 112.8 61.2 120.9 1 111.4 128 82.4 134.9 1 113 129.6 85.4 136.3 1 107.5 125.8 78.2 133.2 1 95.9 119.5 70.2 127.2 1 106.3 115.7 70.2 122.7 1 105.2 113.6 69.3 120.5 1 117.2 129.7 77.5 137.8 1 106.9 112 66.1 119.1 1 108.2 116.8 69 124.3 1 110 126.3 75.3 134.3 1 96.1 112.9 58.2 121.7 1 100.6 115.9 59.7 125 1
 
Text written by user:
 
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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
intermediair-goederen[t] = + 38.7304827602253 + 0.621420888367847`totale-consumptie`[t] + 0.169178306430478`Duurzame-consumptiegoederen`[t] -0.195767517620194`Niet-duurzame-consumptiegoederen`[t] + 3.47440801073859`invoering-Euro`[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)38.73048276022537.9132334.89446e-063e-06
`totale-consumptie`0.6214208883678470.8259650.75240.4541910.227095
`Duurzame-consumptiegoederen`0.1691783064304780.1029831.64280.1046150.052307
`Niet-duurzame-consumptiegoederen`-0.1957675176201940.717218-0.2730.7856390.392819
`invoering-Euro`3.474408010738592.3259241.49380.139430.069715


Multiple Linear Regression - Regression Statistics
Multiple R0.690610406124864
R-squared0.476942733047949
Adjusted R-squared0.449046345477173
F-TEST (value)17.0969352873341
F-TEST (DF numerator)4
F-TEST (DF denominator)75
p-value5.26891974494959e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.59261586000023
Sum Squared Residuals2345.80141181446


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1103.197.29629697677375.80370302322631
2100.697.54843987361663.05156012638336
3103.1102.9859726005010.11402739949926
495.595.6133576126502-0.113357612650164
590.598.2366390633512-7.73663906335116
690.9102.844607884239-11.9446078842392
788.889.4900351975311-0.690035197531108
890.792.9979662136317-2.29796621363169
994.3102.293966106939-7.99396610693868
10104.6107.704324131693-3.10432413169319
11111.1101.00067836853910.0993216314606
12110.895.987715970534414.8122840294656
13107.299.14685332082978.05314667917027
149999.9855423728914-0.98554237289136
1599104.122092043904-5.12209204390369
1691101.396762088410-10.3967620884101
1796.2101.316667810614-5.11666781061418
1896.9103.517284941123-6.61728494112332
1996.294.34166578289421.85833421710579
20100.193.11447348781686.98552651218321
2199105.555241130375-6.55524113037466
22115.4108.7515982506776.64840174932289
23106.9102.6667549395684.23324506043218
24107.199.9607202899527.13927971004807
2599.3102.743896906620-3.44389690661979
2699.2100.420614219356-1.22061421935625
27108.3105.0179960393213.28200396067914
28105.6103.0201541723132.57984582768725
2999.597.31930134317562.1806986568244
30107.4101.5637648240365.83623517596357
3193.196.2745451603384-3.17454516033843
3288.194.152987949309-6.05298794930912
33110.7111.291753631358-0.591753631357593
34113.1111.6809124197001.41908758029981
3599.6103.995702349813-4.39570234981285
3693.6107.090950413207-13.4909504132075
3798.696.29432736171422.30567263828579
3899.698.92878601782540.671213982174624
39114.3107.7452379453856.55476205461464
40107.8100.7449993104617.05500068953882
41101.298.61419227354332.58580772645669
42112.5110.6157719472331.88422805276697
43100.596.23904219458074.26095780541934
4493.997.339079999368-3.43907999936808
45116.2111.1577113614635.04228863853704
46112107.1252789118754.8747210881246
47106.4104.9315341320201.4684658679798
4895.7108.556552787587-12.8565527875873
499698.8145318911902-2.81453189119022
5095.897.8797404091826-2.07974040918265
51103105.904157371468-2.90415737146767
52102.2101.2086804011960.991319598804501
5398.499.8939585858995-1.49395858589952
54111.4106.4796937427684.92030625723188
5586.691.5808340899797-4.98083408997972
5691.396.7497775559254-5.44977755592537
57107.9110.522973268329-2.62297326832902
58101.8103.924013560252-2.12401356025245
59104.4106.650236536952-2.25023653695152
6093.4103.658597428649-10.2585974286491
61100.199.90664161617320.193358383826783
6298.5101.74457043159-3.24457043159012
63112.9110.9625827318821.93741726811799
64101.499.78162589690231.61837410309773
65107.1105.1348295456211.96517045437888
66110.8108.2583780946832.54162190531722
6790.392.7553941971589-2.45539419715887
6895.598.9865864521208-3.48658645212083
69111.4109.2780188049562.12198119504448
70113110.5057526209672.49424737903276
71107.5107.533148743493-0.0331487434925879
7295.9103.439375801052-7.53937580105248
73106.3101.9589302545464.34106974545445
74105.2100.932374451954.26762554804995
75117.2108.9377348125738.26226518742705
76106.999.67080497465227.22919502534776
77108.2102.1262512358416.07374876415871
78110107.1378978296462.86210217035410
7996.198.38457960757-2.28457960757003
80100.699.85657692417260.743423075827347
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/11uja1197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/11uja1197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/2cggd1197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/2cggd1197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/33d7l1197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/33d7l1197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/4n9bz1197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/4n9bz1197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/5u6211197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/5u6211197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/63hd51197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/63hd51197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/70ccl1197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/70ccl1197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/8uvkl1197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/8uvkl1197558435.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/912r41197558435.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197558067furm88zsdcwwkm4/912r41197558435.ps (open in new window)


 
Parameters:
par1 = FALSE ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ;
 
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:

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