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(308347,0,298427,0,289231,0,291975,0,294912,0,293488,0,290555,0,284736,0,281818,0,287854,0,316263,0,325412,0,326011,0,328282,0,317480,0,317539,0,313737,0,312276,0,309391,0,302950,0,300316,0,304035,0,333476,0,337698,0,335932,0,323931,0,313927,0,314485,1,313218,1,309664,1,302963,1,298989,1,298423,1,301631,1,329765,1,335083,1,327616,1,309119,1,295916,1,291413,1,291542,1,284678,1,276475,1,272566,1,264981,1,263290,1,296806,1,303598,1,286994,1,276427,1,266424,1,267153,1,268381,1,262522,1,255542,1,253158,1,243803,1,250741,1,280445,1,285257,1,270976,1,261076,1,255603,1),dim=c(2,63),dimnames=list(c('Vrouwen','Dummy'),1:63))
> y <- array(NA,dim=c(2,63),dimnames=list(c('Vrouwen','Dummy'),1:63))
> 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
Vrouwen Dummy t
1 308347 0 1
2 298427 0 2
3 289231 0 3
4 291975 0 4
5 294912 0 5
6 293488 0 6
7 290555 0 7
8 284736 0 8
9 281818 0 9
10 287854 0 10
11 316263 0 11
12 325412 0 12
13 326011 0 13
14 328282 0 14
15 317480 0 15
16 317539 0 16
17 313737 0 17
18 312276 0 18
19 309391 0 19
20 302950 0 20
21 300316 0 21
22 304035 0 22
23 333476 0 23
24 337698 0 24
25 335932 0 25
26 323931 0 26
27 313927 0 27
28 314485 1 28
29 313218 1 29
30 309664 1 30
31 302963 1 31
32 298989 1 32
33 298423 1 33
34 301631 1 34
35 329765 1 35
36 335083 1 36
37 327616 1 37
38 309119 1 38
39 295916 1 39
40 291413 1 40
41 291542 1 41
42 284678 1 42
43 276475 1 43
44 272566 1 44
45 264981 1 45
46 263290 1 46
47 296806 1 47
48 303598 1 48
49 286994 1 49
50 276427 1 50
51 266424 1 51
52 267153 1 52
53 268381 1 53
54 262522 1 54
55 255542 1 55
56 253158 1 56
57 243803 1 57
58 250741 1 58
59 280445 1 59
60 285257 1 60
61 270976 1 61
62 261076 1 62
63 255603 1 63
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy t
321046.3 3652.2 -868.4
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-31413 -14835 2093 12792 41647
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 321046.3 5243.9 61.222 < 2e-16 ***
Dummy 3652.2 9627.8 0.379 0.70578
t -868.4 262.0 -3.314 0.00156 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 19470 on 60 degrees of freedom
Multiple R-squared: 0.3606, Adjusted R-squared: 0.3393
F-statistic: 16.92 on 2 and 60 DF, p-value: 1.487e-06
> 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.058178309 0.116356619 0.9418217
[2,] 0.020069866 0.040139732 0.9799301
[3,] 0.007487835 0.014975670 0.9925122
[4,] 0.003294327 0.006588654 0.9967057
[5,] 0.002933966 0.005867932 0.9970660
[6,] 0.214218362 0.428436724 0.7857816
[7,] 0.474081617 0.948163235 0.5259184
[8,] 0.524088465 0.951823070 0.4759115
[9,] 0.504643172 0.990713657 0.4953568
[10,] 0.416760225 0.833520450 0.5832398
[11,] 0.334924676 0.669849352 0.6650753
[12,] 0.278629556 0.557259112 0.7213704
[13,] 0.237683516 0.475367031 0.7623165
[14,] 0.219466532 0.438933065 0.7805335
[15,] 0.259838313 0.519676626 0.7401617
[16,] 0.336754039 0.673508078 0.6632460
[17,] 0.383038311 0.766076622 0.6169617
[18,] 0.379827747 0.759655493 0.6201723
[19,] 0.382970680 0.765941359 0.6170293
[20,] 0.356291891 0.712583782 0.6437081
[21,] 0.291978604 0.583957209 0.7080214
[22,] 0.262508076 0.525016153 0.7374919
[23,] 0.203921485 0.407842969 0.7960785
[24,] 0.154498338 0.308996677 0.8455017
[25,] 0.117311112 0.234622224 0.8826889
[26,] 0.100187357 0.200374714 0.8998126
[27,] 0.094785118 0.189570235 0.9052149
[28,] 0.088377761 0.176755522 0.9116222
[29,] 0.071389167 0.142778335 0.9286108
[30,] 0.096160654 0.192321309 0.9038393
[31,] 0.202708076 0.405416151 0.7972919
[32,] 0.325320254 0.650640508 0.6746797
[33,] 0.349526558 0.699053115 0.6504734
[34,] 0.385093923 0.770187847 0.6149061
[35,] 0.427066097 0.854132194 0.5729339
[36,] 0.455267056 0.910534111 0.5447329
[37,] 0.493005093 0.986010186 0.5069949
[38,] 0.553287976 0.893424049 0.4467120
[39,] 0.606717536 0.786564928 0.3932825
[40,] 0.706451767 0.587096465 0.2935482
[41,] 0.798792296 0.402415407 0.2012077
[42,] 0.773565681 0.452868638 0.2264343
[43,] 0.869541992 0.260916017 0.1304580
[44,] 0.887300243 0.225399514 0.1126998
[45,] 0.878676947 0.242646107 0.1213231
[46,] 0.845867985 0.308264031 0.1541320
[47,] 0.804503567 0.390992866 0.1954964
[48,] 0.768588238 0.462823524 0.2314118
[49,] 0.703900966 0.592198067 0.2960990
[50,] 0.601756334 0.796487331 0.3982437
[51,] 0.478950616 0.957901233 0.5210494
[52,] 0.514787260 0.970425480 0.4852127
> postscript(file="/var/www/html/rcomp/tmp/1mmwp1229462751.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/2b8sf1229462751.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/35l171229462751.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/4zcnw1229462751.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/59a8m1229462751.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 = 63
Frequency = 1
1 2 3 4 5 6
-11830.9160 -20882.5265 -29210.1369 -25597.7474 -21792.3578 -22347.9683
7 8 9 10 11 12
-24412.5787 -29363.1892 -31412.7996 -24508.4101 4768.9795 14786.3690
13 14 15 16 17 18
16253.7586 19393.1481 9459.5377 10386.9273 7453.3168 6860.7064
19 20 21 22 23 24
4844.0959 -728.5145 -2494.1250 2093.2646 32402.6541 37493.0437
25 26 27 28 29 30
36595.4332 25462.8228 16327.2123 14101.4328 13702.8224 11017.2119
31 32 33 34 35 36
5184.6015 2078.9910 2381.3806 6457.7701 35460.1597 41646.5492
37 38 39 40 41 42
35047.9388 17419.3284 5084.7179 1450.1075 2447.4970 -3548.1134
43 44 45 46 47 48
-10882.7239 -13923.3343 -20639.9448 -21462.5552 12921.8343 20582.2239
49 50 51 52 53 54
4846.6134 -4851.9970 -13986.6075 -12389.2179 -10292.8284 -15283.4388
55 56 57 58 59 60
-21395.0492 -22910.6597 -31397.2701 -23590.8806 6981.5090 12661.8985
61 62 63
-750.7119 -9782.3224 -14386.9328
> postscript(file="/var/www/html/rcomp/tmp/6ke2l1229462751.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 = 63
Frequency = 1
lag(myerror, k = 1) myerror
0 -11830.9160 NA
1 -20882.5265 -11830.9160
2 -29210.1369 -20882.5265
3 -25597.7474 -29210.1369
4 -21792.3578 -25597.7474
5 -22347.9683 -21792.3578
6 -24412.5787 -22347.9683
7 -29363.1892 -24412.5787
8 -31412.7996 -29363.1892
9 -24508.4101 -31412.7996
10 4768.9795 -24508.4101
11 14786.3690 4768.9795
12 16253.7586 14786.3690
13 19393.1481 16253.7586
14 9459.5377 19393.1481
15 10386.9273 9459.5377
16 7453.3168 10386.9273
17 6860.7064 7453.3168
18 4844.0959 6860.7064
19 -728.5145 4844.0959
20 -2494.1250 -728.5145
21 2093.2646 -2494.1250
22 32402.6541 2093.2646
23 37493.0437 32402.6541
24 36595.4332 37493.0437
25 25462.8228 36595.4332
26 16327.2123 25462.8228
27 14101.4328 16327.2123
28 13702.8224 14101.4328
29 11017.2119 13702.8224
30 5184.6015 11017.2119
31 2078.9910 5184.6015
32 2381.3806 2078.9910
33 6457.7701 2381.3806
34 35460.1597 6457.7701
35 41646.5492 35460.1597
36 35047.9388 41646.5492
37 17419.3284 35047.9388
38 5084.7179 17419.3284
39 1450.1075 5084.7179
40 2447.4970 1450.1075
41 -3548.1134 2447.4970
42 -10882.7239 -3548.1134
43 -13923.3343 -10882.7239
44 -20639.9448 -13923.3343
45 -21462.5552 -20639.9448
46 12921.8343 -21462.5552
47 20582.2239 12921.8343
48 4846.6134 20582.2239
49 -4851.9970 4846.6134
50 -13986.6075 -4851.9970
51 -12389.2179 -13986.6075
52 -10292.8284 -12389.2179
53 -15283.4388 -10292.8284
54 -21395.0492 -15283.4388
55 -22910.6597 -21395.0492
56 -31397.2701 -22910.6597
57 -23590.8806 -31397.2701
58 6981.5090 -23590.8806
59 12661.8985 6981.5090
60 -750.7119 12661.8985
61 -9782.3224 -750.7119
62 -14386.9328 -9782.3224
63 NA -14386.9328
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -20882.5265 -11830.9160
[2,] -29210.1369 -20882.5265
[3,] -25597.7474 -29210.1369
[4,] -21792.3578 -25597.7474
[5,] -22347.9683 -21792.3578
[6,] -24412.5787 -22347.9683
[7,] -29363.1892 -24412.5787
[8,] -31412.7996 -29363.1892
[9,] -24508.4101 -31412.7996
[10,] 4768.9795 -24508.4101
[11,] 14786.3690 4768.9795
[12,] 16253.7586 14786.3690
[13,] 19393.1481 16253.7586
[14,] 9459.5377 19393.1481
[15,] 10386.9273 9459.5377
[16,] 7453.3168 10386.9273
[17,] 6860.7064 7453.3168
[18,] 4844.0959 6860.7064
[19,] -728.5145 4844.0959
[20,] -2494.1250 -728.5145
[21,] 2093.2646 -2494.1250
[22,] 32402.6541 2093.2646
[23,] 37493.0437 32402.6541
[24,] 36595.4332 37493.0437
[25,] 25462.8228 36595.4332
[26,] 16327.2123 25462.8228
[27,] 14101.4328 16327.2123
[28,] 13702.8224 14101.4328
[29,] 11017.2119 13702.8224
[30,] 5184.6015 11017.2119
[31,] 2078.9910 5184.6015
[32,] 2381.3806 2078.9910
[33,] 6457.7701 2381.3806
[34,] 35460.1597 6457.7701
[35,] 41646.5492 35460.1597
[36,] 35047.9388 41646.5492
[37,] 17419.3284 35047.9388
[38,] 5084.7179 17419.3284
[39,] 1450.1075 5084.7179
[40,] 2447.4970 1450.1075
[41,] -3548.1134 2447.4970
[42,] -10882.7239 -3548.1134
[43,] -13923.3343 -10882.7239
[44,] -20639.9448 -13923.3343
[45,] -21462.5552 -20639.9448
[46,] 12921.8343 -21462.5552
[47,] 20582.2239 12921.8343
[48,] 4846.6134 20582.2239
[49,] -4851.9970 4846.6134
[50,] -13986.6075 -4851.9970
[51,] -12389.2179 -13986.6075
[52,] -10292.8284 -12389.2179
[53,] -15283.4388 -10292.8284
[54,] -21395.0492 -15283.4388
[55,] -22910.6597 -21395.0492
[56,] -31397.2701 -22910.6597
[57,] -23590.8806 -31397.2701
[58,] 6981.5090 -23590.8806
[59,] 12661.8985 6981.5090
[60,] -750.7119 12661.8985
[61,] -9782.3224 -750.7119
[62,] -14386.9328 -9782.3224
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -20882.5265 -11830.9160
2 -29210.1369 -20882.5265
3 -25597.7474 -29210.1369
4 -21792.3578 -25597.7474
5 -22347.9683 -21792.3578
6 -24412.5787 -22347.9683
7 -29363.1892 -24412.5787
8 -31412.7996 -29363.1892
9 -24508.4101 -31412.7996
10 4768.9795 -24508.4101
11 14786.3690 4768.9795
12 16253.7586 14786.3690
13 19393.1481 16253.7586
14 9459.5377 19393.1481
15 10386.9273 9459.5377
16 7453.3168 10386.9273
17 6860.7064 7453.3168
18 4844.0959 6860.7064
19 -728.5145 4844.0959
20 -2494.1250 -728.5145
21 2093.2646 -2494.1250
22 32402.6541 2093.2646
23 37493.0437 32402.6541
24 36595.4332 37493.0437
25 25462.8228 36595.4332
26 16327.2123 25462.8228
27 14101.4328 16327.2123
28 13702.8224 14101.4328
29 11017.2119 13702.8224
30 5184.6015 11017.2119
31 2078.9910 5184.6015
32 2381.3806 2078.9910
33 6457.7701 2381.3806
34 35460.1597 6457.7701
35 41646.5492 35460.1597
36 35047.9388 41646.5492
37 17419.3284 35047.9388
38 5084.7179 17419.3284
39 1450.1075 5084.7179
40 2447.4970 1450.1075
41 -3548.1134 2447.4970
42 -10882.7239 -3548.1134
43 -13923.3343 -10882.7239
44 -20639.9448 -13923.3343
45 -21462.5552 -20639.9448
46 12921.8343 -21462.5552
47 20582.2239 12921.8343
48 4846.6134 20582.2239
49 -4851.9970 4846.6134
50 -13986.6075 -4851.9970
51 -12389.2179 -13986.6075
52 -10292.8284 -12389.2179
53 -15283.4388 -10292.8284
54 -21395.0492 -15283.4388
55 -22910.6597 -21395.0492
56 -31397.2701 -22910.6597
57 -23590.8806 -31397.2701
58 6981.5090 -23590.8806
59 12661.8985 6981.5090
60 -750.7119 12661.8985
61 -9782.3224 -750.7119
62 -14386.9328 -9782.3224
> 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/7m4v31229462751.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/8vlzd1229462751.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/9hw7g1229462751.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/10brsk1229462751.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/11ct6g1229462751.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/12mtl81229462751.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/133mxx1229462751.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/149c331229462751.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/15x8uq1229462751.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/16iyjv1229462751.tab")
+ }
>
> system("convert tmp/1mmwp1229462751.ps tmp/1mmwp1229462751.png")
> system("convert tmp/2b8sf1229462751.ps tmp/2b8sf1229462751.png")
> system("convert tmp/35l171229462751.ps tmp/35l171229462751.png")
> system("convert tmp/4zcnw1229462751.ps tmp/4zcnw1229462751.png")
> system("convert tmp/59a8m1229462751.ps tmp/59a8m1229462751.png")
> system("convert tmp/6ke2l1229462751.ps tmp/6ke2l1229462751.png")
> system("convert tmp/7m4v31229462751.ps tmp/7m4v31229462751.png")
> system("convert tmp/8vlzd1229462751.ps tmp/8vlzd1229462751.png")
> system("convert tmp/9hw7g1229462751.ps tmp/9hw7g1229462751.png")
> system("convert tmp/10brsk1229462751.ps tmp/10brsk1229462751.png")
>
>
> proc.time()
user system elapsed
2.505 1.579 2.934