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(93.3,121.8,97.3,127.6,127,129.9,111.7,128,96.4,123.5,133,124,72.2,127.4,95.8,127.6,124.1,128.4,127.6,131.4,110.7,135.1,104.6,134,112.7,144.5,115.3,147.3,139.4,150.9,119,148.7,97.4,141.4,154,138.9,81.5,139.8,88.8,145.6,127.7,147.9,105.1,148.5,114.9,151.1,106.4,157.5,104.5,167.5,121.6,172.3,141.4,173.5,99,187.5,126.7,205.5,134.1,195.1,81.3,204.5,88.6,204.5,132.7,201.7,132.9,207,134.4,206.6,103.7,210.6,119.7,211.1,115,215,132.9,223.9,108.5,238.2,113.9,238.9,142,229.6,97.7,232.2,92.2,222.1,128.8,221.6,134.9,227.3,128.2,221,114.8,213.6,117.9,243.4,119.1,253.8,120.7,265.3,129.1,268.2,117.6,268.5,129.2,266.9,100,268.4,87,250.8,128,231.2,127.7,192,93.4,171.4,84.1,160,71.7,148.1),dim=c(2,61),dimnames=list(c('IPtran','IGpic'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('IPtran','IGpic'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
IPtran IGpic
1 93.3 121.8
2 97.3 127.6
3 127.0 129.9
4 111.7 128.0
5 96.4 123.5
6 133.0 124.0
7 72.2 127.4
8 95.8 127.6
9 124.1 128.4
10 127.6 131.4
11 110.7 135.1
12 104.6 134.0
13 112.7 144.5
14 115.3 147.3
15 139.4 150.9
16 119.0 148.7
17 97.4 141.4
18 154.0 138.9
19 81.5 139.8
20 88.8 145.6
21 127.7 147.9
22 105.1 148.5
23 114.9 151.1
24 106.4 157.5
25 104.5 167.5
26 121.6 172.3
27 141.4 173.5
28 99.0 187.5
29 126.7 205.5
30 134.1 195.1
31 81.3 204.5
32 88.6 204.5
33 132.7 201.7
34 132.9 207.0
35 134.4 206.6
36 103.7 210.6
37 119.7 211.1
38 115.0 215.0
39 132.9 223.9
40 108.5 238.2
41 113.9 238.9
42 142.0 229.6
43 97.7 232.2
44 92.2 222.1
45 128.8 221.6
46 134.9 227.3
47 128.2 221.0
48 114.8 213.6
49 117.9 243.4
50 119.1 253.8
51 120.7 265.3
52 129.1 268.2
53 117.6 268.5
54 129.2 266.9
55 100.0 268.4
56 87.0 250.8
57 128.0 231.2
58 127.7 192.0
59 93.4 171.4
60 84.1 160.0
61 71.7 148.1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) IGpic
97.38281 0.08574
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-38.3810 -12.1065 0.5702 13.8550 44.7078
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 97.38281 9.73374 10.005 2.53e-14 ***
IGpic 0.08574 0.05089 1.685 0.0973 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 18.41 on 59 degrees of freedom
Multiple R-squared: 0.0459, Adjusted R-squared: 0.02973
F-statistic: 2.838 on 1 and 59 DF, p-value: 0.09732
> 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.1314106 0.2628212 0.8685894
[2,] 0.5096597 0.9806806 0.4903403
[3,] 0.8148003 0.3703994 0.1851997
[4,] 0.7444483 0.5111035 0.2555517
[5,] 0.7145281 0.5709438 0.2854719
[6,] 0.6586825 0.6826351 0.3413175
[7,] 0.5856998 0.8286004 0.4143002
[8,] 0.5115800 0.9768400 0.4884200
[9,] 0.4252314 0.8504628 0.5747686
[10,] 0.3353803 0.6707606 0.6646197
[11,] 0.3446253 0.6892506 0.6553747
[12,] 0.2750452 0.5500904 0.7249548
[13,] 0.2749774 0.5499547 0.7250226
[14,] 0.6141736 0.7716528 0.3858264
[15,] 0.7472742 0.5054517 0.2527258
[16,] 0.7915620 0.4168760 0.2084380
[17,] 0.7699461 0.4601077 0.2300539
[18,] 0.7226553 0.5546893 0.2773447
[19,] 0.6604086 0.6791828 0.3395914
[20,] 0.6061407 0.7877186 0.3938593
[21,] 0.5562134 0.8875733 0.4437866
[22,] 0.4968980 0.9937960 0.5031020
[23,] 0.5889998 0.8220004 0.4110002
[24,] 0.5953065 0.8093871 0.4046935
[25,] 0.5460586 0.9078828 0.4539414
[26,] 0.5576388 0.8847224 0.4423612
[27,] 0.7371781 0.5256438 0.2628219
[28,] 0.7787143 0.4425714 0.2212857
[29,] 0.7944302 0.4111395 0.2055698
[30,] 0.8063133 0.3873733 0.1936867
[31,] 0.8325011 0.3349978 0.1674989
[32,] 0.7975412 0.4049176 0.2024588
[33,] 0.7502736 0.4994527 0.2497264
[34,] 0.6871641 0.6256718 0.3128359
[35,] 0.6909715 0.6180570 0.3090285
[36,] 0.6372218 0.7255565 0.3627782
[37,] 0.5618961 0.8762078 0.4381039
[38,] 0.6636180 0.6727640 0.3363820
[39,] 0.6617697 0.6764606 0.3382303
[40,] 0.6905438 0.6189123 0.3094562
[41,] 0.6767443 0.6465114 0.3232557
[42,] 0.7212913 0.5574173 0.2787087
[43,] 0.7297217 0.5405566 0.2702783
[44,] 0.6648977 0.6702046 0.3351023
[45,] 0.5746749 0.8506502 0.4253251
[46,] 0.4742604 0.9485209 0.5257396
[47,] 0.3701896 0.7403792 0.6298104
[48,] 0.3007271 0.6014543 0.6992729
[49,] 0.2077033 0.4154066 0.7922967
[50,] 0.1714335 0.3428669 0.8285665
[51,] 0.1350217 0.2700434 0.8649783
[52,] 0.6850209 0.6299583 0.3149791
> postscript(file="/var/www/html/rcomp/tmp/1ddn81259003019.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/2zd7l1259003019.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/3x7k01259003019.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/4h7iv1259003019.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/5ztio1259003019.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
-14.52600771 -11.02330281 18.47949397 3.34240098 -11.57176662 24.98536312
7 8 9 10 11 12
-36.10615470 -12.52330281 15.70810477 18.95088316 1.73364319 -4.27204222
13 14 15 16 17 18
2.92768217 5.28760867 29.07894275 8.86757192 -12.10652218 44.70782916
19 20 21 22 23 24
-27.86933732 -21.06663242 17.63616435 -5.01527997 4.56179464 -4.48694478
25 26 27 28 29 30
-7.24435012 9.44409532 29.14120668 -14.45916080 11.69750958 19.98921114
31 32 33 34 35 36
-33.61674988 -26.31674988 18.02332361 17.76889878 19.30319499 -11.73976714
37 38 39 40 41 42
4.21736259 -0.81702549 16.31988375 -9.30620589 -3.96622426 24.93116271
43 44 45 46 47 48
-19.59176268 -24.22578329 12.41708698 18.02836594 11.86853130 -0.89698874
49 50 51 52 53 54
-0.35205666 -0.04375822 0.57022564 8.72157809 -2.80414407 8.93304078
55 56 57 58 59 60
-20.39557002 -31.88653662 10.79397785 13.85500679 -18.67873820 -27.00129611
61
-38.38098376
> postscript(file="/var/www/html/rcomp/tmp/6ipv91259003019.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 -14.52600771 NA
1 -11.02330281 -14.52600771
2 18.47949397 -11.02330281
3 3.34240098 18.47949397
4 -11.57176662 3.34240098
5 24.98536312 -11.57176662
6 -36.10615470 24.98536312
7 -12.52330281 -36.10615470
8 15.70810477 -12.52330281
9 18.95088316 15.70810477
10 1.73364319 18.95088316
11 -4.27204222 1.73364319
12 2.92768217 -4.27204222
13 5.28760867 2.92768217
14 29.07894275 5.28760867
15 8.86757192 29.07894275
16 -12.10652218 8.86757192
17 44.70782916 -12.10652218
18 -27.86933732 44.70782916
19 -21.06663242 -27.86933732
20 17.63616435 -21.06663242
21 -5.01527997 17.63616435
22 4.56179464 -5.01527997
23 -4.48694478 4.56179464
24 -7.24435012 -4.48694478
25 9.44409532 -7.24435012
26 29.14120668 9.44409532
27 -14.45916080 29.14120668
28 11.69750958 -14.45916080
29 19.98921114 11.69750958
30 -33.61674988 19.98921114
31 -26.31674988 -33.61674988
32 18.02332361 -26.31674988
33 17.76889878 18.02332361
34 19.30319499 17.76889878
35 -11.73976714 19.30319499
36 4.21736259 -11.73976714
37 -0.81702549 4.21736259
38 16.31988375 -0.81702549
39 -9.30620589 16.31988375
40 -3.96622426 -9.30620589
41 24.93116271 -3.96622426
42 -19.59176268 24.93116271
43 -24.22578329 -19.59176268
44 12.41708698 -24.22578329
45 18.02836594 12.41708698
46 11.86853130 18.02836594
47 -0.89698874 11.86853130
48 -0.35205666 -0.89698874
49 -0.04375822 -0.35205666
50 0.57022564 -0.04375822
51 8.72157809 0.57022564
52 -2.80414407 8.72157809
53 8.93304078 -2.80414407
54 -20.39557002 8.93304078
55 -31.88653662 -20.39557002
56 10.79397785 -31.88653662
57 13.85500679 10.79397785
58 -18.67873820 13.85500679
59 -27.00129611 -18.67873820
60 -38.38098376 -27.00129611
61 NA -38.38098376
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -11.02330281 -14.52600771
[2,] 18.47949397 -11.02330281
[3,] 3.34240098 18.47949397
[4,] -11.57176662 3.34240098
[5,] 24.98536312 -11.57176662
[6,] -36.10615470 24.98536312
[7,] -12.52330281 -36.10615470
[8,] 15.70810477 -12.52330281
[9,] 18.95088316 15.70810477
[10,] 1.73364319 18.95088316
[11,] -4.27204222 1.73364319
[12,] 2.92768217 -4.27204222
[13,] 5.28760867 2.92768217
[14,] 29.07894275 5.28760867
[15,] 8.86757192 29.07894275
[16,] -12.10652218 8.86757192
[17,] 44.70782916 -12.10652218
[18,] -27.86933732 44.70782916
[19,] -21.06663242 -27.86933732
[20,] 17.63616435 -21.06663242
[21,] -5.01527997 17.63616435
[22,] 4.56179464 -5.01527997
[23,] -4.48694478 4.56179464
[24,] -7.24435012 -4.48694478
[25,] 9.44409532 -7.24435012
[26,] 29.14120668 9.44409532
[27,] -14.45916080 29.14120668
[28,] 11.69750958 -14.45916080
[29,] 19.98921114 11.69750958
[30,] -33.61674988 19.98921114
[31,] -26.31674988 -33.61674988
[32,] 18.02332361 -26.31674988
[33,] 17.76889878 18.02332361
[34,] 19.30319499 17.76889878
[35,] -11.73976714 19.30319499
[36,] 4.21736259 -11.73976714
[37,] -0.81702549 4.21736259
[38,] 16.31988375 -0.81702549
[39,] -9.30620589 16.31988375
[40,] -3.96622426 -9.30620589
[41,] 24.93116271 -3.96622426
[42,] -19.59176268 24.93116271
[43,] -24.22578329 -19.59176268
[44,] 12.41708698 -24.22578329
[45,] 18.02836594 12.41708698
[46,] 11.86853130 18.02836594
[47,] -0.89698874 11.86853130
[48,] -0.35205666 -0.89698874
[49,] -0.04375822 -0.35205666
[50,] 0.57022564 -0.04375822
[51,] 8.72157809 0.57022564
[52,] -2.80414407 8.72157809
[53,] 8.93304078 -2.80414407
[54,] -20.39557002 8.93304078
[55,] -31.88653662 -20.39557002
[56,] 10.79397785 -31.88653662
[57,] 13.85500679 10.79397785
[58,] -18.67873820 13.85500679
[59,] -27.00129611 -18.67873820
[60,] -38.38098376 -27.00129611
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -11.02330281 -14.52600771
2 18.47949397 -11.02330281
3 3.34240098 18.47949397
4 -11.57176662 3.34240098
5 24.98536312 -11.57176662
6 -36.10615470 24.98536312
7 -12.52330281 -36.10615470
8 15.70810477 -12.52330281
9 18.95088316 15.70810477
10 1.73364319 18.95088316
11 -4.27204222 1.73364319
12 2.92768217 -4.27204222
13 5.28760867 2.92768217
14 29.07894275 5.28760867
15 8.86757192 29.07894275
16 -12.10652218 8.86757192
17 44.70782916 -12.10652218
18 -27.86933732 44.70782916
19 -21.06663242 -27.86933732
20 17.63616435 -21.06663242
21 -5.01527997 17.63616435
22 4.56179464 -5.01527997
23 -4.48694478 4.56179464
24 -7.24435012 -4.48694478
25 9.44409532 -7.24435012
26 29.14120668 9.44409532
27 -14.45916080 29.14120668
28 11.69750958 -14.45916080
29 19.98921114 11.69750958
30 -33.61674988 19.98921114
31 -26.31674988 -33.61674988
32 18.02332361 -26.31674988
33 17.76889878 18.02332361
34 19.30319499 17.76889878
35 -11.73976714 19.30319499
36 4.21736259 -11.73976714
37 -0.81702549 4.21736259
38 16.31988375 -0.81702549
39 -9.30620589 16.31988375
40 -3.96622426 -9.30620589
41 24.93116271 -3.96622426
42 -19.59176268 24.93116271
43 -24.22578329 -19.59176268
44 12.41708698 -24.22578329
45 18.02836594 12.41708698
46 11.86853130 18.02836594
47 -0.89698874 11.86853130
48 -0.35205666 -0.89698874
49 -0.04375822 -0.35205666
50 0.57022564 -0.04375822
51 8.72157809 0.57022564
52 -2.80414407 8.72157809
53 8.93304078 -2.80414407
54 -20.39557002 8.93304078
55 -31.88653662 -20.39557002
56 10.79397785 -31.88653662
57 13.85500679 10.79397785
58 -18.67873820 13.85500679
59 -27.00129611 -18.67873820
60 -38.38098376 -27.00129611
> 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/7ojcg1259003019.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/8g2iu1259003019.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/9pywv1259003019.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/10u0jd1259003019.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/11irzi1259003019.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/123ods1259003019.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/1304n21259003019.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/14ny991259003019.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/15c8851259003019.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/167x0j1259003020.tab")
+ }
>
> system("convert tmp/1ddn81259003019.ps tmp/1ddn81259003019.png")
> system("convert tmp/2zd7l1259003019.ps tmp/2zd7l1259003019.png")
> system("convert tmp/3x7k01259003019.ps tmp/3x7k01259003019.png")
> system("convert tmp/4h7iv1259003019.ps tmp/4h7iv1259003019.png")
> system("convert tmp/5ztio1259003019.ps tmp/5ztio1259003019.png")
> system("convert tmp/6ipv91259003019.ps tmp/6ipv91259003019.png")
> system("convert tmp/7ojcg1259003019.ps tmp/7ojcg1259003019.png")
> system("convert tmp/8g2iu1259003019.ps tmp/8g2iu1259003019.png")
> system("convert tmp/9pywv1259003019.ps tmp/9pywv1259003019.png")
> system("convert tmp/10u0jd1259003019.ps tmp/10u0jd1259003019.png")
>
>
> proc.time()
user system elapsed
2.376 1.543 3.490