Home » date » 2007 » Dec » 13 » attachments

paper w1

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 02:11: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/Dec/13/t11975362015k4of08fba2bghj.htm/, Retrieved Thu, 13 Dec 2007 09:56:41 +0100
 
User-defined keywords:
bridome
 
Dataseries X:
» Textbox « » Textfile « » CSV «
540 0 522 0 526 0 527 0 516 0 503 0 489 0 479 0 475 0 524 0 552 0 532 0 511 0 492 0 492 0 493 0 481 0 462 0 457 0 442 0 439 0 488 0 521 0 501 0 485 0 464 0 460 0 467 0 460 0 448 0 443 0 436 0 431 0 484 0 510 0 513 0 503 0 471 0 471 0 476 0 475 0 470 0 461 0 455 0 456 0 517 0 525 0 523 0 519 0 509 0 512 0 519 0 517 0 510 0 509 0 501 0 507 0 569 0 580 0 578 0 565 0 547 0 555 0 562 1 561 1 555 1 544 1 537 1 543 1 594 1 611 1 613 1 611 1 594 1 595 1 591 1 589 1 584 1 573 1 567 1 569 1 621 1 629 1 628 1 612 1 595 1 597 1 593 1 590 1 580 1 574 1 573 1 573 1 620 1 626 1 620 1 588 1 566 1 557 1 561 1 549 1 532 1 526 1 511 1 499 1 555 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 time7 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 525.754197271773 + 73.3752360965372x[t] -11.2732457930125M1[t] -30.7960252224943M2[t] -30.4299157630873M3[t] -36.1054992032956M4[t] -41.9616119661109M5[t] -52.595502506704M6[t] -60.3405041584082M7[t] -68.8632835878901M8[t] -70.0527296840387M9[t] -16.908842446854M10[t] + 5.93944609614861M11[t] + 0.189446096148616t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)525.75419727177310.65391249.348500
x73.37523609653729.6935187.569500
M1-11.273245793012512.441403-0.90610.3672460.183623
M2-30.796025222494312.436965-2.47620.0151090.007554
M3-30.429915763087312.434466-2.44720.0162950.008147
M4-36.105499203295612.468438-2.89580.0047250.002363
M5-41.961611966110912.458389-3.36810.0011070.000553
M6-52.59550250670412.45027-4.22445.6e-052.8e-05
M7-60.340504158408212.444087-4.84895e-063e-06
M8-68.863283587890112.439841-5.535700
M9-70.052729684038712.437535-5.632400
M10-16.90884244685412.437169-1.35950.1772980.088649
M115.9394460961486112.7934260.46430.643560.32178
t0.1894460961486160.1553751.21930.2258530.112926


Multiple Linear Regression - Regression Statistics
Multiple R0.889690607068077
R-squared0.791549376305164
Adjusted R-squared0.762094396870024
F-TEST (value)26.8731939890898
F-TEST (DF numerator)13
F-TEST (DF denominator)92
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation25.5849656968537
Sum Squared Residuals60222.3232132447


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1540514.67039757491125.3296024250892
2522495.33706424157626.6629357584237
3526495.89261979713230.1073802028682
4527490.40648245307236.5935175469279
5516484.73981578640531.2601842135945
6503474.29537134196128.7046286580390
7489466.73981578640522.2601842135946
8479458.40648245307220.5935175469279
9475457.40648245307217.5935175469279
10524510.73981578640513.2601842135945
11552533.77755042555718.2224495744433
12532528.0275504255573.97244957444331
13511516.943750728693-5.94375072869284
14492497.61041739536-5.61041739535965
15492498.165972950915-6.16597295091521
16493492.6798356068560.320164393144487
17481487.013168940189-6.01316894018885
18462476.568724495744-14.5687244957444
19457469.013168940189-12.0131689401889
20442460.679835606856-18.6798356068555
21439459.679835606856-20.6798356068555
22488513.013168940189-25.0131689401889
23521536.05090357934-15.0509035793401
24501530.30090357934-29.3009035793401
25485519.217103882476-34.2171038824762
26464499.883770549143-35.8837705491431
27460500.439326104699-40.4393261046986
28467494.953188760639-27.9531887606389
29460489.286522093972-29.2865220939723
30448478.842077649528-30.8420776495278
31443471.286522093972-28.2865220939723
32436462.953188760639-26.9531887606389
33431461.953188760639-30.9531887606389
34484515.286522093972-31.2865220939722
35510538.324256733123-28.3242567331235
36513532.574256733123-19.5742567331235
37503521.49045703626-18.4904570362596
38471502.157123702926-31.1571237029264
39471502.712679258482-31.712679258482
40476497.226541914422-21.2265419144223
41475491.559875247756-16.5598752477556
42470481.115430803311-11.1154308033112
43461473.559875247756-12.5598752477556
44455465.226541914422-10.2265419144223
45456464.226541914422-8.22654191442231
46517517.559875247756-0.559875247755636
47525540.597609886907-15.5976098869069
48523534.847609886907-11.8476098869069
49519523.763810190043-4.76381019004302
50509504.430476856714.56952314329018
51512504.9860324122657.01396758773461
52519499.49989506820619.5001049317943
53517493.83322840153923.1667715984610
54510483.38878395709526.6112160429054
55509475.83322840153933.166771598461
56501467.49989506820633.5001049317943
57507466.49989506820640.5001049317943
58569519.83322840153949.166771598461
59580542.8709630406937.1290369593098
60578537.1209630406940.8790369593098
61565526.03716334382638.9628366561736
62547506.70383001049340.2961699895068
63555507.25938556604947.7406144339512
64562575.148484318526-13.1484843185263
65561569.48181765186-8.4818176518596
66555559.037373207415-4.03737320741516
67544551.48181765186-7.48181765185962
68537543.148484318526-6.14848431852629
69543542.1484843185260.851515681473718
70594595.48181765186-1.48181765185961
71611618.519552291011-7.51955229101084
72613612.7695522910110.230447708989156
73611601.6857525941479.31424740585302
74594582.35241926081411.6475807391862
75595582.90797481636912.0920251836306
76591577.4218374723113.5781625276903
77589571.75517080564317.244829194357
78584561.31072636119922.6892736388014
79573553.75517080564319.244829194357
80567545.4218374723121.5781625276903
81569544.4218374723124.5781625276903
82621597.75517080564323.244829194357
83629620.7929054447948.20709455520577
84628615.04290544479412.9570945552058
85612603.959105747938.04089425206963
86595584.62577241459710.3742275854028
87597585.18132797015311.8186720298473
88593579.69519062609313.3048093739069
89590574.02852395942615.9714760405736
90580563.58407951498216.4159204850181
91574556.02852395942617.9714760405736
92573547.69519062609325.3048093739069
93573546.69519062609326.3048093739069
94620600.02852395942619.9714760405736
95626623.0662585985782.93374140142238
96620617.3162585985782.68374140142237
97588606.232458901714-18.2324589017138
98566586.89912556838-20.8991255683806
99557587.454681123936-30.4546811239361
100561581.968543779876-20.9685437798764
101549576.30187711321-27.3018771132098
102532565.857432668765-33.8574326687653
103526558.30187711321-32.3018771132098
104511549.968543779876-38.9685437798764
105499548.968543779876-49.9685437798764
106555602.30187711321-47.3018771132098
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/18vbe1197537070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/18vbe1197537070.ps (open in new window)


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/3c6521197537070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/3c6521197537070.ps (open in new window)


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/58j4l1197537070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/58j4l1197537070.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/6osvi1197537070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/6osvi1197537070.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/71aaz1197537070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/71aaz1197537070.ps (open in new window)


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/98uv11197537070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t11975362015k4of08fba2bghj/98uv11197537070.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