R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(9492.49,9682.35,9762.12,10124.63,10540.05,10601.61,10323.73,10418.4,10092.96,10364.91,10152.09,10032.8,10204.59,10001.6,10411.75,10673.38,10539.51,10723.78,10682.06,10283.19,10377.18,10486.64,10545.38,10554.27,10532.54,10324.31,10695.25,10827.81,10872.48,10971.19,11145.65,11234.68,11333.88,10997.97,11036.89,11257.35,11533.59,11963.12,12185.15,12377.62,12512.89,12631.48,12268.53,12754.8,13407.75,13480.21,13673.28,13239.71,13557.69,13901.28,13200.58,13406.97,12538.12,12419.57,12193.88,12656.63,12812.48,12056.67,11322.38,11530.75,11114.08),dim=c(1,61),dimnames=list(c('X'),1:61))
> y <- array(NA,dim=c(1,61),dimnames=list(c('X'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> 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
X t
1 9492.49 1
2 9682.35 2
3 9762.12 3
4 10124.63 4
5 10540.05 5
6 10601.61 6
7 10323.73 7
8 10418.40 8
9 10092.96 9
10 10364.91 10
11 10152.09 11
12 10032.80 12
13 10204.59 13
14 10001.60 14
15 10411.75 15
16 10673.38 16
17 10539.51 17
18 10723.78 18
19 10682.06 19
20 10283.19 20
21 10377.18 21
22 10486.64 22
23 10545.38 23
24 10554.27 24
25 10532.54 25
26 10324.31 26
27 10695.25 27
28 10827.81 28
29 10872.48 29
30 10971.19 30
31 11145.65 31
32 11234.68 32
33 11333.88 33
34 10997.97 34
35 11036.89 35
36 11257.35 36
37 11533.59 37
38 11963.12 38
39 12185.15 39
40 12377.62 40
41 12512.89 41
42 12631.48 42
43 12268.53 43
44 12754.80 44
45 13407.75 45
46 13480.21 46
47 13673.28 47
48 13239.71 48
49 13557.69 49
50 13901.28 50
51 13200.58 51
52 13406.97 52
53 12538.12 53
54 12419.57 54
55 12193.88 55
56 12656.63 56
57 12812.48 57
58 12056.67 58
59 11322.38 59
60 11530.75 60
61 11114.08 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) t
9643.57 55.41
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1909.58 -378.02 -72.04 331.54 1487.14
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9643.569 174.248 55.34 <2e-16 ***
t 55.411 4.888 11.34 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 672.1 on 59 degrees of freedom
Multiple R-squared: 0.6854, Adjusted R-squared: 0.6801
F-statistic: 128.5 on 1 and 59 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 7.832457e-03 1.566491e-02 0.9921675
[2,] 1.318280e-03 2.636561e-03 0.9986817
[3,] 6.238405e-03 1.247681e-02 0.9937616
[4,] 4.172961e-03 8.345921e-03 0.9958270
[5,] 1.028977e-02 2.057954e-02 0.9897102
[6,] 4.920180e-03 9.840359e-03 0.9950798
[7,] 3.966980e-03 7.933960e-03 0.9960330
[8,] 3.495710e-03 6.991420e-03 0.9965043
[9,] 1.635286e-03 3.270571e-03 0.9983647
[10,] 1.119813e-03 2.239626e-03 0.9988802
[11,] 4.359396e-04 8.718792e-04 0.9995641
[12,] 2.217291e-04 4.434582e-04 0.9997783
[13,] 8.074131e-05 1.614826e-04 0.9999193
[14,] 3.294901e-05 6.589802e-05 0.9999671
[15,] 1.134791e-05 2.269582e-05 0.9999887
[16,] 7.651016e-06 1.530203e-05 0.9999923
[17,] 3.510129e-06 7.020259e-06 0.9999965
[18,] 1.266202e-06 2.532405e-06 0.9999987
[19,] 4.248817e-07 8.497634e-07 0.9999996
[20,] 1.434143e-07 2.868287e-07 0.9999999
[21,] 5.219746e-08 1.043949e-07 0.9999999
[22,] 4.215682e-08 8.431364e-08 1.0000000
[23,] 1.519418e-08 3.038835e-08 1.0000000
[24,] 6.081772e-09 1.216354e-08 1.0000000
[25,] 2.567214e-09 5.134427e-09 1.0000000
[26,] 1.256209e-09 2.512419e-09 1.0000000
[27,] 8.892944e-10 1.778589e-09 1.0000000
[28,] 7.084381e-10 1.416876e-09 1.0000000
[29,] 6.539212e-10 1.307842e-09 1.0000000
[30,] 6.042619e-10 1.208524e-09 1.0000000
[31,] 9.678747e-10 1.935749e-09 1.0000000
[32,] 2.386211e-09 4.772422e-09 1.0000000
[33,] 1.381091e-08 2.762181e-08 1.0000000
[34,] 3.180651e-07 6.361301e-07 0.9999997
[35,] 7.139448e-06 1.427890e-05 0.9999929
[36,] 1.062464e-04 2.124928e-04 0.9998938
[37,] 9.219091e-04 1.843818e-03 0.9990781
[38,] 5.283239e-03 1.056648e-02 0.9947168
[39,] 6.598351e-02 1.319670e-01 0.9340165
[40,] 3.619880e-01 7.239759e-01 0.6380120
[41,] 6.262668e-01 7.474664e-01 0.3737332
[42,] 7.636934e-01 4.726132e-01 0.2363066
[43,] 7.980730e-01 4.038540e-01 0.2019270
[44,] 8.630374e-01 2.739251e-01 0.1369626
[45,] 8.402501e-01 3.194998e-01 0.1597499
[46,] 8.474127e-01 3.051745e-01 0.1525873
[47,] 7.737696e-01 4.524608e-01 0.2262304
[48,] 7.355384e-01 5.289232e-01 0.2644616
[49,] 6.870113e-01 6.259774e-01 0.3129887
[50,] 6.706267e-01 6.587466e-01 0.3293733
[51,] 8.617581e-01 2.764839e-01 0.1382419
[52,] 7.664595e-01 4.670811e-01 0.2335405
> postscript(file="/var/www/html/rcomp/tmp/12awg1227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> 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()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/26xp11227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3u3lv1227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/45l1f1227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5ieho1227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 61
Frequency = 1
1 2 3 4 5 6
-206.49080 -72.04220 -47.68359 259.41501 619.42362 625.57223
7 8 9 10 11 12
292.28083 331.53944 -49.31196 167.22665 -101.00474 -275.70614
13 14 15 16 17 18
-159.32753 -417.72893 -62.99032 143.22829 -46.05311 82.80550
19 20 21 22 23 24
-14.32590 -468.60729 -430.02868 -375.98008 -372.65147 -419.17287
25 26 27 28 29 30
-496.31426 -759.95565 -444.42705 -367.27844 -378.01984 -334.72123
31 32 33 34 35 36
-215.67262 -182.05402 -138.26541 -529.58680 -546.07820 -381.02959
37 38 39 40 41 42
-160.20099 213.91762 380.53623 517.59483 597.45344 660.63204
43 44 45 46 47 48
242.27065 673.12926 1270.66786 1287.71647 1425.37507 936.39368
49 50 51 52 53 54
1198.96229 1487.14089 731.02950 882.00810 -42.25329 -216.21468
55 56 57 58 59 60
-497.31608 -89.97747 10.46113 -800.76026 -1590.46165 -1437.50305
61
-1909.58444
> postscript(file="/var/www/html/rcomp/tmp/6lux31227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -206.49080 NA
1 -72.04220 -206.49080
2 -47.68359 -72.04220
3 259.41501 -47.68359
4 619.42362 259.41501
5 625.57223 619.42362
6 292.28083 625.57223
7 331.53944 292.28083
8 -49.31196 331.53944
9 167.22665 -49.31196
10 -101.00474 167.22665
11 -275.70614 -101.00474
12 -159.32753 -275.70614
13 -417.72893 -159.32753
14 -62.99032 -417.72893
15 143.22829 -62.99032
16 -46.05311 143.22829
17 82.80550 -46.05311
18 -14.32590 82.80550
19 -468.60729 -14.32590
20 -430.02868 -468.60729
21 -375.98008 -430.02868
22 -372.65147 -375.98008
23 -419.17287 -372.65147
24 -496.31426 -419.17287
25 -759.95565 -496.31426
26 -444.42705 -759.95565
27 -367.27844 -444.42705
28 -378.01984 -367.27844
29 -334.72123 -378.01984
30 -215.67262 -334.72123
31 -182.05402 -215.67262
32 -138.26541 -182.05402
33 -529.58680 -138.26541
34 -546.07820 -529.58680
35 -381.02959 -546.07820
36 -160.20099 -381.02959
37 213.91762 -160.20099
38 380.53623 213.91762
39 517.59483 380.53623
40 597.45344 517.59483
41 660.63204 597.45344
42 242.27065 660.63204
43 673.12926 242.27065
44 1270.66786 673.12926
45 1287.71647 1270.66786
46 1425.37507 1287.71647
47 936.39368 1425.37507
48 1198.96229 936.39368
49 1487.14089 1198.96229
50 731.02950 1487.14089
51 882.00810 731.02950
52 -42.25329 882.00810
53 -216.21468 -42.25329
54 -497.31608 -216.21468
55 -89.97747 -497.31608
56 10.46113 -89.97747
57 -800.76026 10.46113
58 -1590.46165 -800.76026
59 -1437.50305 -1590.46165
60 -1909.58444 -1437.50305
61 NA -1909.58444
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -72.04220 -206.49080
[2,] -47.68359 -72.04220
[3,] 259.41501 -47.68359
[4,] 619.42362 259.41501
[5,] 625.57223 619.42362
[6,] 292.28083 625.57223
[7,] 331.53944 292.28083
[8,] -49.31196 331.53944
[9,] 167.22665 -49.31196
[10,] -101.00474 167.22665
[11,] -275.70614 -101.00474
[12,] -159.32753 -275.70614
[13,] -417.72893 -159.32753
[14,] -62.99032 -417.72893
[15,] 143.22829 -62.99032
[16,] -46.05311 143.22829
[17,] 82.80550 -46.05311
[18,] -14.32590 82.80550
[19,] -468.60729 -14.32590
[20,] -430.02868 -468.60729
[21,] -375.98008 -430.02868
[22,] -372.65147 -375.98008
[23,] -419.17287 -372.65147
[24,] -496.31426 -419.17287
[25,] -759.95565 -496.31426
[26,] -444.42705 -759.95565
[27,] -367.27844 -444.42705
[28,] -378.01984 -367.27844
[29,] -334.72123 -378.01984
[30,] -215.67262 -334.72123
[31,] -182.05402 -215.67262
[32,] -138.26541 -182.05402
[33,] -529.58680 -138.26541
[34,] -546.07820 -529.58680
[35,] -381.02959 -546.07820
[36,] -160.20099 -381.02959
[37,] 213.91762 -160.20099
[38,] 380.53623 213.91762
[39,] 517.59483 380.53623
[40,] 597.45344 517.59483
[41,] 660.63204 597.45344
[42,] 242.27065 660.63204
[43,] 673.12926 242.27065
[44,] 1270.66786 673.12926
[45,] 1287.71647 1270.66786
[46,] 1425.37507 1287.71647
[47,] 936.39368 1425.37507
[48,] 1198.96229 936.39368
[49,] 1487.14089 1198.96229
[50,] 731.02950 1487.14089
[51,] 882.00810 731.02950
[52,] -42.25329 882.00810
[53,] -216.21468 -42.25329
[54,] -497.31608 -216.21468
[55,] -89.97747 -497.31608
[56,] 10.46113 -89.97747
[57,] -800.76026 10.46113
[58,] -1590.46165 -800.76026
[59,] -1437.50305 -1590.46165
[60,] -1909.58444 -1437.50305
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -72.04220 -206.49080
2 -47.68359 -72.04220
3 259.41501 -47.68359
4 619.42362 259.41501
5 625.57223 619.42362
6 292.28083 625.57223
7 331.53944 292.28083
8 -49.31196 331.53944
9 167.22665 -49.31196
10 -101.00474 167.22665
11 -275.70614 -101.00474
12 -159.32753 -275.70614
13 -417.72893 -159.32753
14 -62.99032 -417.72893
15 143.22829 -62.99032
16 -46.05311 143.22829
17 82.80550 -46.05311
18 -14.32590 82.80550
19 -468.60729 -14.32590
20 -430.02868 -468.60729
21 -375.98008 -430.02868
22 -372.65147 -375.98008
23 -419.17287 -372.65147
24 -496.31426 -419.17287
25 -759.95565 -496.31426
26 -444.42705 -759.95565
27 -367.27844 -444.42705
28 -378.01984 -367.27844
29 -334.72123 -378.01984
30 -215.67262 -334.72123
31 -182.05402 -215.67262
32 -138.26541 -182.05402
33 -529.58680 -138.26541
34 -546.07820 -529.58680
35 -381.02959 -546.07820
36 -160.20099 -381.02959
37 213.91762 -160.20099
38 380.53623 213.91762
39 517.59483 380.53623
40 597.45344 517.59483
41 660.63204 597.45344
42 242.27065 660.63204
43 673.12926 242.27065
44 1270.66786 673.12926
45 1287.71647 1270.66786
46 1425.37507 1287.71647
47 936.39368 1425.37507
48 1198.96229 936.39368
49 1487.14089 1198.96229
50 731.02950 1487.14089
51 882.00810 731.02950
52 -42.25329 882.00810
53 -216.21468 -42.25329
54 -497.31608 -216.21468
55 -89.97747 -497.31608
56 10.46113 -89.97747
57 -800.76026 10.46113
58 -1590.46165 -800.76026
59 -1437.50305 -1590.46165
60 -1909.58444 -1437.50305
> 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()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7k6m11227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8q43b1227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/90rn01227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/104ha81227779774.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/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="/var/www/html/rcomp/tmp/11uv441227779774.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
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="/var/www/html/rcomp/tmp/12cxl31227779774.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="/var/www/html/rcomp/tmp/13ezic1227779774.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
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
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="/var/www/html/rcomp/tmp/14emfj1227779774.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15c7s11227779774.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/168v9q1227779775.tab")
+ }
>
> system("convert tmp/12awg1227779774.ps tmp/12awg1227779774.png")
> system("convert tmp/26xp11227779774.ps tmp/26xp11227779774.png")
> system("convert tmp/3u3lv1227779774.ps tmp/3u3lv1227779774.png")
> system("convert tmp/45l1f1227779774.ps tmp/45l1f1227779774.png")
> system("convert tmp/5ieho1227779774.ps tmp/5ieho1227779774.png")
> system("convert tmp/6lux31227779774.ps tmp/6lux31227779774.png")
> system("convert tmp/7k6m11227779774.ps tmp/7k6m11227779774.png")
> system("convert tmp/8q43b1227779774.ps tmp/8q43b1227779774.png")
> system("convert tmp/90rn01227779774.ps tmp/90rn01227779774.png")
> system("convert tmp/104ha81227779774.ps tmp/104ha81227779774.png")
>
>
> proc.time()
user system elapsed
2.779 1.721 3.383