Home » date » 2008 » Jan » 06 » attachments

s 0650692 paper

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Sun, 06 Jan 2008 10:19:16 -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/06/t1199640052t1pf5fs5z6nddqe.htm/, Retrieved Sun, 06 Jan 2008 18:21:03 +0100
 
User-defined keywords:
dieselprijs te verklaren door inflatie
 
Dataseries X:
» Textbox « » Textfile « » CSV «
0,73 1,79 0,74 1,95 0,75 2,26 0,74 2,04 0,76 2,16 0,76 2,75 0,78 2,79 0,79 2,88 0,89 3,36 0,88 2,97 0,88 3,1 0,84 2,49 0,76 2,2 0,77 2,25 0,76 2,09 0,77 2,79 0,78 3,14 0,79 2,93 0,78 2,65 0,76 2,67 0,78 2,26 0,76 2,35 0,74 2,13 0,73 2,18 0,72 2,9 0,71 2,63 0,73 2,67 0,75 1,81 0,75 1,33 0,72 0,88 0,72 1,28 0,72 1,26 0,74 1,26 0,78 1,29 0,74 1,1 0,74 1,37 0,75 1,21 0,78 1,74 0,81 1,76 0,75 1,48 0,7 1,04 0,71 1,62 0,71 1,49 0,73 1,79 0,74 1,8 0,74 1,58 0,75 1,86 0,74 1,74 0,74 1,59 0,73 1,26 0,76 1,13 0,8 1,92 0,83 2,61 0,81 2,26 0,83 2,41 0,88 2,26 0,89 2,03 0,93 2,86 0,91 2,55 0,9 2,27 0,86 2,26 0,88 2,57 0,93 3,07 0,98 2,76 0,97 2,51 1,03 2,87 1,06 3,14 1,06 3,11 1,08 3,16 1,09 2,47 1,04 2,57 1 2,89
 
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 time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
dsl[t] = + 0.490196229042141 + 0.0965244180906564`inf `[t] + 0.00301888250299787t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.4901962290421410.02488619.697600
`inf `0.09652441809065640.0098839.767100
t0.003018882502997870.00030110.035300


Multiple Linear Regression - Regression Statistics
Multiple R0.86202495733774
R-squared0.743087027073131
Adjusted R-squared0.735640274234671
F-TEST (value)99.7867182102965
F-TEST (DF numerator)2
F-TEST (DF denominator)69
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.0530413350357076
Sum Squared Residuals0.194123442343542


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
10.730.6659938199274120.0640061800725882
20.740.6844566093249170.055543390675083
30.750.7173980614360180.032601938563982
40.740.6991815719590720.0408184280409284
50.760.7137833846329480.0462166153670518
60.760.773751673809433-0.0137516738094333
70.780.780631533036057-0.00063153303605741
80.790.792337613167214-0.00233761316721433
90.890.8416882163537270.0483117836462727
100.880.8070625758013690.0729374241986308
110.880.8226296326561520.0573703673438476
120.840.766768620123850.0732313798761501
130.760.7417954213805570.0182045786194426
140.770.7496405247880880.0203594752119119
150.760.7372155003965810.0227844996034191
160.770.807801475563038-0.0378014755630382
170.780.844603904397766-0.0646039043977659
180.790.827352659101726-0.0373526591017259
190.780.80334470453934-0.0233447045393399
200.760.808294075404151-0.0482940754041509
210.780.771737946489980.00826205351002031
220.760.783444026621137-0.0234440266211367
230.740.76522753714419-0.0252275371441901
240.730.773072640551721-0.0430726405517209
250.720.845589104079991-0.125589104079991
260.710.822546393698512-0.112546393698512
270.730.829426252925136-0.099426252925136
280.750.749434135870170.000565864129830549
290.750.7061212976896520.0438787023103477
300.720.6657041920518550.0542958079481452
310.720.7073328417911150.0126671582088848
320.720.70842123593230.0115787640677000
330.740.7114401184352980.0285598815647022
340.780.7173547334810150.0626452665189847
350.740.7020339765467890.0379660234532115
360.740.7311144519342640.00888554806573639
370.750.7186894275427560.0313105724572436
380.780.7728662516338020.00713374836619783
390.810.7778156224986130.0321843775013869
400.750.753807667936227-0.00380766793622727
410.70.714355806479336-0.0143558064793364
420.710.773358851474915-0.0633588514749149
430.710.763829559626127-0.0538295596261275
440.730.795805767556322-0.0658057675563223
450.740.799789894240227-0.0597898942402267
460.740.78157340476328-0.0415734047632801
470.750.811619124331662-0.0616191243316618
480.740.803055076663781-0.0630550766637809
490.740.79159529645318-0.0515952964531803
500.730.762761120986262-0.0327611209862616
510.760.7532318291374740.00676817086252592
520.80.83250500193209-0.0325050019320905
530.830.902125732917641-0.0721257329176413
540.810.87136106908891-0.0613610690889093
550.830.888858614305506-0.0588586143055058
560.880.8773988340949050.00260116590509487
570.890.8582171004370520.0317828995629480
580.930.941351249955295-0.0113512499552947
590.910.91444756285019-0.00444756285018907
600.90.8904396082878030.00956039171219682
610.860.892493246609894-0.0324932466098945
620.880.925434698720996-0.0454346987209958
630.930.976715790269322-0.0467157902693218
640.980.9498121031642160.0301878968357837
650.970.928699881144550.0413001188554499
661.030.9664675541601840.0635324458398158
671.060.995548029547660.0644519704523407
681.060.9956711795079370.0643288204920626
691.081.003516282915470.0764837170845318
701.090.9399333169359130.150066683064087
711.040.9526046412479770.0873953587520234
7210.9865113375399850.0134886624600154
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/1za8k1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/1za8k1199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/2jegc1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/2jegc1199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/3uyq71199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/3uyq71199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/4i7xw1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/4i7xw1199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/5guge1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/5guge1199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/6ohzk1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/6ohzk1199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/7jgyr1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/7jgyr1199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/884a31199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/884a31199639951.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/9e94y1199639951.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/06/t1199640052t1pf5fs5z6nddqe/9e94y1199639951.ps (open in new window)


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

  • 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