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(269645,0,267037,0,258113,0,262813,0,267413,0,267366,0,264777,0,258863,0,254844,0,254868,0,277267,0,285351,0,286602,0,283042,0,276687,0,277915,0,277128,0,277103,0,275037,0,270150,0,267140,0,264993,0,287259,0,291186,0,292300,0,288186,0,281477,0,282656,1,280190,1,280408,1,276836,1,275216,1,274352,1,271311,1,289802,1,290726,1,292300,1,278506,1,269826,1,265861,1,269034,1,264176,1,255198,1,253353,1,246057,1,235372,1,258556,1,260993,1,254663,1,250643,1,243422,1,247105,1,248541,1,245039,1,237080,1,237085,1,225554,1,226839,1,247934,1,248333,1,246969,1,245098,1,246263,1),dim=c(2,63),dimnames=list(c('Mannen','Dummy'),1:63))
> y <- array(NA,dim=c(2,63),dimnames=list(c('Mannen','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
Mannen Dummy t
1 269645 0 1
2 267037 0 2
3 258113 0 3
4 262813 0 4
5 267413 0 5
6 267366 0 6
7 264777 0 7
8 258863 0 8
9 254844 0 9
10 254868 0 10
11 277267 0 11
12 285351 0 12
13 286602 0 13
14 283042 0 14
15 276687 0 15
16 277915 0 16
17 277128 0 17
18 277103 0 18
19 275037 0 19
20 270150 0 20
21 267140 0 21
22 264993 0 22
23 287259 0 23
24 291186 0 24
25 292300 0 25
26 288186 0 26
27 281477 0 27
28 282656 1 28
29 280190 1 29
30 280408 1 30
31 276836 1 31
32 275216 1 32
33 274352 1 33
34 271311 1 34
35 289802 1 35
36 290726 1 36
37 292300 1 37
38 278506 1 38
39 269826 1 39
40 265861 1 40
41 269034 1 41
42 264176 1 42
43 255198 1 43
44 253353 1 44
45 246057 1 45
46 235372 1 46
47 258556 1 47
48 260993 1 48
49 254663 1 49
50 250643 1 50
51 243422 1 51
52 247105 1 52
53 248541 1 53
54 245039 1 54
55 237080 1 55
56 237085 1 56
57 225554 1 57
58 226839 1 58
59 247934 1 59
60 248333 1 60
61 246969 1 61
62 245098 1 62
63 246263 1 63
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy t
284199 9490 -764
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-24584.5 -11774.6 777.1 6751.8 27202.1
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 284198.8 3737.0 76.050 < 2e-16 ***
Dummy 9489.7 6861.1 1.383 0.171753
t -764.0 186.7 -4.092 0.000130 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 13880 on 60 degrees of freedom
Multiple R-squared: 0.3601, Adjusted R-squared: 0.3388
F-statistic: 16.89 on 2 and 60 DF, p-value: 1.523e-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.08672564 0.17345127 0.91327436
[2,] 0.03160165 0.06320331 0.96839835
[3,] 0.01912747 0.03825494 0.98087253
[4,] 0.01767632 0.03535265 0.98232368
[5,] 0.01382551 0.02765101 0.98617449
[6,] 0.18708144 0.37416289 0.81291856
[7,] 0.44567336 0.89134672 0.55432664
[8,] 0.51280645 0.97438710 0.48719355
[9,] 0.44922222 0.89844444 0.55077778
[10,] 0.37595220 0.75190440 0.62404780
[11,] 0.30394458 0.60788916 0.69605542
[12,] 0.24584427 0.49168855 0.75415573
[13,] 0.19684120 0.39368240 0.80315880
[14,] 0.16955521 0.33911043 0.83044479
[15,] 0.19653126 0.39306252 0.80346874
[16,] 0.27919700 0.55839400 0.72080300
[17,] 0.45464957 0.90929914 0.54535043
[18,] 0.43762352 0.87524703 0.56237648
[19,] 0.43099439 0.86198877 0.56900561
[20,] 0.41090971 0.82181943 0.58909029
[21,] 0.34741051 0.69482101 0.65258949
[22,] 0.28625812 0.57251623 0.71374188
[23,] 0.22526403 0.45052807 0.77473597
[24,] 0.17605450 0.35210901 0.82394550
[25,] 0.13255173 0.26510347 0.86744827
[26,] 0.10514124 0.21028247 0.89485876
[27,] 0.08544264 0.17088527 0.91455736
[28,] 0.06950174 0.13900349 0.93049826
[29,] 0.06488272 0.12976544 0.93511728
[30,] 0.07181515 0.14363030 0.92818485
[31,] 0.10075629 0.20151258 0.89924371
[32,] 0.22860215 0.45720430 0.77139785
[33,] 0.27778539 0.55557079 0.72221461
[34,] 0.34056896 0.68113792 0.65943104
[35,] 0.41816457 0.83632914 0.58183543
[36,] 0.50954941 0.98090118 0.49045059
[37,] 0.60576915 0.78846170 0.39423085
[38,] 0.69426142 0.61147716 0.30573858
[39,] 0.74411682 0.51176637 0.25588318
[40,] 0.80526352 0.38947296 0.19473648
[41,] 0.93743207 0.12513585 0.06256793
[42,] 0.92270423 0.15459155 0.07729577
[43,] 0.93225895 0.13548209 0.06774105
[44,] 0.92953964 0.14092071 0.07046036
[45,] 0.92113570 0.15772861 0.07886430
[46,] 0.89337111 0.21325779 0.10662889
[47,] 0.87063850 0.25872301 0.12936150
[48,] 0.88468341 0.23063319 0.11531659
[49,] 0.90769433 0.18461135 0.09230567
[50,] 0.87450228 0.25099543 0.12549772
[51,] 0.83325255 0.33349489 0.16674745
[52,] 0.76542231 0.46915538 0.23457769
> postscript(file="/var/www/html/rcomp/tmp/1hb671229461170.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/24eba1229461170.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/323ev1229461170.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/4x5ua1229461170.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/5byj91229461170.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
-13789.7423 -15633.7080 -23793.6737 -18329.6394 -12965.6051 -12248.5708
7 8 9 10 11 12
-14073.5365 -19223.5022 -22478.4679 -21690.4335 1472.6008 10320.6351
13 14 15 16 17 18
12335.6694 9539.7037 3948.7380 5940.7723 5917.8066 6656.8409
19 20 21 22 23 24
5354.8753 1231.9096 -1014.0561 -2397.0218 20633.0125 25324.0468
25 26 27 28 29 30
27202.0811 23852.1154 17907.1497 10360.4829 8658.5172 9640.5515
31 32 33 34 35 36
6832.5858 5976.6201 5876.6544 3599.6888 22854.7231 24542.7574
37 38 39 40 41 42
26880.7917 13850.8260 5934.8603 2733.8946 6670.9289 2576.9632
43 44 45 46 47 48
-5637.0024 -6717.9681 -13249.9338 -23170.8995 777.1348 3978.1691
49 50 51 52 53 54
-1587.7966 -4843.7623 -11300.7280 -6853.6936 -4653.6593 -7391.6250
55 56 57 58 59 60
-14586.5907 -13817.5564 -24584.5221 -22535.4878 -676.4535 486.5808
61 62 63
-113.3848 -1220.3505 708.6838
> postscript(file="/var/www/html/rcomp/tmp/63o101229461170.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 -13789.7423 NA
1 -15633.7080 -13789.7423
2 -23793.6737 -15633.7080
3 -18329.6394 -23793.6737
4 -12965.6051 -18329.6394
5 -12248.5708 -12965.6051
6 -14073.5365 -12248.5708
7 -19223.5022 -14073.5365
8 -22478.4679 -19223.5022
9 -21690.4335 -22478.4679
10 1472.6008 -21690.4335
11 10320.6351 1472.6008
12 12335.6694 10320.6351
13 9539.7037 12335.6694
14 3948.7380 9539.7037
15 5940.7723 3948.7380
16 5917.8066 5940.7723
17 6656.8409 5917.8066
18 5354.8753 6656.8409
19 1231.9096 5354.8753
20 -1014.0561 1231.9096
21 -2397.0218 -1014.0561
22 20633.0125 -2397.0218
23 25324.0468 20633.0125
24 27202.0811 25324.0468
25 23852.1154 27202.0811
26 17907.1497 23852.1154
27 10360.4829 17907.1497
28 8658.5172 10360.4829
29 9640.5515 8658.5172
30 6832.5858 9640.5515
31 5976.6201 6832.5858
32 5876.6544 5976.6201
33 3599.6888 5876.6544
34 22854.7231 3599.6888
35 24542.7574 22854.7231
36 26880.7917 24542.7574
37 13850.8260 26880.7917
38 5934.8603 13850.8260
39 2733.8946 5934.8603
40 6670.9289 2733.8946
41 2576.9632 6670.9289
42 -5637.0024 2576.9632
43 -6717.9681 -5637.0024
44 -13249.9338 -6717.9681
45 -23170.8995 -13249.9338
46 777.1348 -23170.8995
47 3978.1691 777.1348
48 -1587.7966 3978.1691
49 -4843.7623 -1587.7966
50 -11300.7280 -4843.7623
51 -6853.6936 -11300.7280
52 -4653.6593 -6853.6936
53 -7391.6250 -4653.6593
54 -14586.5907 -7391.6250
55 -13817.5564 -14586.5907
56 -24584.5221 -13817.5564
57 -22535.4878 -24584.5221
58 -676.4535 -22535.4878
59 486.5808 -676.4535
60 -113.3848 486.5808
61 -1220.3505 -113.3848
62 708.6838 -1220.3505
63 NA 708.6838
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -15633.7080 -13789.7423
[2,] -23793.6737 -15633.7080
[3,] -18329.6394 -23793.6737
[4,] -12965.6051 -18329.6394
[5,] -12248.5708 -12965.6051
[6,] -14073.5365 -12248.5708
[7,] -19223.5022 -14073.5365
[8,] -22478.4679 -19223.5022
[9,] -21690.4335 -22478.4679
[10,] 1472.6008 -21690.4335
[11,] 10320.6351 1472.6008
[12,] 12335.6694 10320.6351
[13,] 9539.7037 12335.6694
[14,] 3948.7380 9539.7037
[15,] 5940.7723 3948.7380
[16,] 5917.8066 5940.7723
[17,] 6656.8409 5917.8066
[18,] 5354.8753 6656.8409
[19,] 1231.9096 5354.8753
[20,] -1014.0561 1231.9096
[21,] -2397.0218 -1014.0561
[22,] 20633.0125 -2397.0218
[23,] 25324.0468 20633.0125
[24,] 27202.0811 25324.0468
[25,] 23852.1154 27202.0811
[26,] 17907.1497 23852.1154
[27,] 10360.4829 17907.1497
[28,] 8658.5172 10360.4829
[29,] 9640.5515 8658.5172
[30,] 6832.5858 9640.5515
[31,] 5976.6201 6832.5858
[32,] 5876.6544 5976.6201
[33,] 3599.6888 5876.6544
[34,] 22854.7231 3599.6888
[35,] 24542.7574 22854.7231
[36,] 26880.7917 24542.7574
[37,] 13850.8260 26880.7917
[38,] 5934.8603 13850.8260
[39,] 2733.8946 5934.8603
[40,] 6670.9289 2733.8946
[41,] 2576.9632 6670.9289
[42,] -5637.0024 2576.9632
[43,] -6717.9681 -5637.0024
[44,] -13249.9338 -6717.9681
[45,] -23170.8995 -13249.9338
[46,] 777.1348 -23170.8995
[47,] 3978.1691 777.1348
[48,] -1587.7966 3978.1691
[49,] -4843.7623 -1587.7966
[50,] -11300.7280 -4843.7623
[51,] -6853.6936 -11300.7280
[52,] -4653.6593 -6853.6936
[53,] -7391.6250 -4653.6593
[54,] -14586.5907 -7391.6250
[55,] -13817.5564 -14586.5907
[56,] -24584.5221 -13817.5564
[57,] -22535.4878 -24584.5221
[58,] -676.4535 -22535.4878
[59,] 486.5808 -676.4535
[60,] -113.3848 486.5808
[61,] -1220.3505 -113.3848
[62,] 708.6838 -1220.3505
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -15633.7080 -13789.7423
2 -23793.6737 -15633.7080
3 -18329.6394 -23793.6737
4 -12965.6051 -18329.6394
5 -12248.5708 -12965.6051
6 -14073.5365 -12248.5708
7 -19223.5022 -14073.5365
8 -22478.4679 -19223.5022
9 -21690.4335 -22478.4679
10 1472.6008 -21690.4335
11 10320.6351 1472.6008
12 12335.6694 10320.6351
13 9539.7037 12335.6694
14 3948.7380 9539.7037
15 5940.7723 3948.7380
16 5917.8066 5940.7723
17 6656.8409 5917.8066
18 5354.8753 6656.8409
19 1231.9096 5354.8753
20 -1014.0561 1231.9096
21 -2397.0218 -1014.0561
22 20633.0125 -2397.0218
23 25324.0468 20633.0125
24 27202.0811 25324.0468
25 23852.1154 27202.0811
26 17907.1497 23852.1154
27 10360.4829 17907.1497
28 8658.5172 10360.4829
29 9640.5515 8658.5172
30 6832.5858 9640.5515
31 5976.6201 6832.5858
32 5876.6544 5976.6201
33 3599.6888 5876.6544
34 22854.7231 3599.6888
35 24542.7574 22854.7231
36 26880.7917 24542.7574
37 13850.8260 26880.7917
38 5934.8603 13850.8260
39 2733.8946 5934.8603
40 6670.9289 2733.8946
41 2576.9632 6670.9289
42 -5637.0024 2576.9632
43 -6717.9681 -5637.0024
44 -13249.9338 -6717.9681
45 -23170.8995 -13249.9338
46 777.1348 -23170.8995
47 3978.1691 777.1348
48 -1587.7966 3978.1691
49 -4843.7623 -1587.7966
50 -11300.7280 -4843.7623
51 -6853.6936 -11300.7280
52 -4653.6593 -6853.6936
53 -7391.6250 -4653.6593
54 -14586.5907 -7391.6250
55 -13817.5564 -14586.5907
56 -24584.5221 -13817.5564
57 -22535.4878 -24584.5221
58 -676.4535 -22535.4878
59 486.5808 -676.4535
60 -113.3848 486.5808
61 -1220.3505 -113.3848
62 708.6838 -1220.3505
> 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/7hpym1229461170.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/8e3qw1229461170.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/9wxrx1229461170.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/10v8t81229461170.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/11bvbc1229461170.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/12yjvj1229461170.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/13g9jb1229461170.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/14df3o1229461170.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/15pb5x1229461170.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/16w9vd1229461170.tab")
+ }
>
> system("convert tmp/1hb671229461170.ps tmp/1hb671229461170.png")
> system("convert tmp/24eba1229461170.ps tmp/24eba1229461170.png")
> system("convert tmp/323ev1229461170.ps tmp/323ev1229461170.png")
> system("convert tmp/4x5ua1229461170.ps tmp/4x5ua1229461170.png")
> system("convert tmp/5byj91229461170.ps tmp/5byj91229461170.png")
> system("convert tmp/63o101229461170.ps tmp/63o101229461170.png")
> system("convert tmp/7hpym1229461170.ps tmp/7hpym1229461170.png")
> system("convert tmp/8e3qw1229461170.ps tmp/8e3qw1229461170.png")
> system("convert tmp/9wxrx1229461170.ps tmp/9wxrx1229461170.png")
> system("convert tmp/10v8t81229461170.ps tmp/10v8t81229461170.png")
>
>
> proc.time()
user system elapsed
5.108 2.744 5.590