Home » date » 2007 » Dec » 20 » attachments

Regressiemodel 1 paper

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 20 Dec 2007 11:31:24 -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/20/t1198174432afvix0ipv76y6b6.htm/, Retrieved Thu, 20 Dec 2007 19:13:53 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
115.4 126.6 117 106.9 93.9 103.8 107.1 89.8 100.8 99.3 93.4 110.6 99.2 101.5 104 108.3 110.4 112.6 105.6 105.9 107.3 99.5 108.4 98.9 107.4 113.9 109.8 93.1 86.1 104.9 88.1 69.4 102.2 110.7 101.2 123.9 113.1 100.5 124.9 99.6 98 112.7 93.6 106.6 121.9 98.6 90.1 100.6 99.6 96.9 104.3 114.3 125.9 120.4 107.8 112 107.5 101.2 100 102.9 112.5 123.9 125.6 100.5 79.8 107.5 93.9 83.4 108.8 116.2 113.6 128.4 112 112.9 121.1 106.4 104 119.5 95.7 109.9 128.7 96 99 108.7 95.8 106.3 105.5 103 128.9 119.8 102.2 111.1 111.3 98.4 102.9 110.6 111.4 130 120.1 86.6 87 97.5 91.3 87.5 107.7 107.9 117.6 127.3 101.8 103.4 117.2 104.4 110.8 119.8 93.4 112.6 116.2 100.1 102.5 111 98.5 112.4 112.4 112.9 135.6 130.6 101.4 105.1 109.1 107.1 127.7 118.8 110.8 137 123.9 90.3 91 101.6 95.5 90.5 112.8 111.4 122.4 128 113 123.3 129.6 107.5 124.3 125.8 95.9 120 119.5 106.3 118.1 115.7 105.2 119 113.6 117.2 142.7 129.7 106.9 123.6 112 108.2 129.6 116.8 113 151.6 127 96.1 108.7 112.9 100.2 99.3 113.3 108.1 126.4 121.7
 
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 time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
Cons.[t] = + 48.8917446449141 + 0.338889029387975Inter.[t] + 0.280590797362096Inv.[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)48.891744644914111.5175014.2458.1e-054.1e-05
Inter.0.3388890293879750.1495192.26650.0272320.013616
Inv.0.2805907973620960.068994.06710.0001487.4e-05


Multiple Linear Regression - Regression Statistics
Multiple R0.738425103738406
R-squared0.545271633831076
Adjusted R-squared0.529316252561991
F-TEST (value)34.1747793196009
F-TEST (DF numerator)2
F-TEST (DF denominator)57
p-value1.76170522614427e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation6.17091580655335
Sum Squared Residuals2170.57150781949


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1117123.522333582328-6.52233358232784
2103.8111.466457758790-7.66645775878951
3100.8110.383813295483-9.58381329548251
4110.6108.7506057367601.84939426324015
5104110.989502292454-6.98950229245403
6112.6116.570650556407-3.97065055640726
7107.3114.392991588930-7.09299158893029
898.9113.027245503069-14.1272455030689
9109.8117.247718220725-7.44771822072542
10104.9104.6011809338110.298819066188908
11102.298.22086947092423.97913052907578
12123.9114.8025488912079.09745110879289
13124.9115.4194690035859.48053099641522
14112.7110.1429901134422.55700988655813
15121.9110.52273679442811.3772632055720
16100.6107.587433784893-6.98743378489335
17104.3109.834340236344-5.53434023634358
18120.4122.953142091848-2.55314209184759
19107.5116.850151317493-9.35015131749262
20102.9111.246394155187-8.34639415518683
21125.6121.7819602442253.81803975577495
22107.5105.3412377279012.15876227209909
23108.8104.1146970044444.68530299555617
24128.4120.1457644401318.25423555986904
25121.1118.5260169585482.57398304145199
26119.5114.1309802974535.36901970254731
27128.7112.16035338743816.5396466125623
28108.7109.203580405007-0.503580405007262
29105.5111.184115419873-5.68411541987297
30119.8119.965468451850-0.165468451849764
31111.3114.699841035294-3.39984103529407
32110.6111.111218185251-0.511218185250589
33120.1123.120786175807-3.02078617580706
3497.5102.650933960415-5.15093396041514
35107.7104.3840077972203.31599220278033
36127.3118.4553486856598.84465131434084
37117.2112.4037362838514.79626371614926
38119.8115.3612196607394.43878033926101
39116.2112.1385037727234.06149622727697
40111111.575093216265-0.575093216265297
41112.4113.810719663129-1.41071966312928
42130.6125.2004281851175.39957181488324
43109.1112.745185027611-3.64518502761112
44118.8121.018204515506-2.21820451550594
45123.9124.881588339709-0.981588339708936
46101.6105.027186558599-3.42718655859905
47112.8106.6491141127356.15088588726453
48128120.9882961158557.01170388414487
49129.6121.7830502805027.81694971949822
50125.8120.199751416235.60024858376999
51119.5115.0620982466724.43790175332752
52115.7118.053421637319-2.35342163731944
53113.6117.933175422619-4.33317542261856
54129.7128.6498456727561.05015432724406
55112119.800004440444-7.80000444044375
56116.8121.924104962821-5.1241049628207
57127129.723769845849-2.72376984584908
58112.9111.9592000423580.940799957641614
59113.3110.7110915676452.58890843235461
60121.7120.9923255083230.707674491676811
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/1pk7r1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/1pk7r1198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/2nwa61198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/2nwa61198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/31ndh1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/31ndh1198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/43olr1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/43olr1198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/51e7j1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/51e7j1198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/6dspy1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/6dspy1198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/7uqyr1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/7uqyr1198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/87dd51198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/87dd51198175475.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/9iika1198175475.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/20/t1198174432afvix0ipv76y6b6/9iika1198175475.ps (open in new window)


 
Parameters (Session):
par1 = 3 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 3 ; 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:

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