Home » date » 2007 » Nov » 19 » attachments

lineaire trend

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Mon, 19 Nov 2007 12:15:19 -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/Nov/19/t119549932089f7xstp00lwhjv.htm/, Retrieved Mon, 19 Nov 2007 20:08:50 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
106.54 107.89 1 106.44 107.26 1 106.57 107.76 1 106.12 107.32 1 106.13 107.15 1 106.26 108.04 1 105.78 106.52 1 105.77 106.62 0 105.2 106.47 0 105.15 105.46 0 105.01 106.13 0 104.75 105.15 0 104.96 105.39 0 105.26 104.57 0 105.13 104.29 0 104.77 104.09 0 104.79 104.51 0 104.4 103.39 0 103.89 102.71 0 103.93 102.62 0 103.48 101.94 0 103.45 101.65 0 103.47 101.86 0 103.5 101.27 0 103.69 101.21 0 103.57 102.15 0 103.47 102.07 0 102.85 102.8 0 102.54 103.39 0 102.39 102.71 0 102.16 102.65 0 101.51 101.12 0 100.83 100.29 0 100.55 99.79 0 100.88 100.11 0 101 99.76 0 100.51 99.96 0 100.44 99.98 0 100.32 100.49 0 99.98 100.75 0 100.03 100.84 0 99.64 100.44 0 99.11 99.57 0 98.97 99.22 0 98.6 99.08 0 98.31 98.04 0 98.37 98.73 0 98.19 98.72 0 98.51 100.07 0 98.23 99.02 0 97.96 98.94 0 97.77 99 0 97.49 98.54 0 97.76 98.42 0 98.01 97.9 0 97.73 97.46 0 97.06 97 0 96.63 95.97 0 96.58 96.55 0 96.66 96.51 0 96.77 96.76 0 96.5 96.05 0 96.53 96.47 0 96.22 96.38 0 96.49 97.27 0 96.34 96.67 0 96.31 96.59 0 96.06 96.06 0 95.9 96.92 0 95.33 94.96 0 95.53 95.59 0 95.42 95.68 0 95.57 95.35 0 95.3 95.41 0 95.31 95.32 0 95.38 95.8 0 95.22 95.46 0 94.62 94.16 0 93.81 92.49 0 93.6 91.58 0 93.2 91.5 0 93.29 90.83 0 93.54 91.28 0 93.23 90.57 0 93.46 90.93 0 92.82 90.9 0 92.85 91.49 0 92.67 91.38 0 92.32 90.91 0 92.06 90.72 0 91.88 89.53 0 91.53 89.47 0 91.19 89.28 0
 
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
X[t] = + 103.956799581520 + 0.0277436224976786Y[t] -0.240428121994219D[t] + 0.22261655503733M1[t] + 0.209856411820287M2[t] + 0.312980163669945M3[t] + 0.173878277769374M4[t] + 0.23901190526251M5[t] + 0.219510100701345M6[t] + 0.0881549112736562M7[t] + 0.00085529777875065M8[t] -0.287562219485007M9[t] -0.323491449137164M10[t] -0.0810561418639918M11[t] -0.160791001539852t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)103.9567995815205.96331817.432700
Y0.02774362249767860.0558050.49720.6204770.310239
D-0.2404281219942190.209577-1.14720.2548020.127401
M10.222616555037330.2382320.93450.3529550.176477
M20.2098564118202870.2376810.88290.3799850.189992
M30.3129801636699450.2404661.30160.1968980.098449
M40.1738782777693740.2435620.71390.4774210.23871
M50.239011905262510.2472360.96670.3366640.168332
M60.2195101007013450.2435370.90130.3701820.185091
M70.08815491127365620.2379040.37050.7119780.355989
M80.000855297778750650.2356640.00360.9971130.498557
M9-0.2875622194850070.235656-1.22030.2260420.113021
M10-0.3234914491371640.244816-1.32140.1902430.095122
M11-0.08105614186399180.24347-0.33290.7400870.370044
t-0.1607910015398520.010155-15.834400


Multiple Linear Regression - Regression Statistics
Multiple R0.995616957055275
R-squared0.991253125176006
Adjusted R-squared0.98968317328452
F-TEST (value)631.390764616169
F-TEST (DF numerator)14
F-TEST (DF denominator)78
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.455035471598093
Sum Squared Residuals16.1504678721749


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1106.54106.771456444297-0.231456444297298
2106.44106.580426817367-0.140426817366874
3106.57106.5366313789260.03336862107448
4106.12106.224531297586-0.104531297586109
5106.13106.1241575077150.00584249228520312
6106.26105.9685565256370.291443474363295
7105.78105.6342400284730.145759971527303
8105.77105.6293518976820.140648102318069
9105.2105.1759818355040.0240181644963368
10105.15104.9512405455890.198759454411002
11105.01105.051473078396-0.041473078395764
12104.75104.944549468672-0.194549468672183
13104.96105.013033491569-0.0530334915691116
14105.26104.8167325763640.443267423635891
15105.13104.7512971123750.378702887625423
16104.77104.4458555004350.324144499565384
17104.79104.3618504478370.428149552163084
18104.4104.1504847845390.249515215461501
19103.89103.8394729302730.050527069727458
20103.93103.5888853892130.341114610787012
21103.48103.1208112071110.359188792889041
22103.45102.9160453253950.533954674605375
23103.47103.0035157918520.466484208147537
24103.5102.9074121949030.59258780509703
25103.69102.9675731310510.722426868949408
26103.57102.8201009914420.749899008558481
27103.47102.7602142519520.709785748048495
28102.85102.4805742089340.369425791065608
29102.54102.4012855721610.138714427838704
30102.39102.2021271027620.187872897238138
31102.16101.9083162944440.251683705555534
32101.51101.617777936988-0.107777936988252
33100.83101.145542211512-0.315542211511576
34100.55100.934950169071-0.384950169070729
35100.88101.025472434003-0.145472434003309
36101100.9360273064530.0639726935467434
37100.51101.003401584450-0.493401584450265
38100.44100.830405312143-0.390405312143332
39100.32100.786887309927-0.466887309926958
4099.98100.494207764336-0.514207764335922
41100.03100.401047316314-0.371047316314000
4299.64100.209657061214-0.569657061213912
4399.1199.8933739186734-0.783373918673393
4498.9799.6355730357645-0.665573035764449
4598.699.1824804098112-0.582480409811169
4698.3198.9569068112216-0.646906811221567
4798.3799.0576942164783-0.687694216478283
4898.1998.9776819205775-0.787681920577453
4998.5199.0769613644468-0.56696136444679
5098.2398.8742794160673-0.644279416067335
5197.9698.8143926765773-0.854392676577336
5297.7798.5161644064868-0.746164406486772
5397.4998.4077449660911-0.917744966091126
5497.7698.2241229252904-0.464122925290377
5598.0197.9175500506240.092449949375956
5697.7397.65725224169030.0727477583096912
5797.0697.1952816565378-0.135281656537769
5896.6396.9699854941732-0.339985494173159
5996.5897.0677211009551-0.48772110095513
6096.6696.9868764963794-0.326876496379365
6196.7797.0556379555013-0.285637955501264
6296.596.862388838771-0.362388838771014
6396.5396.8163739105298-0.286373910529843
6496.2296.5139840970646-0.293984097064631
6596.4996.44301854704090.0469814529591465
6696.3496.24607956744120.0939204325587787
6796.3195.9517138866740.358286113326132
6896.0695.68891915171530.371080848284658
6995.995.26357014825970.636429851740269
7095.3395.01247241697230.31752758302772
7195.5395.11159520487910.418404795120864
7295.4295.0343572712280.385642728771934
7395.5795.08702742930130.482972570698681
7495.394.91514090189430.384859098105718
7595.3194.85497672617930.455023273820709
7695.3894.56840077753780.811599222462239
7795.2294.46331057184180.756689428158168
7894.6294.24695105649380.373048943506173
7993.8193.9084730159552-0.098473015955166
8093.693.6351357044475-0.0351357044475297
8193.293.18370769584410.0162923041559023
8293.2992.96839923757870.321600762421359
8393.5493.0625281734360.477471826564084
8493.2392.96309534178670.266904658213293
8593.4693.03490859938340.42509140061664
8692.8292.8605251459515-0.0405251459515358
8792.8592.8192266335350.0307733664650291
8892.6792.51628194761980.153718052380204
8992.3292.4075850709992-0.0875850709991806
9092.0692.2220209766236-0.162020976623596
9191.8891.8968598748838-0.016859874883824
9291.5391.6471046424992-0.117104642499200
9391.1991.192624835421-0.0026248354210355
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/1rbis1195499714.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/1rbis1195499714.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/2pfxg1195499714.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/2pfxg1195499714.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/3xcqj1195499714.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/3xcqj1195499714.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/4uwri1195499714.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/4uwri1195499714.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/52e7m1195499714.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/52e7m1195499714.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/6vl461195499714.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/6vl461195499714.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/7qrag1195499715.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/7qrag1195499715.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/8md931195499715.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/8md931195499715.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/9hdvr1195499715.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/19/t119549932089f7xstp00lwhjv/9hdvr1195499715.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