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(5560,174,3922,70,3759,65,4138,75,4634,45,3996,313,4308,102,4143,50,4429,230,5219,147,4929,103,5755,159,5592,74,4163,58,4962,72,5208,58,4755,99,4491,46,5732,70,5731,73,5040,82,6102,175,4904,83,5369,135,5578,139,4619,167,4731,52,5011,66,5299,129,4146,78,4625,96,4736,130,4219,59,5116,75,4205,93,4121,151,5103,116,4300,80,4578,109,3809,163,5526,69,4247,106,3830,69,4394,129,4826,90,4409,141,4569,122,4106,111,4794,226,3914,78,3793,78,4405,91,4022,49,4100,167,4788,72,3163,95,3585,134,3903,155,4178,70,3863,113,4187,215),dim=c(2,61),dimnames=list(c('Woon','nietwoon'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Woon','nietwoon'),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 = '2'
> #'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
nietwoon Woon
1 174 5560
2 70 3922
3 65 3759
4 75 4138
5 45 4634
6 313 3996
7 102 4308
8 50 4143
9 230 4429
10 147 5219
11 103 4929
12 159 5755
13 74 5592
14 58 4163
15 72 4962
16 58 5208
17 99 4755
18 46 4491
19 70 5732
20 73 5731
21 82 5040
22 175 6102
23 83 4904
24 135 5369
25 139 5578
26 167 4619
27 52 4731
28 66 5011
29 129 5299
30 78 4146
31 96 4625
32 130 4736
33 59 4219
34 75 5116
35 93 4205
36 151 4121
37 116 5103
38 80 4300
39 109 4578
40 163 3809
41 69 5526
42 106 4247
43 69 3830
44 129 4394
45 90 4826
46 141 4409
47 122 4569
48 111 4106
49 226 4794
50 78 3914
51 78 3793
52 91 4405
53 49 4022
54 167 4100
55 72 4788
56 95 3163
57 134 3585
58 155 3903
59 70 4178
60 113 3863
61 215 4187
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Woon
1.008e+02 1.755e-03
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-63.96 -37.71 -12.94 26.88 205.16
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.008e+02 4.968e+01 2.029 0.0469 *
Woon 1.755e-03 1.074e-02 0.163 0.8707
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 52.68 on 59 degrees of freedom
Multiple R-squared: 0.0004526, Adjusted R-squared: -0.01649
F-statistic: 0.02672 on 1 and 59 DF, p-value: 0.8707
> 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.2860530 0.5721059942 0.7139470029
[2,] 0.9997151 0.0005698728 0.0002849364
[3,] 0.9992432 0.0015136911 0.0007568455
[4,] 0.9991233 0.0017533539 0.0008766770
[5,] 0.9998838 0.0002323008 0.0001161504
[6,] 0.9997555 0.0004889568 0.0002444784
[7,] 0.9995129 0.0009741807 0.0004870903
[8,] 0.9992166 0.0015668357 0.0007834178
[9,] 0.9991116 0.0017767297 0.0008883649
[10,] 0.9990003 0.0019993541 0.0009996770
[11,] 0.9986270 0.0027459833 0.0013729917
[12,] 0.9985597 0.0028805751 0.0014402876
[13,] 0.9973161 0.0053678763 0.0026839381
[14,] 0.9976880 0.0046240258 0.0023120129
[15,] 0.9969629 0.0060742798 0.0030371399
[16,] 0.9958795 0.0082409701 0.0041204850
[17,] 0.9937838 0.0124323582 0.0062161791
[18,] 0.9947832 0.0104335299 0.0052167649
[19,] 0.9920900 0.0158199172 0.0079099586
[20,] 0.9881583 0.0236833746 0.0118416873
[21,] 0.9835132 0.0329735728 0.0164867864
[22,] 0.9856126 0.0287748594 0.0143874297
[23,] 0.9862455 0.0275089506 0.0137544753
[24,] 0.9837211 0.0325577690 0.0162788845
[25,] 0.9758911 0.0482178305 0.0241089153
[26,] 0.9676779 0.0646442647 0.0323221324
[27,] 0.9522041 0.0955918167 0.0477959084
[28,] 0.9343981 0.1312037461 0.0656018731
[29,] 0.9321438 0.1357123028 0.0678561514
[30,] 0.9171014 0.1657972987 0.0828986494
[31,] 0.8878617 0.2242765439 0.1121382719
[32,] 0.8748393 0.2503213438 0.1251606719
[33,] 0.8297611 0.3404778577 0.1702389288
[34,] 0.7950417 0.4099166357 0.2049583179
[35,] 0.7341141 0.5317717877 0.2658858938
[36,] 0.7377000 0.5245999129 0.2622999564
[37,] 0.7495790 0.5008420391 0.2504210195
[38,] 0.6812017 0.6375966719 0.3187983359
[39,] 0.6470535 0.7058930189 0.3529465095
[40,] 0.5694519 0.8610962895 0.4305481447
[41,] 0.5325809 0.9348382236 0.4674191118
[42,] 0.4567408 0.9134816844 0.5432591578
[43,] 0.3716643 0.7433285902 0.6283357049
[44,] 0.2886017 0.5772034783 0.7113982609
[45,] 0.5435289 0.9129422647 0.4564711324
[46,] 0.4779467 0.9558934534 0.5220532733
[47,] 0.4196909 0.8393817387 0.5803091306
[48,] 0.3276251 0.6552501948 0.6723749026
[49,] 0.4002811 0.8005622542 0.5997188729
[50,] 0.3596545 0.7193090167 0.6403454916
[51,] 0.3956721 0.7913442110 0.6043278945
[52,] 0.2555241 0.5110481411 0.7444759295
> postscript(file="/var/www/html/rcomp/tmp/12bqf1258978479.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/2awwo1258978479.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/3bdbb1258978479.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/4np0u1258978479.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/5m0vy1258978479.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
63.4187200 -37.7066251 -42.4205636 -33.0857005 -63.9561698 205.1635065
7 8 9 10 11 12
-6.3840468 -58.0944754 121.4036008 37.0171677 -6.4738885 48.0764992
13 14 15 16 17 18
-36.6374393 -50.1295749 -37.5318028 -51.9635275 -10.1685222 -62.7052079
19 20 21 22 23 24
-40.8831363 -37.8813813 -27.6686911 63.4675217 -26.4300140 24.7539209
25 26 27 28 29 30
28.3871304 58.0701548 -57.1264028 -43.6177967 18.8767694 -30.0997403
31 32 33 34 35 36
-12.9403750 20.8648224 -49.2278537 -34.8020695 -15.2032840 42.9441342
37 38 39 40 41 42
6.2207452 -28.3700070 0.1421090 55.4916875 -41.5216107 -2.2769931
43 44 45 46 47 48
-38.5451671 20.4650250 -19.2931257 32.4387003 13.1579038 2.9704588
49 50 51 52 53 54
116.7630336 -29.6925853 -29.4802329 -17.5542797 -58.8821230 58.9809887
55 56 57 58 59 60
-37.2264365 -11.3745964 26.8848027 47.3267195 -38.1558996 5.3969186
61
106.8283056
> postscript(file="/var/www/html/rcomp/tmp/6tbpj1258978479.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 63.4187200 NA
1 -37.7066251 63.4187200
2 -42.4205636 -37.7066251
3 -33.0857005 -42.4205636
4 -63.9561698 -33.0857005
5 205.1635065 -63.9561698
6 -6.3840468 205.1635065
7 -58.0944754 -6.3840468
8 121.4036008 -58.0944754
9 37.0171677 121.4036008
10 -6.4738885 37.0171677
11 48.0764992 -6.4738885
12 -36.6374393 48.0764992
13 -50.1295749 -36.6374393
14 -37.5318028 -50.1295749
15 -51.9635275 -37.5318028
16 -10.1685222 -51.9635275
17 -62.7052079 -10.1685222
18 -40.8831363 -62.7052079
19 -37.8813813 -40.8831363
20 -27.6686911 -37.8813813
21 63.4675217 -27.6686911
22 -26.4300140 63.4675217
23 24.7539209 -26.4300140
24 28.3871304 24.7539209
25 58.0701548 28.3871304
26 -57.1264028 58.0701548
27 -43.6177967 -57.1264028
28 18.8767694 -43.6177967
29 -30.0997403 18.8767694
30 -12.9403750 -30.0997403
31 20.8648224 -12.9403750
32 -49.2278537 20.8648224
33 -34.8020695 -49.2278537
34 -15.2032840 -34.8020695
35 42.9441342 -15.2032840
36 6.2207452 42.9441342
37 -28.3700070 6.2207452
38 0.1421090 -28.3700070
39 55.4916875 0.1421090
40 -41.5216107 55.4916875
41 -2.2769931 -41.5216107
42 -38.5451671 -2.2769931
43 20.4650250 -38.5451671
44 -19.2931257 20.4650250
45 32.4387003 -19.2931257
46 13.1579038 32.4387003
47 2.9704588 13.1579038
48 116.7630336 2.9704588
49 -29.6925853 116.7630336
50 -29.4802329 -29.6925853
51 -17.5542797 -29.4802329
52 -58.8821230 -17.5542797
53 58.9809887 -58.8821230
54 -37.2264365 58.9809887
55 -11.3745964 -37.2264365
56 26.8848027 -11.3745964
57 47.3267195 26.8848027
58 -38.1558996 47.3267195
59 5.3969186 -38.1558996
60 106.8283056 5.3969186
61 NA 106.8283056
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -37.7066251 63.4187200
[2,] -42.4205636 -37.7066251
[3,] -33.0857005 -42.4205636
[4,] -63.9561698 -33.0857005
[5,] 205.1635065 -63.9561698
[6,] -6.3840468 205.1635065
[7,] -58.0944754 -6.3840468
[8,] 121.4036008 -58.0944754
[9,] 37.0171677 121.4036008
[10,] -6.4738885 37.0171677
[11,] 48.0764992 -6.4738885
[12,] -36.6374393 48.0764992
[13,] -50.1295749 -36.6374393
[14,] -37.5318028 -50.1295749
[15,] -51.9635275 -37.5318028
[16,] -10.1685222 -51.9635275
[17,] -62.7052079 -10.1685222
[18,] -40.8831363 -62.7052079
[19,] -37.8813813 -40.8831363
[20,] -27.6686911 -37.8813813
[21,] 63.4675217 -27.6686911
[22,] -26.4300140 63.4675217
[23,] 24.7539209 -26.4300140
[24,] 28.3871304 24.7539209
[25,] 58.0701548 28.3871304
[26,] -57.1264028 58.0701548
[27,] -43.6177967 -57.1264028
[28,] 18.8767694 -43.6177967
[29,] -30.0997403 18.8767694
[30,] -12.9403750 -30.0997403
[31,] 20.8648224 -12.9403750
[32,] -49.2278537 20.8648224
[33,] -34.8020695 -49.2278537
[34,] -15.2032840 -34.8020695
[35,] 42.9441342 -15.2032840
[36,] 6.2207452 42.9441342
[37,] -28.3700070 6.2207452
[38,] 0.1421090 -28.3700070
[39,] 55.4916875 0.1421090
[40,] -41.5216107 55.4916875
[41,] -2.2769931 -41.5216107
[42,] -38.5451671 -2.2769931
[43,] 20.4650250 -38.5451671
[44,] -19.2931257 20.4650250
[45,] 32.4387003 -19.2931257
[46,] 13.1579038 32.4387003
[47,] 2.9704588 13.1579038
[48,] 116.7630336 2.9704588
[49,] -29.6925853 116.7630336
[50,] -29.4802329 -29.6925853
[51,] -17.5542797 -29.4802329
[52,] -58.8821230 -17.5542797
[53,] 58.9809887 -58.8821230
[54,] -37.2264365 58.9809887
[55,] -11.3745964 -37.2264365
[56,] 26.8848027 -11.3745964
[57,] 47.3267195 26.8848027
[58,] -38.1558996 47.3267195
[59,] 5.3969186 -38.1558996
[60,] 106.8283056 5.3969186
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -37.7066251 63.4187200
2 -42.4205636 -37.7066251
3 -33.0857005 -42.4205636
4 -63.9561698 -33.0857005
5 205.1635065 -63.9561698
6 -6.3840468 205.1635065
7 -58.0944754 -6.3840468
8 121.4036008 -58.0944754
9 37.0171677 121.4036008
10 -6.4738885 37.0171677
11 48.0764992 -6.4738885
12 -36.6374393 48.0764992
13 -50.1295749 -36.6374393
14 -37.5318028 -50.1295749
15 -51.9635275 -37.5318028
16 -10.1685222 -51.9635275
17 -62.7052079 -10.1685222
18 -40.8831363 -62.7052079
19 -37.8813813 -40.8831363
20 -27.6686911 -37.8813813
21 63.4675217 -27.6686911
22 -26.4300140 63.4675217
23 24.7539209 -26.4300140
24 28.3871304 24.7539209
25 58.0701548 28.3871304
26 -57.1264028 58.0701548
27 -43.6177967 -57.1264028
28 18.8767694 -43.6177967
29 -30.0997403 18.8767694
30 -12.9403750 -30.0997403
31 20.8648224 -12.9403750
32 -49.2278537 20.8648224
33 -34.8020695 -49.2278537
34 -15.2032840 -34.8020695
35 42.9441342 -15.2032840
36 6.2207452 42.9441342
37 -28.3700070 6.2207452
38 0.1421090 -28.3700070
39 55.4916875 0.1421090
40 -41.5216107 55.4916875
41 -2.2769931 -41.5216107
42 -38.5451671 -2.2769931
43 20.4650250 -38.5451671
44 -19.2931257 20.4650250
45 32.4387003 -19.2931257
46 13.1579038 32.4387003
47 2.9704588 13.1579038
48 116.7630336 2.9704588
49 -29.6925853 116.7630336
50 -29.4802329 -29.6925853
51 -17.5542797 -29.4802329
52 -58.8821230 -17.5542797
53 58.9809887 -58.8821230
54 -37.2264365 58.9809887
55 -11.3745964 -37.2264365
56 26.8848027 -11.3745964
57 47.3267195 26.8848027
58 -38.1558996 47.3267195
59 5.3969186 -38.1558996
60 106.8283056 5.3969186
> 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/7jcew1258978479.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/8x2cw1258978479.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/9h49b1258978479.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/10pttf1258978479.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/119mxz1258978479.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/129f8c1258978479.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/13s1351258978479.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/14l6tn1258978479.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/159coy1258978479.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/16tb3p1258978479.tab")
+ }
>
> system("convert tmp/12bqf1258978479.ps tmp/12bqf1258978479.png")
> system("convert tmp/2awwo1258978479.ps tmp/2awwo1258978479.png")
> system("convert tmp/3bdbb1258978479.ps tmp/3bdbb1258978479.png")
> system("convert tmp/4np0u1258978479.ps tmp/4np0u1258978479.png")
> system("convert tmp/5m0vy1258978479.ps tmp/5m0vy1258978479.png")
> system("convert tmp/6tbpj1258978479.ps tmp/6tbpj1258978479.png")
> system("convert tmp/7jcew1258978479.ps tmp/7jcew1258978479.png")
> system("convert tmp/8x2cw1258978479.ps tmp/8x2cw1258978479.png")
> system("convert tmp/9h49b1258978479.ps tmp/9h49b1258978479.png")
> system("convert tmp/10pttf1258978479.ps tmp/10pttf1258978479.png")
>
>
> proc.time()
user system elapsed
2.473 1.567 4.299