Home » date » 2007 » Nov » 14 » attachments

WS6 - Regression - Metal production - Verhofstadt II

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 14 Nov 2007 13:28:26 -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/14/t1195071848fsvi267qwgcloi3.htm/, Retrieved Wed, 14 Nov 2007 21:24:18 +0100
 
User-defined keywords:
WS6RMPV
 
Dataseries X:
» Textbox « » Textfile « » CSV «
97,3 0 101 0 113,2 0 101 0 105,7 0 113,9 0 86,4 0 96,5 0 103,3 0 114,9 0 105,8 0 94,2 0 98,4 0 99,4 0 108,8 0 112,6 0 104,4 0 112,2 0 81,1 0 97,1 0 112,6 0 113,8 0 107,8 0 103,2 0 103,3 0 101,2 0 107,7 0 110,4 0 101,9 0 115,9 0 89,9 1 88,6 1 117,2 1 123,9 1 100 1 103,6 1 94,1 1 98,7 1 119,5 1 112,7 1 104,4 1 124,7 1 89,1 1 97 1 121,6 1 118,8 1 114 1 111,5 1 97,2 1 102,5 1 113,4 1 109,8 1 104,9 1 126,1 1 80 1 96,8 1 117,2 1 112,3 1 117,3 1 111,1 1 102,2 1 104,3 1 122,9 1 107,6 1 121,3 1 131,5 1 89 1 104,4 1 128,9 1 135,9 1 133,3 1 121,3 1 120,5 1 120,4 1 137,9 1 126,1 1 133,2 1 146,6 0 103,4 0 117,2 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 time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Y[t] = + 95.6270870655679 -6.5084378359011X[t] -4.31804112424862M1[t] -2.63221266770174M2[t] + 10.6821872174165M3[t] + 4.12515853110623M4[t] + 3.11098698765305M5[t] + 15.3813243247855M6[t] -20.0744989563961M7[t] -9.21724192842071M8[t] + 10.4734670113119M9[t] + 13.2212002297635M10[t] + 5.93560011488173M11[t] + 0.385600114881735t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)95.62708706556792.70577235.341900
X-6.50843783590111.923382-3.38390.0012070.000603
M1-4.318041124248623.30037-1.30840.1952930.097646
M2-2.632212667701743.299704-0.79770.4278990.213949
M310.68218721741653.2995433.23750.0018880.000944
M44.125158531106233.2998861.25010.2156810.10784
M53.110986987653053.3007330.94250.3493670.174683
M615.38132432478553.3286524.62091.8e-059e-06
M7-20.07449895639613.303939-6.075900
M8-9.217241928420713.306295-2.78780.0069250.003463
M910.47346701131193.4236463.05920.0032060.001603
M1013.22120022976353.4224313.86310.0002580.000129
M115.935600114881733.4217011.73470.0874630.043732
t0.3856001148817350.0407979.451600


Multiple Linear Regression - Regression Statistics
Multiple R0.911986029816551
R-squared0.831718518580555
Adjusted R-squared0.798572166179755
F-TEST (value)25.0923090578282
F-TEST (DF numerator)13
F-TEST (DF denominator)66
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.92613924965973
Sum Squared Residuals2317.86234281960


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
197.391.69464605620135.60535394379869
210193.76607462762967.23392537237036
3113.2107.4660746276305.73392537237038
4101101.294646056201-0.294646056201046
5105.7100.6660746276305.0339253723704
6113.9113.3220120796440.577987920356247
786.478.25178891334398.14821108665613
896.589.4946460562017.00535394379895
9103.3109.570955110815-6.2709551108154
10114.9112.7042884441492.19571155585129
11105.8105.804288444149-0.00428844414869245
1294.2100.254288444149-6.05428844414871
1398.496.32184743478182.07815256521820
1499.498.39327600621041.00672399378957
15108.8112.093276006210-3.29327600621043
16112.6105.9218474347826.67815256521813
17104.4105.293276006210-0.89327600621043
18112.2117.949213458225-5.74921345822455
1981.182.8789902919247-1.77899029192473
2097.194.12184743478192.97815256521814
21112.6114.198156489396-1.59815648939619
22113.8117.331489822730-3.53148982272952
23107.8110.431489822730-2.63148982272953
24103.2104.881489822730-1.68148982272952
25103.3100.9490488133632.35095118663737
26101.2103.020477384791-1.82047738479124
27107.7116.720477384791-9.02047738479125
28110.4110.549048813363-0.149048813362669
29101.9109.920477384791-8.02047738479125
30115.9122.576414836805-6.67641483680536
3189.980.99775383460448.90224616539558
3288.692.2406109774616-3.64061097746157
33117.2112.3169200320764.88307996792412
34123.9115.4502533654098.44974663459079
35100108.550253365409-8.55025336540922
36103.6103.0002533654090.599746634590766
3794.199.0678123560423-4.96781235604234
3898.7101.139240927471-2.43924092747095
39119.5114.8392409274714.66075907252905
40112.7108.6678123560424.03218764395762
41104.4108.039240927471-3.63924092747095
42124.7120.6951783794854.00482162051493
4389.185.62495521318523.47504478681475
449796.86781235604240.132187643957619
45121.6116.9441214106574.6558785893433
46118.8120.07745474399-1.27745474399004
47114113.177454743990.82254525600996
48111.5107.627454743993.87254525600996
4997.2103.695013734623-6.49501373462315
50102.5105.766442306052-3.26644230605176
51113.4119.466442306052-6.06644230605176
52109.8113.295013734623-3.4950137346232
53104.9112.666442306052-7.76644230605176
54126.1125.3223797580660.7776202419341
558090.252156591766-10.2521565917661
5696.8101.495013734623-4.6950137346232
57117.2121.571322789238-4.37132278923751
58112.3124.704656122571-12.4046561225709
59117.3117.804656122571-0.50465612257086
60111.1112.254656122571-1.15465612257086
61102.2108.322215113204-6.12221511320397
62104.3110.393643684633-6.09364368463258
63122.9124.093643684633-1.19364368463258
64107.6117.922215113204-10.322215113204
65121.3117.2936436846334.00635631536741
66131.5129.9495811366471.55041886335329
678994.8793579703469-5.87935797034688
68104.4106.122215113204-1.72221511320401
69128.9126.1985241678182.70147583218168
70135.9129.3318575011526.56814249884834
71133.3122.43185750115210.8681424988483
72121.3116.8818575011524.41814249884832
73120.5112.9494164917857.55058350821522
74120.4115.0208450632135.37915493678661
75137.9128.7208450632139.17915493678661
76126.1122.5494164917853.55058350821516
77133.2121.92084506321311.2791549367866
78146.6141.0852203511295.51477964887135
79103.4106.014997184829-2.6149971848288
80117.2117.257854327686-0.0578543276859312
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/1p2hw1195072094.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/1p2hw1195072094.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/2je061195072094.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/2je061195072094.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/3c0f11195072094.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/3c0f11195072094.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/4imye1195072095.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/4imye1195072095.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/55xc61195072095.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/55xc61195072095.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/6pss31195072095.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/6pss31195072095.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/7i12r1195072095.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/7i12r1195072095.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/8cr4m1195072095.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/8cr4m1195072095.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/9reyf1195072095.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/14/t1195071848fsvi267qwgcloi3/9reyf1195072095.ps (open in new window)


 
Parameters:
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No 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