R version 2.7.0 (2008-04-22)
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(106099,0,103235,0,98857,0,101107,0,102700,0,101477,0,99639,0,96622,0,94697,0,95093,0,112885,0,121162,0,113624,0,111632,0,106707,0,108827,0,108413,0,106249,0,104861,0,102382,0,100320,0,100228,0,117089,0,121523,0,114948,0,112831,0,107605,0,108928,1,101993,1,102850,1,99925,1,101536,1,99450,1,98305,1,110159,1,109483,1,106810,1,96279,1,91982,1,90276,1,90999,1,86622,1,83117,1,80367,1,77550,1,77443,1,92844,1,92175,1,84822,1,81632,1,78872,1,81485,1,80651,1,78192,1,76844,1,76335,1,71415,1,73899,1,86822,1,86371,1,83469,1,82662,1),dim=c(2,62),dimnames=list(c('werkl.man','Wetswijziging'),1:62))
> y <- array(NA,dim=c(2,62),dimnames=list(c('werkl.man','Wetswijziging'),1:62))
> 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
werkl.man Wetswijziging t
1 106099 0 1
2 103235 0 2
3 98857 0 3
4 101107 0 4
5 102700 0 5
6 101477 0 6
7 99639 0 7
8 96622 0 8
9 94697 0 9
10 95093 0 10
11 112885 0 11
12 121162 0 12
13 113624 0 13
14 111632 0 14
15 106707 0 15
16 108827 0 16
17 108413 0 17
18 106249 0 18
19 104861 0 19
20 102382 0 20
21 100320 0 21
22 100228 0 22
23 117089 0 23
24 121523 0 24
25 114948 0 25
26 112831 0 26
27 107605 0 27
28 108928 1 28
29 101993 1 29
30 102850 1 30
31 99925 1 31
32 101536 1 32
33 99450 1 33
34 98305 1 34
35 110159 1 35
36 109483 1 36
37 106810 1 37
38 96279 1 38
39 91982 1 39
40 90276 1 40
41 90999 1 41
42 86622 1 42
43 83117 1 43
44 80367 1 44
45 77550 1 45
46 77443 1 46
47 92844 1 47
48 92175 1 48
49 84822 1 49
50 81632 1 50
51 78872 1 51
52 81485 1 52
53 80651 1 53
54 78192 1 54
55 76844 1 55
56 76335 1 56
57 71415 1 57
58 73899 1 58
59 86822 1 59
60 86371 1 60
61 83469 1 61
62 82662 1 62
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Wetswijziging t
112850 -2665 -466
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13959.2 -7671.4 408.4 5031.1 19856.3
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 112849.8 2397.1 47.078 < 2e-16 ***
Wetswijziging -2665.4 4387.2 -0.608 0.545823
t -466.0 121.6 -3.833 0.000309 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 8772 on 59 degrees of freedom
Multiple R-squared: 0.552, Adjusted R-squared: 0.5368
F-statistic: 36.34 on 2 and 59 DF, p-value: 5.175e-11
> 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,] 0.042540897 0.085081795 0.95745910
[2,] 0.012234939 0.024469877 0.98776506
[3,] 0.005278176 0.010556352 0.99472182
[4,] 0.002896000 0.005792000 0.99710400
[5,] 0.001354729 0.002709457 0.99864527
[6,] 0.311291531 0.622583063 0.68870847
[7,] 0.761446093 0.477107815 0.23855391
[8,] 0.718009910 0.563980181 0.28199009
[9,] 0.636834058 0.726331885 0.36316594
[10,] 0.581387804 0.837224392 0.41861220
[11,] 0.501572140 0.996855721 0.49842786
[12,] 0.427519540 0.855039079 0.57248046
[13,] 0.384345304 0.768690608 0.61565470
[14,] 0.364061956 0.728123911 0.63593804
[15,] 0.396029204 0.792058407 0.60397080
[16,] 0.490830228 0.981660455 0.50916977
[17,] 0.614167887 0.771664226 0.38583211
[18,] 0.633270016 0.733459969 0.36672998
[19,] 0.716043480 0.567913041 0.28395652
[20,] 0.661613232 0.676773537 0.33838677
[21,] 0.594557443 0.810885113 0.40544256
[22,] 0.539707427 0.920585145 0.46029257
[23,] 0.480597214 0.961194428 0.51940279
[24,] 0.429545198 0.859090396 0.57045480
[25,] 0.362310844 0.724621688 0.63768916
[26,] 0.312047559 0.624095118 0.68795244
[27,] 0.253530296 0.507060591 0.74646970
[28,] 0.208422373 0.416844746 0.79157763
[29,] 0.172055256 0.344110512 0.82794474
[30,] 0.242367756 0.484735512 0.75763224
[31,] 0.392831391 0.785662782 0.60716861
[32,] 0.623608875 0.752782251 0.37639113
[33,] 0.697422910 0.605154181 0.30257709
[34,] 0.758385182 0.483229636 0.24161482
[35,] 0.803295479 0.393409042 0.19670452
[36,] 0.842785182 0.314429636 0.15721482
[37,] 0.865790932 0.268418136 0.13420907
[38,] 0.881865728 0.236268545 0.11813427
[39,] 0.896889394 0.206221212 0.10311061
[40,] 0.923293823 0.153412353 0.07670618
[41,] 0.942590081 0.114819838 0.05740992
[42,] 0.951202888 0.097594224 0.04879711
[43,] 0.978253032 0.043493937 0.02174697
[44,] 0.977006462 0.045987076 0.02299354
[45,] 0.968453378 0.063093243 0.03154662
[46,] 0.948420911 0.103158177 0.05157909
[47,] 0.934956645 0.130086710 0.06504335
[48,] 0.924082034 0.151835931 0.07591797
[49,] 0.891432987 0.217134026 0.10856701
[50,] 0.826040992 0.347918017 0.17395901
[51,] 0.709308265 0.581383469 0.29069173
> postscript(file="/var/www/html/rcomp/tmp/185br1229463844.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/2fj2e1229463844.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/3rj9s1229463844.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/4b3l01229463844.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/5okm81229463844.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 = 62
Frequency = 1
1 2 3 4 5 6
-6284.88612 -8682.92337 -12594.96062 -9878.99787 -7820.03512 -8577.07237
7 8 9 10 11 12
-9949.10962 -12500.14687 -13959.18412 -13097.22137 5160.74138 13903.70413
13 14 15 16 17 18
6831.66688 5305.62963 846.59238 3432.55513 3484.51788 1786.48063
19 20 21 22 23 24
864.44338 -1148.59387 -2744.63112 -2370.66837 14956.29438 19856.25713
25 26 27 28 29 30
13747.21988 12096.18263 7336.14537 11790.51897 5321.48172 6644.44447
31 32 33 34 35 36
4185.40722 6262.36997 4642.33272 3963.29547 16283.25822 16073.22097
37 38 39 40 41 42
13866.18372 3801.14647 -29.89078 -1269.92803 -80.96528 -3992.00253
43 44 45 46 47 48
-7031.03978 -9315.07704 -11666.11429 -11307.15154 4559.81121 4356.77396
49 50 51 52 53 54
-2530.26329 -5254.30054 -7548.33779 -4469.37504 -4837.41229 -6830.44954
55 56 57 58 59 60
-7712.48679 -7755.52404 -12209.56129 -9259.59854 4129.36421 4144.32696
61 62
1708.28971 1367.25246
> postscript(file="/var/www/html/rcomp/tmp/6bvpz1229463844.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 = 62
Frequency = 1
lag(myerror, k = 1) myerror
0 -6284.88612 NA
1 -8682.92337 -6284.88612
2 -12594.96062 -8682.92337
3 -9878.99787 -12594.96062
4 -7820.03512 -9878.99787
5 -8577.07237 -7820.03512
6 -9949.10962 -8577.07237
7 -12500.14687 -9949.10962
8 -13959.18412 -12500.14687
9 -13097.22137 -13959.18412
10 5160.74138 -13097.22137
11 13903.70413 5160.74138
12 6831.66688 13903.70413
13 5305.62963 6831.66688
14 846.59238 5305.62963
15 3432.55513 846.59238
16 3484.51788 3432.55513
17 1786.48063 3484.51788
18 864.44338 1786.48063
19 -1148.59387 864.44338
20 -2744.63112 -1148.59387
21 -2370.66837 -2744.63112
22 14956.29438 -2370.66837
23 19856.25713 14956.29438
24 13747.21988 19856.25713
25 12096.18263 13747.21988
26 7336.14537 12096.18263
27 11790.51897 7336.14537
28 5321.48172 11790.51897
29 6644.44447 5321.48172
30 4185.40722 6644.44447
31 6262.36997 4185.40722
32 4642.33272 6262.36997
33 3963.29547 4642.33272
34 16283.25822 3963.29547
35 16073.22097 16283.25822
36 13866.18372 16073.22097
37 3801.14647 13866.18372
38 -29.89078 3801.14647
39 -1269.92803 -29.89078
40 -80.96528 -1269.92803
41 -3992.00253 -80.96528
42 -7031.03978 -3992.00253
43 -9315.07704 -7031.03978
44 -11666.11429 -9315.07704
45 -11307.15154 -11666.11429
46 4559.81121 -11307.15154
47 4356.77396 4559.81121
48 -2530.26329 4356.77396
49 -5254.30054 -2530.26329
50 -7548.33779 -5254.30054
51 -4469.37504 -7548.33779
52 -4837.41229 -4469.37504
53 -6830.44954 -4837.41229
54 -7712.48679 -6830.44954
55 -7755.52404 -7712.48679
56 -12209.56129 -7755.52404
57 -9259.59854 -12209.56129
58 4129.36421 -9259.59854
59 4144.32696 4129.36421
60 1708.28971 4144.32696
61 1367.25246 1708.28971
62 NA 1367.25246
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -8682.92337 -6284.88612
[2,] -12594.96062 -8682.92337
[3,] -9878.99787 -12594.96062
[4,] -7820.03512 -9878.99787
[5,] -8577.07237 -7820.03512
[6,] -9949.10962 -8577.07237
[7,] -12500.14687 -9949.10962
[8,] -13959.18412 -12500.14687
[9,] -13097.22137 -13959.18412
[10,] 5160.74138 -13097.22137
[11,] 13903.70413 5160.74138
[12,] 6831.66688 13903.70413
[13,] 5305.62963 6831.66688
[14,] 846.59238 5305.62963
[15,] 3432.55513 846.59238
[16,] 3484.51788 3432.55513
[17,] 1786.48063 3484.51788
[18,] 864.44338 1786.48063
[19,] -1148.59387 864.44338
[20,] -2744.63112 -1148.59387
[21,] -2370.66837 -2744.63112
[22,] 14956.29438 -2370.66837
[23,] 19856.25713 14956.29438
[24,] 13747.21988 19856.25713
[25,] 12096.18263 13747.21988
[26,] 7336.14537 12096.18263
[27,] 11790.51897 7336.14537
[28,] 5321.48172 11790.51897
[29,] 6644.44447 5321.48172
[30,] 4185.40722 6644.44447
[31,] 6262.36997 4185.40722
[32,] 4642.33272 6262.36997
[33,] 3963.29547 4642.33272
[34,] 16283.25822 3963.29547
[35,] 16073.22097 16283.25822
[36,] 13866.18372 16073.22097
[37,] 3801.14647 13866.18372
[38,] -29.89078 3801.14647
[39,] -1269.92803 -29.89078
[40,] -80.96528 -1269.92803
[41,] -3992.00253 -80.96528
[42,] -7031.03978 -3992.00253
[43,] -9315.07704 -7031.03978
[44,] -11666.11429 -9315.07704
[45,] -11307.15154 -11666.11429
[46,] 4559.81121 -11307.15154
[47,] 4356.77396 4559.81121
[48,] -2530.26329 4356.77396
[49,] -5254.30054 -2530.26329
[50,] -7548.33779 -5254.30054
[51,] -4469.37504 -7548.33779
[52,] -4837.41229 -4469.37504
[53,] -6830.44954 -4837.41229
[54,] -7712.48679 -6830.44954
[55,] -7755.52404 -7712.48679
[56,] -12209.56129 -7755.52404
[57,] -9259.59854 -12209.56129
[58,] 4129.36421 -9259.59854
[59,] 4144.32696 4129.36421
[60,] 1708.28971 4144.32696
[61,] 1367.25246 1708.28971
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -8682.92337 -6284.88612
2 -12594.96062 -8682.92337
3 -9878.99787 -12594.96062
4 -7820.03512 -9878.99787
5 -8577.07237 -7820.03512
6 -9949.10962 -8577.07237
7 -12500.14687 -9949.10962
8 -13959.18412 -12500.14687
9 -13097.22137 -13959.18412
10 5160.74138 -13097.22137
11 13903.70413 5160.74138
12 6831.66688 13903.70413
13 5305.62963 6831.66688
14 846.59238 5305.62963
15 3432.55513 846.59238
16 3484.51788 3432.55513
17 1786.48063 3484.51788
18 864.44338 1786.48063
19 -1148.59387 864.44338
20 -2744.63112 -1148.59387
21 -2370.66837 -2744.63112
22 14956.29438 -2370.66837
23 19856.25713 14956.29438
24 13747.21988 19856.25713
25 12096.18263 13747.21988
26 7336.14537 12096.18263
27 11790.51897 7336.14537
28 5321.48172 11790.51897
29 6644.44447 5321.48172
30 4185.40722 6644.44447
31 6262.36997 4185.40722
32 4642.33272 6262.36997
33 3963.29547 4642.33272
34 16283.25822 3963.29547
35 16073.22097 16283.25822
36 13866.18372 16073.22097
37 3801.14647 13866.18372
38 -29.89078 3801.14647
39 -1269.92803 -29.89078
40 -80.96528 -1269.92803
41 -3992.00253 -80.96528
42 -7031.03978 -3992.00253
43 -9315.07704 -7031.03978
44 -11666.11429 -9315.07704
45 -11307.15154 -11666.11429
46 4559.81121 -11307.15154
47 4356.77396 4559.81121
48 -2530.26329 4356.77396
49 -5254.30054 -2530.26329
50 -7548.33779 -5254.30054
51 -4469.37504 -7548.33779
52 -4837.41229 -4469.37504
53 -6830.44954 -4837.41229
54 -7712.48679 -6830.44954
55 -7755.52404 -7712.48679
56 -12209.56129 -7755.52404
57 -9259.59854 -12209.56129
58 4129.36421 -9259.59854
59 4144.32696 4129.36421
60 1708.28971 4144.32696
61 1367.25246 1708.28971
> 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/776731229463844.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/8fa8b1229463844.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/9e6qe1229463844.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/10s3tl1229463844.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/11wkzc1229463844.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/12245x1229463844.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/139vdn1229463844.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/14bc1e1229463844.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/156eel1229463844.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/16s4kk1229463844.tab")
+ }
>
> system("convert tmp/185br1229463844.ps tmp/185br1229463844.png")
> system("convert tmp/2fj2e1229463844.ps tmp/2fj2e1229463844.png")
> system("convert tmp/3rj9s1229463844.ps tmp/3rj9s1229463844.png")
> system("convert tmp/4b3l01229463844.ps tmp/4b3l01229463844.png")
> system("convert tmp/5okm81229463844.ps tmp/5okm81229463844.png")
> system("convert tmp/6bvpz1229463844.ps tmp/6bvpz1229463844.png")
> system("convert tmp/776731229463844.ps tmp/776731229463844.png")
> system("convert tmp/8fa8b1229463844.ps tmp/8fa8b1229463844.png")
> system("convert tmp/9e6qe1229463844.ps tmp/9e6qe1229463844.png")
> system("convert tmp/10s3tl1229463844.ps tmp/10s3tl1229463844.png")
>
>
> proc.time()
user system elapsed
5.136 2.787 5.553