R version 2.9.0 (2009-04-17)
Copyright (C) 2009 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(462,1919,455,1911,461,1870,461,2263,463,1802,462,1863,456,1989,455,2197,456,2409,472,2502,472,2593,471,2598,465,2053,459,2213,465,2238,468,2359,467,2151,463,2474,460,3079,462,2312,461,2565,476,1972,476,2484,471,2202,453,2151,443,1976,442,2012,444,2114,438,1772,427,1957,424,2070,416,1990,406,2182,431,2008,434,1916,418,2397,412,2114,404,1778,409,1641,412,2186,406,1773,398,1785,397,2217,385,2153,390,1895,413,2475,413,1793,401,2308,397,2051,397,1898,409,2142,419,1874,424,1560,428,1808,430,1575,424,1525,433,1997,456,1753,459,1623,446,2251,441,1890),dim=c(2,61),dimnames=list(c('wkl','bvg'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('wkl','bvg'),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 = 'No 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
wkl bvg
1 462 1919
2 455 1911
3 461 1870
4 461 2263
5 463 1802
6 462 1863
7 456 1989
8 455 2197
9 456 2409
10 472 2502
11 472 2593
12 471 2598
13 465 2053
14 459 2213
15 465 2238
16 468 2359
17 467 2151
18 463 2474
19 460 3079
20 462 2312
21 461 2565
22 476 1972
23 476 2484
24 471 2202
25 453 2151
26 443 1976
27 442 2012
28 444 2114
29 438 1772
30 427 1957
31 424 2070
32 416 1990
33 406 2182
34 431 2008
35 434 1916
36 418 2397
37 412 2114
38 404 1778
39 409 1641
40 412 2186
41 406 1773
42 398 1785
43 397 2217
44 385 2153
45 390 1895
46 413 2475
47 413 1793
48 401 2308
49 397 2051
50 397 1898
51 409 2142
52 419 1874
53 424 1560
54 428 1808
55 430 1575
56 424 1525
57 433 1997
58 456 1753
59 459 1623
60 446 2251
61 441 1890
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) bvg
376.06209 0.02984
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-55.301 -19.438 5.906 20.592 41.099
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 376.06209 22.57327 16.660 < 2e-16 ***
bvg 0.02984 0.01077 2.772 0.00745 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 24.87 on 59 degrees of freedom
Multiple R-squared: 0.1152, Adjusted R-squared: 0.1002
F-statistic: 7.682 on 1 and 59 DF, p-value: 0.007451
> 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,] 4.371047e-03 8.742094e-03 0.99562895
[2,] 6.071365e-04 1.214273e-03 0.99939286
[3,] 1.704132e-04 3.408264e-04 0.99982959
[4,] 3.565712e-05 7.131423e-05 0.99996434
[5,] 4.426414e-06 8.852829e-06 0.99999557
[6,] 5.639826e-05 1.127965e-04 0.99994360
[7,] 2.877781e-05 5.755562e-05 0.99997122
[8,] 8.419734e-06 1.683947e-05 0.99999158
[9,] 2.727803e-06 5.455606e-06 0.99999727
[10,] 8.096012e-07 1.619202e-06 0.99999919
[11,] 2.084415e-07 4.168831e-07 0.99999979
[12,] 6.237143e-08 1.247429e-07 0.99999994
[13,] 2.556855e-08 5.113710e-08 0.99999997
[14,] 7.739705e-09 1.547941e-08 0.99999999
[15,] 1.032885e-08 2.065771e-08 0.99999999
[16,] 3.172057e-09 6.344115e-09 1.00000000
[17,] 1.194975e-09 2.389951e-09 1.00000000
[18,] 2.030411e-08 4.060821e-08 0.99999998
[19,] 1.354023e-07 2.708045e-07 0.99999986
[20,] 4.315490e-07 8.630980e-07 0.99999957
[21,] 1.142508e-06 2.285015e-06 0.99999886
[22,] 1.133550e-05 2.267100e-05 0.99998866
[23,] 6.267709e-05 1.253542e-04 0.99993732
[24,] 2.250015e-04 4.500031e-04 0.99977500
[25,] 5.020273e-04 1.004055e-03 0.99949797
[26,] 3.651386e-03 7.302772e-03 0.99634861
[27,] 1.723738e-02 3.447476e-02 0.98276262
[28,] 6.035072e-02 1.207014e-01 0.93964928
[29,] 2.219855e-01 4.439710e-01 0.77801449
[30,] 2.245119e-01 4.490239e-01 0.77548807
[31,] 2.125600e-01 4.251200e-01 0.78744000
[32,] 3.104419e-01 6.208838e-01 0.68955812
[33,] 3.709121e-01 7.418241e-01 0.62908793
[34,] 4.395265e-01 8.790529e-01 0.56047354
[35,] 4.429830e-01 8.859661e-01 0.55701696
[36,] 4.621301e-01 9.242602e-01 0.53786992
[37,] 4.702212e-01 9.404424e-01 0.52977882
[38,] 5.462532e-01 9.074936e-01 0.45374680
[39,] 6.164295e-01 7.671409e-01 0.38357046
[40,] 7.738611e-01 4.522778e-01 0.22613889
[41,] 8.712771e-01 2.574458e-01 0.12872288
[42,] 8.496717e-01 3.006566e-01 0.15032832
[43,] 8.164135e-01 3.671730e-01 0.18358652
[44,] 8.113412e-01 3.773175e-01 0.18865875
[45,] 8.625824e-01 2.748352e-01 0.13741762
[46,] 9.362455e-01 1.275090e-01 0.06375452
[47,] 9.614987e-01 7.700267e-02 0.03850133
[48,] 9.610316e-01 7.793682e-02 0.03896841
[49,] 9.384747e-01 1.230505e-01 0.06152527
[50,] 9.056204e-01 1.887593e-01 0.09437964
[51,] 8.446185e-01 3.107631e-01 0.15538154
[52,] 9.288503e-01 1.422995e-01 0.07114973
> postscript(file="/var/www/html/rcomp/tmp/1r3af1258739231.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/2193q1258739231.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/3a0d31258739231.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/4a9c41258739231.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/5xlbk1258739231.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
28.6805116 21.9192084 29.1425295 17.4165493 33.1714523 30.3513892
7 8 9 10 11 12
20.5919146 13.3857979 8.0603327 21.2854825 18.5703064 17.4211209
13 14 15 16 17 18
27.6823402 16.9084043 22.1624768 21.5521877 26.7583045 13.1209213
19 20 21 22 23 24
-7.9305241 16.9545314 8.4057452 41.0991453 25.8225503 29.2366124
25 26 27 28 29 30
12.7583045 7.9797969 5.9056613 4.8622771 9.0665652 -7.4532982
31 32 33 34 35 36
-13.8248905 -19.4379225 -35.1666456 -4.9749903 0.7700229 -29.5816221
37 38 39 40 41 42
-27.1377229 -25.1124574 -16.0247747 -29.2859940 -22.9632719 -31.3213170
43 44 45 46 47 48
-45.2109441 -55.3013697 -42.6033980 -36.9089158 -16.5600138 -43.9261202
49 50 51 52 53 54
-40.2579856 -35.6929093 -30.9731616 -12.9768189 1.3920304 -2.0075703
55 56 57 58 59 60
6.9444739 2.4363289 -2.6467822 27.6334701 34.5122931 2.7745945
61
8.5457875
> postscript(file="/var/www/html/rcomp/tmp/62tza1258739231.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 28.6805116 NA
1 21.9192084 28.6805116
2 29.1425295 21.9192084
3 17.4165493 29.1425295
4 33.1714523 17.4165493
5 30.3513892 33.1714523
6 20.5919146 30.3513892
7 13.3857979 20.5919146
8 8.0603327 13.3857979
9 21.2854825 8.0603327
10 18.5703064 21.2854825
11 17.4211209 18.5703064
12 27.6823402 17.4211209
13 16.9084043 27.6823402
14 22.1624768 16.9084043
15 21.5521877 22.1624768
16 26.7583045 21.5521877
17 13.1209213 26.7583045
18 -7.9305241 13.1209213
19 16.9545314 -7.9305241
20 8.4057452 16.9545314
21 41.0991453 8.4057452
22 25.8225503 41.0991453
23 29.2366124 25.8225503
24 12.7583045 29.2366124
25 7.9797969 12.7583045
26 5.9056613 7.9797969
27 4.8622771 5.9056613
28 9.0665652 4.8622771
29 -7.4532982 9.0665652
30 -13.8248905 -7.4532982
31 -19.4379225 -13.8248905
32 -35.1666456 -19.4379225
33 -4.9749903 -35.1666456
34 0.7700229 -4.9749903
35 -29.5816221 0.7700229
36 -27.1377229 -29.5816221
37 -25.1124574 -27.1377229
38 -16.0247747 -25.1124574
39 -29.2859940 -16.0247747
40 -22.9632719 -29.2859940
41 -31.3213170 -22.9632719
42 -45.2109441 -31.3213170
43 -55.3013697 -45.2109441
44 -42.6033980 -55.3013697
45 -36.9089158 -42.6033980
46 -16.5600138 -36.9089158
47 -43.9261202 -16.5600138
48 -40.2579856 -43.9261202
49 -35.6929093 -40.2579856
50 -30.9731616 -35.6929093
51 -12.9768189 -30.9731616
52 1.3920304 -12.9768189
53 -2.0075703 1.3920304
54 6.9444739 -2.0075703
55 2.4363289 6.9444739
56 -2.6467822 2.4363289
57 27.6334701 -2.6467822
58 34.5122931 27.6334701
59 2.7745945 34.5122931
60 8.5457875 2.7745945
61 NA 8.5457875
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 21.9192084 28.6805116
[2,] 29.1425295 21.9192084
[3,] 17.4165493 29.1425295
[4,] 33.1714523 17.4165493
[5,] 30.3513892 33.1714523
[6,] 20.5919146 30.3513892
[7,] 13.3857979 20.5919146
[8,] 8.0603327 13.3857979
[9,] 21.2854825 8.0603327
[10,] 18.5703064 21.2854825
[11,] 17.4211209 18.5703064
[12,] 27.6823402 17.4211209
[13,] 16.9084043 27.6823402
[14,] 22.1624768 16.9084043
[15,] 21.5521877 22.1624768
[16,] 26.7583045 21.5521877
[17,] 13.1209213 26.7583045
[18,] -7.9305241 13.1209213
[19,] 16.9545314 -7.9305241
[20,] 8.4057452 16.9545314
[21,] 41.0991453 8.4057452
[22,] 25.8225503 41.0991453
[23,] 29.2366124 25.8225503
[24,] 12.7583045 29.2366124
[25,] 7.9797969 12.7583045
[26,] 5.9056613 7.9797969
[27,] 4.8622771 5.9056613
[28,] 9.0665652 4.8622771
[29,] -7.4532982 9.0665652
[30,] -13.8248905 -7.4532982
[31,] -19.4379225 -13.8248905
[32,] -35.1666456 -19.4379225
[33,] -4.9749903 -35.1666456
[34,] 0.7700229 -4.9749903
[35,] -29.5816221 0.7700229
[36,] -27.1377229 -29.5816221
[37,] -25.1124574 -27.1377229
[38,] -16.0247747 -25.1124574
[39,] -29.2859940 -16.0247747
[40,] -22.9632719 -29.2859940
[41,] -31.3213170 -22.9632719
[42,] -45.2109441 -31.3213170
[43,] -55.3013697 -45.2109441
[44,] -42.6033980 -55.3013697
[45,] -36.9089158 -42.6033980
[46,] -16.5600138 -36.9089158
[47,] -43.9261202 -16.5600138
[48,] -40.2579856 -43.9261202
[49,] -35.6929093 -40.2579856
[50,] -30.9731616 -35.6929093
[51,] -12.9768189 -30.9731616
[52,] 1.3920304 -12.9768189
[53,] -2.0075703 1.3920304
[54,] 6.9444739 -2.0075703
[55,] 2.4363289 6.9444739
[56,] -2.6467822 2.4363289
[57,] 27.6334701 -2.6467822
[58,] 34.5122931 27.6334701
[59,] 2.7745945 34.5122931
[60,] 8.5457875 2.7745945
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 21.9192084 28.6805116
2 29.1425295 21.9192084
3 17.4165493 29.1425295
4 33.1714523 17.4165493
5 30.3513892 33.1714523
6 20.5919146 30.3513892
7 13.3857979 20.5919146
8 8.0603327 13.3857979
9 21.2854825 8.0603327
10 18.5703064 21.2854825
11 17.4211209 18.5703064
12 27.6823402 17.4211209
13 16.9084043 27.6823402
14 22.1624768 16.9084043
15 21.5521877 22.1624768
16 26.7583045 21.5521877
17 13.1209213 26.7583045
18 -7.9305241 13.1209213
19 16.9545314 -7.9305241
20 8.4057452 16.9545314
21 41.0991453 8.4057452
22 25.8225503 41.0991453
23 29.2366124 25.8225503
24 12.7583045 29.2366124
25 7.9797969 12.7583045
26 5.9056613 7.9797969
27 4.8622771 5.9056613
28 9.0665652 4.8622771
29 -7.4532982 9.0665652
30 -13.8248905 -7.4532982
31 -19.4379225 -13.8248905
32 -35.1666456 -19.4379225
33 -4.9749903 -35.1666456
34 0.7700229 -4.9749903
35 -29.5816221 0.7700229
36 -27.1377229 -29.5816221
37 -25.1124574 -27.1377229
38 -16.0247747 -25.1124574
39 -29.2859940 -16.0247747
40 -22.9632719 -29.2859940
41 -31.3213170 -22.9632719
42 -45.2109441 -31.3213170
43 -55.3013697 -45.2109441
44 -42.6033980 -55.3013697
45 -36.9089158 -42.6033980
46 -16.5600138 -36.9089158
47 -43.9261202 -16.5600138
48 -40.2579856 -43.9261202
49 -35.6929093 -40.2579856
50 -30.9731616 -35.6929093
51 -12.9768189 -30.9731616
52 1.3920304 -12.9768189
53 -2.0075703 1.3920304
54 6.9444739 -2.0075703
55 2.4363289 6.9444739
56 -2.6467822 2.4363289
57 27.6334701 -2.6467822
58 34.5122931 27.6334701
59 2.7745945 34.5122931
60 8.5457875 2.7745945
> 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/7el721258739231.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/83pma1258739231.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/99fhi1258739231.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/108ukc1258739231.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/11u8s11258739231.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/12m1t61258739231.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/13k7d21258739231.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/14vubg1258739232.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/151h6b1258739232.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/16o8a71258739232.tab")
+ }
>
> system("convert tmp/1r3af1258739231.ps tmp/1r3af1258739231.png")
> system("convert tmp/2193q1258739231.ps tmp/2193q1258739231.png")
> system("convert tmp/3a0d31258739231.ps tmp/3a0d31258739231.png")
> system("convert tmp/4a9c41258739231.ps tmp/4a9c41258739231.png")
> system("convert tmp/5xlbk1258739231.ps tmp/5xlbk1258739231.png")
> system("convert tmp/62tza1258739231.ps tmp/62tza1258739231.png")
> system("convert tmp/7el721258739231.ps tmp/7el721258739231.png")
> system("convert tmp/83pma1258739231.ps tmp/83pma1258739231.png")
> system("convert tmp/99fhi1258739231.ps tmp/99fhi1258739231.png")
> system("convert tmp/108ukc1258739231.ps tmp/108ukc1258739231.png")
>
>
> proc.time()
user system elapsed
2.518 1.571 3.446