Home » date » 2008 » Nov » 27 »

seatbelt q1

*Unverified author*
R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 27 Nov 2008 01:58:42 -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/Nov/27/t1227776354vqvienx3c7xhwt2.htm/, Retrieved Thu, 27 Nov 2008 08:59:15 +0000
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2.htm/},
    year = {2008},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2008},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
 
Feedback Forum:

Post a new message
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1687 -183.9235445 1508 -177.0726091 1507 -228.6351091 1385 -237.4476091 1632 -127.7601091 1511 -193.0101091 1559 -220.6351091 1630 -164.5101091 1579 -268.3226091 1653 -333.6976091 2152 -34.26010911 2148 -154.8851091 1752 -97.74528053 1765 101.1056549 1717 2.543154874 1558 -43.26934513 1575 -163.5818451 1520 -162.8318451 1805 46.54315487 1800 26.66815487 1719 -107.1443451 2008 42.48065487 2242 76.91815487 2478 196.2931549 2030 201.4329835 1655 12.28391886 1693 -0.278581137 1623 42.90891886 1805 87.59641886 1746 84.34641886 1795 57.72141886 1926 173.8464189 1619 -185.9660811 1992 47.65891886 2233 89.09641886 2192 -68.52858114 2080 272.6112475 1768 146.4621829 1835 162.8996829 1569 10.08718285 1976 279.7746829 1853 212.5246829 1965 248.8996829 1689 -41.97531715 1778 -5.787817149 1976 52.83718285 2397 274.2746829 2654 414.6496829 2097 310.7895114 1963 362.6404468 1677 26.07794684 1941 403.2654468 2003 327.9529468 1813 193.7029468 2012 317.0779468 1912 202.2029468 2084 321.3904468 2080 178.0154468 2118 16.45294684 2150 -68.17205316 1608 -157.0322246 1503 -76.18128917 1548 -81.74378917 1382 -134.5562892 1731 77.13121083 1798 199.8812108 1779 105.2562108 1887 198.3812108 2004 262.5687108 2077 196.1937108 2092 11.63121083 2051 -145.9937892 1577 -166.8539606 1356 -202.0030252 1652 43.43447482 1382 -113.3780252 1519 -113.6905252 1421 -155.9405252 1442 -210.5655252 1543 -124.4405252 1656 -64.25302518 1561 -298.6280252 1905 -154.1905252 2199 23.18447482 1473 -249.6756966 1655 118.1752388 1407 -180.3872612 1395 -79.19976119 1530 -81.51226119 1309 -246.7622612 1526 -105.3872612 1327 -319.2622612 1627 -72.07476119 1748 -90.44976119 1958 -80.01226119 2274 119.3627388 1648 -53.49743261 1401 -114.6464972 1411 -155.2089972 1403 -50.02149721 1394 -196.3339972 1520 -14.58399721 1528 -82.20899721 1643 17.91600279 1515 -162.8964972 1685 -132.2714972 2000 -16.83399721 2215 81.54100279 1956 275.6808314 1462 -32.46823322 1563 17.96926678 1459 27.15676678 1446 -123.1557332 1622 108.5942668 1657 67.96926678 1638 34.09426678 1643 -13.71823322 1683 -113.0932332 2050 54.34426678 2262 149.7192668 1813 153.8590954 1445 -28.28996923 1762 238.1475308 1461 50.33503077 1556 8.022530771 1431 -61.22746923 1427 -140.8524692 1554 -28.72746923 1645 9.460030771 1653 -121.9149692 2016 41.52253077 2207 115.8975308 1665 27.03735936 1361 -91.11170524 1506 3.325794759 1360 -29.48670524 1453 -73.79920524 1522 50.95079476 1460 -86.67420524 1552 -9.54920524 1548 -66.36170524 1827 73.26329476 1737 -216.2992052 1941 -128.9242052 1474 -142.7843767 1458 27.06655875 1542 60.50405875 1404 35.69155875 1522 16.37905875 1385 -64.87094125 1641 115.5040587 1510 -30.37094125 1681 87.81655875 1938 205.4415587 1868 -64.12094125 1726 -322.7459413 1456 -139.6061127 1445 35.24482274 1456 -4.317677263 1365 17.86982274 1487 2.557322737 1558 129.3073227 1488 -16.31767726 1684 164.8073227 1594 21.99482274 1850 138.6198227 1998 87.05732274 2079 51.43232274 1494 -80.42784867
 
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 computational 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
slachtoffers [t] = + 2324.06337308848 + 1.00000000000895 Dummies -451.374973246762 M1 -635.461053318543 M2 -583.133697990636 M3 -694.556342645981 M4 -555.478987323556 M5 -609.464131985079 M6 -532.074276650652 M7 -515.434421316216 M8 -460.857065991703 M9 -319.717210650036 M10 -118.389855330753 M11 -1.76485533229451 t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2324.063373088486.40751450961989e-09362709030092.59800
Dummies1.000000000008951.07283538240064e-1193210945165.817500
M1-451.3749732467627.86581059036631e-09-57384419324.765600
M2-635.4610533185438.00345561395977e-09-79398335415.287500
M3-583.1336979906368.00566308184479e-09-72840149782.603700
M4-694.5563426459818.00458642654087e-09-86769797418.019700
M5-555.4789873235568.00302140140848e-09-69408659487.752400
M6-609.4641319850797.99898949085522e-09-76192640668.154800
M7-532.0742766506527.9980078455196e-09-66525850802.798900
M8-515.4344213162167.99734251124019e-09-64450712294.962800
M9-460.8570659917038.00528767910367e-09-57569082394.713300
M10-319.7172106500368.00194890308115e-09-39954917798.453900
M11-118.3898553307537.99645441802284e-09-14805293589.108600
t-1.764855332294513.34187138949862e-11-52810390544.660900


Multiple Linear Regression - Regression Statistics
Multiple R1
R-squared1
Adjusted R-squared1
F-TEST (value)2.05720345638441e+21
F-TEST (DF numerator)13
F-TEST (DF denominator)155
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.11533830935603e-08
Sum Squared Residuals6.9357170526953e-14
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/1lxl71227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/1lxl71227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/2d8qg1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/2d8qg1227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/3hkbw1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/3hkbw1227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/4y56s1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/4y56s1227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/5d06p1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/5d06p1227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/6hd8f1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/6hd8f1227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/7lcnz1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/7lcnz1227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/8c3g01227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/8c3g01227776311.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/9t6te1227776311.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/27/t1227776354vqvienx3c7xhwt2/9t6te1227776311.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
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, 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] = ', '')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], ' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') myeq <- paste(myeq, rownames(mysum$coefficients)[i], '')
}
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,mysum$coefficients[i,2])
a<-table.element(a,mysum$coefficients[i,3])
a<-table.element(a,mysum$coefficients[i,4])
a<-table.element(a,mysum$coefficients[i,4]/2)
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')
 





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