Home » date » 2007 » Dec » 18 » attachments

Lineaire regressie Nigeria

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 18 Dec 2007 03:54:50 -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/18/t11979748340yvc6mbtxo7a5cw.htm/, Retrieved Tue, 18 Dec 2007 11:47:25 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
25.62 0 27.5 0 24.5 0 25.66 0 28.31 0 27.85 1 24.61 0 25.68 0 25.62 1 20.54 1 18.8 0 18.71 0 19.46 0 20.12 0 23.54 0 25.6 0 25.39 0 24.09 0 25.69 0 26.56 0 28.33 0 27.5 0 24.23 0 28.23 0 31.29 0 32.72 0 30.46 0 24.89 0 25.68 0 27.52 0 28.4 0 29.71 0 26.85 0 29.62 0 28.69 0 29.76 0 31.3 0 30.86 0 33.46 1 33.15 1 37.99 1 35.24 1 38.24 1 43.16 1 43.33 0 49.67 0 43.17 0 39.56 1 44.36 1 45.22 1 53.1 1 52.1 1 48.52 1 54.84 1 57.57 1 64.14 1 62.85 1 58.75 1 55.33 1 57.03 1 63.18 1 60.19 1 62.12 1 70.12 1 69.75 1 68.56 1 73.77 1 73.23 1 61.96 1 57.81 1 58.76 1 62.47 1 53.68 1 57.56 1 62.05 1 67.49 1 67.21 1 71.05 1 76.93 1 70.76 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 time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Brent[t] = + 11.0348138217140 + 5.49236972579178Aanslagen[t] + 2.54901862907124M1[t] + 2.69586780410164M2[t] + 3.45523558973322M3[t] + 4.24494190762077M4[t] + 4.18607679693687M5[t] + 3.69401601113987M6[t] + 6.16548943271195M7[t] + 6.70519575059948M8[t] + 4.01897628443263M9[t] + 2.56987307851065M10[t] + 0.392831493553957M11[t] + 0.607436539255319t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)11.03481382171402.9520763.7380.000390.000195
Aanslagen5.492369725791782.2122942.48270.0155910.007796
M12.549018629071243.5715010.71370.4779220.238961
M22.695867804101643.5702630.75510.4528810.226441
M33.455235589733223.5790460.96540.3378650.168933
M44.244941907620773.5759251.18710.2394480.119724
M54.186076796936873.5734241.17140.2456310.122815
M63.694016011139873.5994031.02630.3085040.154252
M76.165489432711953.5702891.72690.0888660.044433
M86.705195750599483.5696571.87840.0647460.032373
M94.018976284432633.7054431.08460.2820390.141019
M102.569873078510653.7039410.69380.4902290.245115
M110.3928314935539573.7178380.10570.9161720.458086
t0.6074365392553190.04718912.872500


Multiple Linear Regression - Regression Statistics
Multiple R0.942101045896997
R-squared0.887554380680216
Adjusted R-squared0.865406001117228
F-TEST (value)40.0731068454060
F-TEST (DF numerator)13
F-TEST (DF denominator)66
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation6.41333060691364
Sum Squared Residuals2714.63342525597


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
125.6214.191268990040711.4287310099593
227.514.945554704326412.5544452956736
324.516.31235902921328.18764097078677
425.6617.70950188635617.95049811364394
528.3118.258073314927510.0519266850725
627.8523.86581879417763.98418120582239
724.6121.45235902921323.15764097078678
825.6822.59950188635613.08049811364392
925.6226.0130886852363-0.393088685236307
1020.5425.1714220185696-4.63142201856963
1118.818.10944724707650.690552752923494
1218.7118.32405229277790.385947707222133
1319.4621.4805074611044-2.02050746110443
1420.1222.2347931753901-2.11479317539011
1523.5423.6015975002770-0.0615975002770488
1625.624.99874035741990.601259642580092
1725.3925.5473117859913-0.157311785991335
1824.0925.6626875394497-1.57268753944966
1925.6928.7415975002770-3.05159750027704
2026.5629.8887403574199-3.32874035741991
2128.3327.80995743050840.520042569491622
2227.526.96829076384170.53170923615829
2324.2325.3986857181403-1.16868571814034
2428.2325.61329076384172.6167092361583
2531.2928.76974593216832.52025406783174
2632.7229.5240316464543.19596835354601
2730.4630.8908359713409-0.430835971340876
2824.8932.2879788284837-7.39797882848374
2925.6832.8365502570552-7.15655025705516
3027.5232.9519260105135-5.43192601051348
3128.436.0308359713409-7.63083597134088
3229.7137.1779788284837-7.46797882848373
3326.8535.0991959015722-8.2491959015722
3429.6234.2575292349055-4.63752923490554
3528.6932.6879241892042-3.99792418920416
3629.7632.9025292349055-3.14252923490553
3731.336.0589844032321-4.75898440323209
3830.8636.8132701175178-5.95327011751782
3933.4643.6724441681965-10.2124441681965
4033.1545.0695870253393-11.9195870253393
4137.9945.6181584539108-7.62815845391076
4235.2445.7335342073691-10.4935342073691
4338.2448.8124441681965-10.5724441681965
4443.1649.9595870253393-6.79958702533933
4543.3342.3884343726360.941565627363964
4649.6741.54676770596948.12323229403063
4743.1739.9771626602683.19283733973200
4839.5645.6841374317611-6.12413743176112
4944.3648.8405926000877-4.48059260008768
5045.2249.5948783143734-4.37487831437341
5153.150.96168263926032.13831736073971
5252.152.3588254964032-0.258825496403159
5348.5252.9073969249746-4.38739692497458
5454.8453.02277267843291.8172273215671
5557.5756.10168263926031.4683173607397
5664.1457.24882549640326.89117450359684
5762.8555.17004256949167.67995743050838
5858.7554.3283759028254.42162409717504
5955.3352.75877085712362.57122914287641
6057.0352.97337590282494.05662409717505
6163.1856.12983107115157.05016892884849
6260.1956.88411678543723.30588321456276
6362.1258.25092111032413.86907888967587
6470.1259.64806396746710.4719360325330
6569.7560.19663539603849.55336460396159
6668.5660.31201114949678.24798885050328
6773.7763.390921110324110.3790788896759
6873.2364.5380639674678.69193603253302
6961.9662.4592810405555-0.499281040555453
7057.8161.6176143738888-3.80761437388879
7158.7660.0480093281874-1.28800932818742
7262.4760.26261437388882.20738562611122
7353.6863.4190695422153-9.73906954221534
7457.5664.1733552565011-6.61335525650106
7562.0565.540159581388-3.49015958138796
7667.4966.93730243853080.55269756146918
7767.2167.4858738671022-0.275873867102245
7871.0567.60124962056063.44875037943943
7976.9370.6801595813886.24984041861205
8070.7671.8273024385308-1.06730243853081
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/1zuem1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/1zuem1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/2m65s1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/2m65s1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/3cjks1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/3cjks1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/414tl1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/414tl1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/51kaq1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/51kaq1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/6cgml1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/6cgml1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/7y4901197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/7y4901197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/8tmaw1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/8tmaw1197975285.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/9735s1197975285.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t11979748340yvc6mbtxo7a5cw/9735s1197975285.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, 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