Home » date » 2007 » Nov » 19 » attachments

The Seatbeltlaw

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Mon, 19 Nov 2007 11:02:20 -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/Nov/19/t1195494936ritknomo2lx48ex.htm/, Retrieved Mon, 19 Nov 2007 18:55:46 +0100
 
User-defined keywords:
Q3 Totale productie
 
Dataseries X:
» Textbox « » Textfile « » CSV «
106,7 0 110,2 0 125,9 0 100,1 0 106,4 0 114,8 0 81,3 0 87 0 104,2 0 108 0 105 0 94,5 0 92 0 95,9 0 108,8 0 103,4 0 102,1 0 110,1 0 83,2 0 82,7 0 106,8 0 113,7 0 102,5 0 96,6 0 92,1 0 95,6 0 102,3 0 98,6 0 98,2 0 104,5 0 84 0 73,8 0 103,9 0 106 0 97,2 0 102,6 0 89 0 93,8 0 116,7 0 106,8 0 98,5 0 118,7 0 90 0 91,9 0 113,3 1 113,1 1 104,1 1 108,7 1 96,7 1 101 1 116,9 1 105,8 1 99 1 129,4 1 83 1 88,9 1 115,9 1 104,2 1 113,4 1 112,2 1 100,8 1 107,3 1 126,6 1 102,9 1 117,9 1 128,8 1 87,5 1 93,8 1 122,7 1 126,2 1 124,6 1 116,7 1 115,2 1 111,1 1 129,9 1 113,3 1 118,5 1 133,5 1 102,1 1 102,4 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
y[t] = + 97.6433333333333 + 5.88291666666667x[t] -5.31647321428578M1[t] -2.22675595238096M2[t] + 13.6915327380952M3[t] -0.161607142857151M4[t] + 1.11382440476191M5[t] + 15.1749702380952M6[t] -17.6067410714286M7[t] -16.3741666666667M8[t] + 6.24751488095237M9[t] + 6.87056547619047M10[t] + 2.69361607142857M11[t] + 0.110282738095238t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)97.64333333333333.10672631.429700
x5.882916666666672.9594031.98790.0509770.025488
M1-5.316473214285783.647896-1.45740.1497460.074873
M2-2.226755952380963.646073-0.61070.5434780.271739
M313.69153273809523.6453673.75590.0003680.000184
M4-0.1616071428571513.645781-0.04430.9647770.482389
M51.113824404761913.6473120.30540.7610360.380518
M615.17497023809523.6499614.15769.5e-054.7e-05
M7-17.60674107142863.653724-4.81889e-064e-06
M8-16.37416666666673.658598-4.47553.1e-051.5e-05
M96.247514880952373.7862361.65010.1036820.051841
M106.870565476190473.7835421.81590.0739270.036963
M112.693616071428573.7819250.71220.478830.239415
t0.1102827380952380.0638621.72690.0888630.044432


Multiple Linear Regression - Regression Statistics
Multiple R0.882316047395406
R-squared0.778481607491453
Adjusted R-squared0.73484919684583
F-TEST (value)17.8418197842467
F-TEST (DF numerator)13
F-TEST (DF denominator)66
p-value1.11022302462516e-16
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation6.54955267493152
Sum Squared Residuals2831.17825595237


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1106.792.437142857143214.2628571428568
2110.295.637142857142914.5628571428571
3125.9111.66571428571414.2342857142858
4100.197.92285714285712.17714285714287
5106.499.30857142857147.09142857142859
6114.8113.481.32000000000003
781.380.80857142857140.491428571428584
88782.15142857142864.84857142857144
9104.2104.883392857143-0.683392857142873
10108105.6167261904762.38327380952379
11105101.5500595238103.44994047619049
1294.598.9667261904762-4.46672619047619
139293.7605357142857-1.76053571428566
1495.996.9605357142857-1.06053571428570
15108.8112.989107142857-4.18910714285714
16103.499.246254.15375000000001
17102.1100.6319642857141.46803571428571
18110.1114.803392857143-4.70339285714286
1983.282.13196428571431.06803571428572
2082.783.4748214285714-0.77482142857143
21106.8106.2067857142860.59321428571429
22113.7106.9401190476196.75988095238096
23102.5102.873452380952-0.373452380952379
2496.6100.290119047619-3.69011904761905
2592.195.0839285714285-2.98392857142852
2695.698.2839285714286-2.68392857142857
27102.3114.3125-12.0125
2898.6100.569642857143-1.96964285714286
2998.2101.955357142857-3.75535714285714
30104.5116.126785714286-11.6267857142857
318483.45535714285710.544642857142854
3273.884.7982142857143-10.9982142857143
33103.9107.530178571429-3.63017857142856
34106108.263511904762-2.2635119047619
3597.2104.196845238095-6.99684523809523
36102.6101.6135119047620.986488095238083
378996.4073214285714-7.40732142857138
3893.899.6073214285714-5.80732142857143
39116.7115.6358928571431.06410714285714
40106.8101.8930357142864.90696428571428
4198.5103.27875-4.77875
42118.7117.4501785714291.24982142857142
439084.778755.22125
4491.986.12160714285715.77839285714286
45113.3114.736488095238-1.43648809523809
46113.1115.469821428571-2.36982142857143
47104.1111.403154761905-7.30315476190477
48108.7108.819821428571-0.119821428571430
4996.7103.613630952381-6.9136309523809
50101106.813630952381-5.81363095238095
51116.9122.842202380952-5.94220238095238
52105.8109.099345238095-3.29934523809524
5399110.485059523810-11.4850595238095
54129.4124.6564880952384.7435119047619
558391.9850595238095-8.98505952380953
5688.993.3279166666667-4.42791666666666
57115.9116.059880952381-0.159880952380947
58104.2116.793214285714-12.5932142857143
59113.4112.7265476190480.673452380952381
60112.2110.1432142857142.05678571428571
61100.8104.937023809524-4.13702380952377
62107.3108.137023809524-0.837023809523818
63126.6124.1655952380952.43440476190474
64102.9110.422738095238-7.5227380952381
65117.9111.8084523809526.09154761904762
66128.8125.9798809523812.82011904761905
6787.593.3084523809524-5.80845238095238
6893.894.6513095238095-0.851309523809535
69122.7117.3832738095245.31672619047619
70126.2118.1166071428578.08339285714285
71124.6114.04994047619010.5500595238095
72116.7111.4666071428575.23339285714285
73115.2106.2604166666678.93958333333338
74111.1109.4604166666671.63958333333332
75129.9125.4889880952384.41101190476189
76113.3111.7461309523811.55386904761904
77118.5113.1318452380955.36815476190475
78133.5127.3032738095246.19672619047617
79102.194.63184523809537.46815476190475
80102.495.97470238095246.42529761904761
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/1b94k1195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/1b94k1195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/2ez851195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/2ez851195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/31yxu1195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/31yxu1195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/4lkn81195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/4lkn81195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/59h8r1195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/59h8r1195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/6gbi21195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/6gbi21195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/7urmk1195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/7urmk1195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/8th3d1195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/8th3d1195495335.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/97dt11195495335.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t1195494936ritknomo2lx48ex/97dt11195495335.ps (open in new window)


 
Parameters:
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = 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:

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