Home » date » 2007 » Dec » 17 » attachments

Lineair Regressie Iran

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Mon, 17 Dec 2007 06:13:40 -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/17/t1197898015o8jisp79titomc5.htm/, Retrieved Mon, 17 Dec 2007 14:27:06 +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 0 24.61 0 25.68 0 25.62 0 20.54 0 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 0 33.15 0 37.99 0 35.24 0 38.24 0 43.16 0 43.33 0 49.67 0 43.17 0 39.56 0 44.36 0 45.22 0 53.1 0 52.1 0 48.52 0 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] = + 15.3991514616441 + 14.3949587992937Iran[t] + 2.07831497519547M1[t] + 2.37793730205442M2[t] + 4.07470248605622M3[t] + 5.0171819557723M4[t] + 5.11108999691695M5[t] + 3.50000392387678M6[t] + 5.33962625073572M7[t] + 6.0321057204518M8[t] + 3.560656828947M9[t] + 2.26432677485355M10[t] -0.675336612573228M11[t] + 0.454663387426778t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)15.39915146164412.4942986.173700
Iran14.39495879929372.1546366.680900
M12.078314975195472.8854580.72030.4739010.23695
M22.377937302054422.8837260.82460.4125660.206283
M34.074702486056222.8826631.41350.1622020.081101
M45.01718195577232.882271.74070.0863960.043198
M55.111089996916952.8825471.77310.0808230.040412
M63.500003923876782.8889651.21150.2300210.11501
M75.339626250735722.8867391.84970.0688330.034417
M86.03210572045182.8851812.09070.0404080.020204
M93.5606568289472.9933541.18950.2384970.119248
M102.264326774853552.991740.75690.4518280.225914
M11-0.6753366125732282.990771-0.22580.8220490.411025
t0.4546633874267780.04395510.343800


Multiple Linear Regression - Regression Statistics
Multiple R0.962629332889965
R-squared0.92665523254018
Adjusted R-squared0.912208535919305
F-TEST (value)64.1430533815784
F-TEST (DF numerator)13
F-TEST (DF denominator)66
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.1796083934521
Sum Squared Residuals1770.67064522828


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
125.6217.93212982426657.68787017573355
227.518.68641553855218.81358446144793
324.520.83784410998073.66215589001934
425.6622.23498696712353.4250130328765
528.3122.78355839569495.52644160430505
627.8521.62713571008166.22286428991844
724.6123.92142142436730.68857857563273
825.6825.06856428151010.611435718489871
925.6223.05177877743212.5682212225679
1020.5422.2101121107654-1.67011211076543
1118.819.7251121107654-0.925112110765436
1218.7120.8551121107654-2.14511211076543
1319.4623.3880904733877-3.92809047338770
1420.1224.1423761876734-4.02237618767342
1523.5426.293804759102-2.75380475910199
1625.627.6909476162449-2.09094761624485
1725.3928.2395190448163-2.84951904481627
1824.0927.0830963592029-2.99309635920289
1925.6929.3773820734886-3.68738207348860
2026.5630.5245249306315-3.96452493063146
2128.3328.5077394265534-0.177739426553438
2227.527.6660727598868-0.166072759886770
2324.2325.1810727598868-0.951072759886767
2428.2326.31107275988681.91892724011323
2531.2928.8440511225092.44594887749098
2632.7229.59833683679483.12166316320524
2730.4631.7497654082233-1.28976540822332
2824.8933.1469082653662-8.25690826536619
2925.6833.6954796939376-8.0154796939376
3027.5232.5390570083242-5.01905700832422
3128.434.8333427226099-6.43334272260994
3229.7135.9804855797528-6.27048557975279
3326.8533.9637000756748-7.11370007567476
3429.6233.1220334090081-3.5020334090081
3528.6930.6370334090081-1.9470334090081
3629.7631.7670334090081-2.0070334090081
3731.334.3000117716304-3.00001177163035
3830.8635.0542974859161-4.19429748591609
3933.4637.2057260573447-3.74572605734466
4033.1538.6028689144875-5.45286891448752
4137.9939.1514403430589-1.16144034305894
4235.2437.9950176574456-2.75501765744556
4338.2440.2893033717313-2.04930337173127
4443.1641.43644622887411.72355377112587
4543.3339.41966072479613.91033927520389
4649.6738.577994058129411.0920059418706
4743.1736.09299405812947.07700594187056
4839.5637.22299405812942.33700594187057
4944.3639.75597242075174.60402757924831
5045.2240.51025813503744.70974186496258
5153.142.66168670646610.4383132935340
5252.144.05882956360888.04117043639115
5348.5244.60740099218033.91259900781973
5454.8457.8459371058606-3.00593710586058
5557.5760.1402228201463-2.5702228201463
5664.1461.28736567728922.85263432271084
5762.8559.27058017321113.57941982678887
5858.7558.42891350654450.321086493455532
5955.3355.9439135065445-0.613913506544466
6057.0357.0739135065445-0.0439135065444644
6163.1859.60689186916673.57310813083328
6260.1960.3611775834525-0.171177583452458
6362.1262.512606154881-0.392606154881023
6470.1263.90974901202396.21025098797612
6569.7564.45832044059535.29167955940469
6668.5663.30189775498195.25810224501808
6773.7765.59618346926768.17381653073236
6873.2366.74332632641056.48667367358951
6961.9664.7265408223325-2.76654082233247
7057.8163.8848741556658-6.0748741556658
7158.7661.3998741556658-2.6398741556658
7262.4762.5298741556658-0.0598741556658028
7353.6865.062852518288-11.3828525182881
7457.5665.8171382325738-8.25713823257379
7562.0567.9685668040024-5.91856680400236
7667.4969.3657096611452-1.87570966114522
7767.2169.9142810897166-2.70428108971665
7871.0568.75785840410332.29214159589674
7976.9371.0521441183895.87785588161104
8070.7672.1992869755318-1.43928697553182
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/147b31197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/147b31197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/2wxgy1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/2wxgy1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/3g8uy1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/3g8uy1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/4ltsk1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/4ltsk1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/5dhkc1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/5dhkc1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/65s9s1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/65s9s1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/7et3l1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/7et3l1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/8mcyp1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/8mcyp1197897215.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/9goun1197897215.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197898015o8jisp79titomc5/9goun1197897215.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