Home » date » 2008 » Jan » 09 » attachments

regressie 2

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 09 Jan 2008 05:10:56 -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/Jan/09/t11998808352epdxu4w3luocqn.htm/, Retrieved Wed, 09 Jan 2008 13:14:06 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1.0137 89.97 0.9834 99.8 0.9643 112.99 0.947 93.69 0.906 108.02 0.9492 99.11 0.9397 94.33 0.9041 83.75 0.8721 106.37 0.8552 109.63 0.8564 105.5 0.8973 96.13 0.9383 102.48 0.9217 101.37 0.9095 112.76 0.892 95.57 0.8742 102.81 0.8532 104.13 0.8607 97.52 0.9005 85.29 0.9111 101.01 0.9059 108.48 0.8883 101.33 0.8924 87.57 0.8833 97.44 0.87 96.06 0.8758 106.67 0.8858 102.67 0.917 104.54 0.9554 102.46 0.9922 103.35 0.9778 83.27 0.9808 108.22 0.9811 115.23 1.0014 103.7 1.0183 93.61 1.0622 100.25 1.0773 100.56 1.0807 108.86 1.0848 105.43 1.1582 104.77 1.1663 109.13 1.1372 106.13 1.1139 82.27 1.1222 113.6 1.1692 117.73 1.1702 104.83 1.2286 104.61 1.2613 102.93 1.2646 106.95 1.2262 123.45 1.1985 111.99 1.2007 103.95 1.2138 122.05 1.2266 108.04 1.2176 93.72 1.2218 119.61 1.249 118.29 1.2991 117.14 1.3408 112.76 1.3119 105.97 1.3014 107.96 1.3201 122.27 1.2938 114.54 1.2694 110.15 1.2165 120.02 1.2037 103.94 1.2292 96.18 1.2256 121.01 1.2015 110.55 1.1786 120.04 1.1856 114.19
 
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
(1-B)uit[t] = + 0.387755793465986 -19.2592282494765`(1-B)wk`[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.3877557934659861.4247740.27220.7863170.393159
`(1-B)wk`-19.259228249476553.326139-0.36120.7190840.359542


Multiple Linear Regression - Regression Statistics
Multiple R0.0434374270323568
R-squared0.00188681006719132
Adjusted R-squared-0.0125785984825597
F-TEST (value)0.130436002599029
F-TEST (DF numerator)1
F-TEST (DF denominator)69
p-value0.719083885131171
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation11.9559627531964
Sum Squared Residuals9863.2081295516


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
19.830.9713104094251268.85868959057487
213.190.75560705303099112.434392946969
3-19.30.72094044218193-20.0209404421819
414.331.1773841516945213.1526158483055
5-8.91-0.444242866911400-8.4657571330886
6-4.780.570718461836014-5.35071846183602
7-10.581.07338431914735-11.6533843191473
822.621.0040510974492321.6159489025508
93.259999999999990.713236750882142.54676324911785
10-4.130000000000000.364644719566613-4.49464471956661
11-9.37-0.399946641937602-8.9700533580624
126.35000000000001-0.4018725647625516.75187256476256
13-1.110.707458982407297-1.81745898240730
1411.390.62271837810959810.7672816218904
15-17.190.724792287831825-17.9147922878318
167.240000000000010.730570056306676.50942994369334
171.319999999999990.7921995867049930.527800413295
18-6.610.243311581594911-6.85331158159491
19-12.23-0.37876149086318-11.8512385091368
2015.720.18360797402153215.5363920259785
217.470.4879037803632646.98209621963673
22-7.150.726718210656775-7.87671821065678
23-13.760.308792957643131-14.0687929576431
249.870.5630147705362229.30698522946378
25-1.380000000000000.643903529184023-2.02390352918402
2610.610.27605226961902010.3339477303810
27-40.195163510971221-4.19516351097122
281.87000000000000-0.2131321279176812.08313212791769
29-2.08000000000001-0.351798571313912-1.7282014286861
300.89-0.3209838061147481.21098380611475
31-20.080.66508868025845-20.7450886802584
3224.950.32997810871755524.6200218912824
337.010.3819780249911446.62802197500886
34-11.53-0.0032065399983896-11.5267934600016
35-10.090.0622748360498342-10.1522748360498
366.64-0.4577243266860337.09772432668603
370.3100000000000020.0969414468988930.213058553101109
388.30.3222744174177657.97772558258223
39-3.429999999999990.308792957643133-3.73879295764313
40-0.660000000000011-1.025871560045590.365871560045577
414.360.2317560446452274.12824395535477
42-30.94819933552575-3.94819933552575
43-23.860.836495811678791-24.6964958116788
4431.330.22790419899532931.1020958010047
454.13000000000001-0.5174279342594094.64742793425942
46-12.90.36849656521651-13.2684965652165
47-0.219999999999999-0.7369831363034420.516983136303443
48-1.67999999999999-0.242020970291899-1.43797902970809
494.020.3242003402427163.69579965975728
5016.51.1273101582458815.3726898417541
51-11.460.921236415976486-12.3812364159765
52-8.040.345385491317133-8.38538549131713
5318.10.13545990339784817.9645400966021
54-14.010.141237671872688-14.1512376718727
55-14.320.561088847711272-14.8810888477113
5625.890.30686703481818625.5831329651818
57-1.31999999999999-0.136095214919778-1.18390478508022
58-1.15000000000001-0.577131541832783-0.572868458167222
59-4.3800-0.415354024537187-3.96464597546281
60-6.790000000000010.944347489875855-7.73434748987586
611.989999999999990.5899776900854931.40002230991450
6214.310.027608225200770814.2823917747992
63-7.729999999999990.894273496427218-8.6242734964272
64-4.390.857680962753212-5.24768096275321
659.871.406568967863308.4634310321367
66-16.080.634273915059286-16.7142739150593
67-7.75999999999999-0.103354526895667-7.65664547310432
6824.830.45708901516410424.3729109848359
69-10.460.85190319427837-11.3119031942784
709.490.8287921203789968.66120787962101
71-5.850000000000010.252941195719653-6.10294119571966
72-0.0303NANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/17g6t1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/17g6t1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/203cx1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/203cx1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/38yip1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/38yip1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/4o6zd1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/4o6zd1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/5ekn71199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/5ekn71199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/63qfy1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/63qfy1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/7j6fn1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/7j6fn1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/88uae1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/88uae1199880650.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/9ux5m1199880650.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/09/t11998808352epdxu4w3luocqn/9ux5m1199880650.ps (open in new window)


 
Parameters (Session):
par1 = 2 ; par2 = Do not include Seasonal Dummies ; par3 = First Differences ;
 
Parameters (R input):
par1 = 2 ; par2 = Do not include Seasonal Dummies ; par3 = First Differences ;
 
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