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(100.00,100.00,94.97,106.73,107.50,104.81,124.27,96.15,107.06,88.46,79.71,88.46,163.41,91.35,144.83,92.31,166.82,91.35,154.26,87.50,132.60,85.58,157.51,86.54,104.02,97.12,106.03,99.04,113.23,98.08,117.64,92.31,113.34,88.46,66.62,89.42,185.99,90.38,174.57,90.38,208.19,88.46,163.81,86.54,162.46,86.54,148.16,86.54,113.41,94.23,105.63,96.15,111.79,94.23,132.36,89.42,110.75,86.54,67.37,86.54,178.29,87.50,156.38,87.50,189.71,87.50,152.80,88.46,150.80,84.62,160.40,79.81,127.25,80.77,108.47,77.88,117.09,74.04,147.25,75.96,116.19,75.96,75.83,76.92,181.94,75.96,179.12,73.08,183.15,68.27,197.90,65.38,155.42,62.50,162.54,66.35,125.90,78.85,105.50,83.65,121.11,79.81,137.51,75.96,97.20,72.12,69.74,75.00,152.58,79.81,146.59,80.77,161.16,78.85,152.84,74.04,121.95,69.23,140.12,70.19),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> 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
Y X
1 100.00 100.00
2 94.97 106.73
3 107.50 104.81
4 124.27 96.15
5 107.06 88.46
6 79.71 88.46
7 163.41 91.35
8 144.83 92.31
9 166.82 91.35
10 154.26 87.50
11 132.60 85.58
12 157.51 86.54
13 104.02 97.12
14 106.03 99.04
15 113.23 98.08
16 117.64 92.31
17 113.34 88.46
18 66.62 89.42
19 185.99 90.38
20 174.57 90.38
21 208.19 88.46
22 163.81 86.54
23 162.46 86.54
24 148.16 86.54
25 113.41 94.23
26 105.63 96.15
27 111.79 94.23
28 132.36 89.42
29 110.75 86.54
30 67.37 86.54
31 178.29 87.50
32 156.38 87.50
33 189.71 87.50
34 152.80 88.46
35 150.80 84.62
36 160.40 79.81
37 127.25 80.77
38 108.47 77.88
39 117.09 74.04
40 147.25 75.96
41 116.19 75.96
42 75.83 76.92
43 181.94 75.96
44 179.12 73.08
45 183.15 68.27
46 197.90 65.38
47 155.42 62.50
48 162.54 66.35
49 125.90 78.85
50 105.50 83.65
51 121.11 79.81
52 137.51 75.96
53 97.20 72.12
54 69.74 75.00
55 152.58 79.81
56 146.59 80.77
57 161.16 78.85
58 152.84 74.04
59 121.95 69.23
60 140.12 70.19
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
214.0976 -0.9346
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-74.2656 -19.3304 -0.8928 22.4664 76.7636
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 214.0976 37.2706 5.744 3.58e-07 ***
X -0.9346 0.4385 -2.131 0.0373 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 32.99 on 58 degrees of freedom
Multiple R-squared: 0.07263, Adjusted R-squared: 0.05664
F-statistic: 4.542 on 1 and 58 DF, p-value: 0.03732
> 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.04775205 0.09550411 0.95224795
[2,] 0.08518487 0.17036974 0.91481513
[3,] 0.40343820 0.80687639 0.59656180
[4,] 0.36820332 0.73640665 0.63179668
[5,] 0.45230277 0.90460553 0.54769723
[6,] 0.37564928 0.75129856 0.62435072
[7,] 0.27895009 0.55790018 0.72104991
[8,] 0.22360242 0.44720484 0.77639758
[9,] 0.17098140 0.34196279 0.82901860
[10,] 0.12000374 0.24000747 0.87999626
[11,] 0.07877993 0.15755986 0.92122007
[12,] 0.05225267 0.10450535 0.94774733
[13,] 0.04118720 0.08237440 0.95881280
[14,] 0.16748103 0.33496206 0.83251897
[15,] 0.31019003 0.62038006 0.68980997
[16,] 0.36504313 0.73008626 0.63495687
[17,] 0.64966928 0.70066145 0.35033072
[18,] 0.61154428 0.77691143 0.38845572
[19,] 0.56999860 0.86000279 0.43000140
[20,] 0.50126651 0.99746698 0.49873349
[21,] 0.43394375 0.86788750 0.56605625
[22,] 0.37636130 0.75272261 0.62363870
[23,] 0.31857246 0.63714492 0.68142754
[24,] 0.25466699 0.50933397 0.74533301
[25,] 0.24760149 0.49520298 0.75239851
[26,] 0.52260781 0.95478439 0.47739219
[27,] 0.55164662 0.89670677 0.44835338
[28,] 0.49951673 0.99903346 0.50048327
[29,] 0.63573025 0.72853950 0.36426975
[30,] 0.61312341 0.77375317 0.38687659
[31,] 0.58122084 0.83755831 0.41877916
[32,] 0.56024575 0.87950850 0.43975425
[33,] 0.51171193 0.97657614 0.48828807
[34,] 0.52432416 0.95135168 0.47567584
[35,] 0.51271420 0.97457159 0.48728580
[36,] 0.43920823 0.87841647 0.56079177
[37,] 0.40254586 0.80509173 0.59745414
[38,] 0.60597348 0.78805304 0.39402652
[39,] 0.65948315 0.68103371 0.34051685
[40,] 0.67393613 0.65212774 0.32606387
[41,] 0.67167870 0.65664260 0.32832130
[42,] 0.77354357 0.45291286 0.22645643
[43,] 0.71220769 0.57558461 0.28779231
[44,] 0.71668500 0.56663001 0.28331500
[45,] 0.62736636 0.74526727 0.37263364
[46,] 0.65113883 0.69772234 0.34886117
[47,] 0.58929249 0.82141503 0.41070751
[48,] 0.46839522 0.93679045 0.53160478
[49,] 0.44987122 0.89974245 0.55012878
[50,] 0.98528313 0.02943374 0.01471687
[51,] 0.94793790 0.10412420 0.05206210
> postscript(file="/var/www/html/rcomp/tmp/12yz81259346512.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/2mpuz1259346512.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/3t1pf1259346512.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/484ep1259346512.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/5hh6m1259346512.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 = 60
Frequency = 1
1 2 3 4 5 6
-20.64162739 -19.38204033 -8.64639503 0.03031761 -24.36644680 -51.71644680
7 8 9 10 11 12
34.68443085 17.00160820 38.09443085 21.93637585 -1.51797886 24.28919850
13 14 15 16 17 18
-19.31315944 -15.50880474 -9.20598209 -10.18839180 -18.08644680 -63.90926945
19 20 21 22 23 24
56.35790790 44.93790790 76.76355320 30.58919850 29.23919850 14.93919850
25 26 27 28 29 30
-12.62403709 -18.60968239 -14.24403709 1.83073055 -22.47080150 -65.85080150
31 32 33 34 35 36
45.96637585 24.05637585 57.38637585 21.37355320 15.78484379 20.88961144
37 38 39 40 41 42
-11.36321121 -32.84408886 -27.81279827 4.14155643 -26.91844357 -66.38126621
43 44 45 46 47 48
38.83155643 33.32002438 32.85479202 44.90391437 -0.26761768 10.45043732
49 50 51 52 53 54
-14.50756591 -30.42167916 -18.40038856 -5.59844357 -49.49715297 -74.26562092
55 56 57 58 59 60
13.06961144 7.97678879 20.75243409 7.93720173 -27.44803063 -8.38085327
> postscript(file="/var/www/html/rcomp/tmp/66ajp1259346512.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -20.64162739 NA
1 -19.38204033 -20.64162739
2 -8.64639503 -19.38204033
3 0.03031761 -8.64639503
4 -24.36644680 0.03031761
5 -51.71644680 -24.36644680
6 34.68443085 -51.71644680
7 17.00160820 34.68443085
8 38.09443085 17.00160820
9 21.93637585 38.09443085
10 -1.51797886 21.93637585
11 24.28919850 -1.51797886
12 -19.31315944 24.28919850
13 -15.50880474 -19.31315944
14 -9.20598209 -15.50880474
15 -10.18839180 -9.20598209
16 -18.08644680 -10.18839180
17 -63.90926945 -18.08644680
18 56.35790790 -63.90926945
19 44.93790790 56.35790790
20 76.76355320 44.93790790
21 30.58919850 76.76355320
22 29.23919850 30.58919850
23 14.93919850 29.23919850
24 -12.62403709 14.93919850
25 -18.60968239 -12.62403709
26 -14.24403709 -18.60968239
27 1.83073055 -14.24403709
28 -22.47080150 1.83073055
29 -65.85080150 -22.47080150
30 45.96637585 -65.85080150
31 24.05637585 45.96637585
32 57.38637585 24.05637585
33 21.37355320 57.38637585
34 15.78484379 21.37355320
35 20.88961144 15.78484379
36 -11.36321121 20.88961144
37 -32.84408886 -11.36321121
38 -27.81279827 -32.84408886
39 4.14155643 -27.81279827
40 -26.91844357 4.14155643
41 -66.38126621 -26.91844357
42 38.83155643 -66.38126621
43 33.32002438 38.83155643
44 32.85479202 33.32002438
45 44.90391437 32.85479202
46 -0.26761768 44.90391437
47 10.45043732 -0.26761768
48 -14.50756591 10.45043732
49 -30.42167916 -14.50756591
50 -18.40038856 -30.42167916
51 -5.59844357 -18.40038856
52 -49.49715297 -5.59844357
53 -74.26562092 -49.49715297
54 13.06961144 -74.26562092
55 7.97678879 13.06961144
56 20.75243409 7.97678879
57 7.93720173 20.75243409
58 -27.44803063 7.93720173
59 -8.38085327 -27.44803063
60 NA -8.38085327
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -19.38204033 -20.64162739
[2,] -8.64639503 -19.38204033
[3,] 0.03031761 -8.64639503
[4,] -24.36644680 0.03031761
[5,] -51.71644680 -24.36644680
[6,] 34.68443085 -51.71644680
[7,] 17.00160820 34.68443085
[8,] 38.09443085 17.00160820
[9,] 21.93637585 38.09443085
[10,] -1.51797886 21.93637585
[11,] 24.28919850 -1.51797886
[12,] -19.31315944 24.28919850
[13,] -15.50880474 -19.31315944
[14,] -9.20598209 -15.50880474
[15,] -10.18839180 -9.20598209
[16,] -18.08644680 -10.18839180
[17,] -63.90926945 -18.08644680
[18,] 56.35790790 -63.90926945
[19,] 44.93790790 56.35790790
[20,] 76.76355320 44.93790790
[21,] 30.58919850 76.76355320
[22,] 29.23919850 30.58919850
[23,] 14.93919850 29.23919850
[24,] -12.62403709 14.93919850
[25,] -18.60968239 -12.62403709
[26,] -14.24403709 -18.60968239
[27,] 1.83073055 -14.24403709
[28,] -22.47080150 1.83073055
[29,] -65.85080150 -22.47080150
[30,] 45.96637585 -65.85080150
[31,] 24.05637585 45.96637585
[32,] 57.38637585 24.05637585
[33,] 21.37355320 57.38637585
[34,] 15.78484379 21.37355320
[35,] 20.88961144 15.78484379
[36,] -11.36321121 20.88961144
[37,] -32.84408886 -11.36321121
[38,] -27.81279827 -32.84408886
[39,] 4.14155643 -27.81279827
[40,] -26.91844357 4.14155643
[41,] -66.38126621 -26.91844357
[42,] 38.83155643 -66.38126621
[43,] 33.32002438 38.83155643
[44,] 32.85479202 33.32002438
[45,] 44.90391437 32.85479202
[46,] -0.26761768 44.90391437
[47,] 10.45043732 -0.26761768
[48,] -14.50756591 10.45043732
[49,] -30.42167916 -14.50756591
[50,] -18.40038856 -30.42167916
[51,] -5.59844357 -18.40038856
[52,] -49.49715297 -5.59844357
[53,] -74.26562092 -49.49715297
[54,] 13.06961144 -74.26562092
[55,] 7.97678879 13.06961144
[56,] 20.75243409 7.97678879
[57,] 7.93720173 20.75243409
[58,] -27.44803063 7.93720173
[59,] -8.38085327 -27.44803063
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -19.38204033 -20.64162739
2 -8.64639503 -19.38204033
3 0.03031761 -8.64639503
4 -24.36644680 0.03031761
5 -51.71644680 -24.36644680
6 34.68443085 -51.71644680
7 17.00160820 34.68443085
8 38.09443085 17.00160820
9 21.93637585 38.09443085
10 -1.51797886 21.93637585
11 24.28919850 -1.51797886
12 -19.31315944 24.28919850
13 -15.50880474 -19.31315944
14 -9.20598209 -15.50880474
15 -10.18839180 -9.20598209
16 -18.08644680 -10.18839180
17 -63.90926945 -18.08644680
18 56.35790790 -63.90926945
19 44.93790790 56.35790790
20 76.76355320 44.93790790
21 30.58919850 76.76355320
22 29.23919850 30.58919850
23 14.93919850 29.23919850
24 -12.62403709 14.93919850
25 -18.60968239 -12.62403709
26 -14.24403709 -18.60968239
27 1.83073055 -14.24403709
28 -22.47080150 1.83073055
29 -65.85080150 -22.47080150
30 45.96637585 -65.85080150
31 24.05637585 45.96637585
32 57.38637585 24.05637585
33 21.37355320 57.38637585
34 15.78484379 21.37355320
35 20.88961144 15.78484379
36 -11.36321121 20.88961144
37 -32.84408886 -11.36321121
38 -27.81279827 -32.84408886
39 4.14155643 -27.81279827
40 -26.91844357 4.14155643
41 -66.38126621 -26.91844357
42 38.83155643 -66.38126621
43 33.32002438 38.83155643
44 32.85479202 33.32002438
45 44.90391437 32.85479202
46 -0.26761768 44.90391437
47 10.45043732 -0.26761768
48 -14.50756591 10.45043732
49 -30.42167916 -14.50756591
50 -18.40038856 -30.42167916
51 -5.59844357 -18.40038856
52 -49.49715297 -5.59844357
53 -74.26562092 -49.49715297
54 13.06961144 -74.26562092
55 7.97678879 13.06961144
56 20.75243409 7.97678879
57 7.93720173 20.75243409
58 -27.44803063 7.93720173
59 -8.38085327 -27.44803063
> 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/7yema1259346512.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/8op411259346512.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/91o3c1259346512.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/10z2ut1259346512.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/116nag1259346512.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/12vgv11259346512.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/13vuza1259346512.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/14kez81259346513.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/15chm21259346513.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/16xyk41259346513.tab")
+ }
>
> system("convert tmp/12yz81259346512.ps tmp/12yz81259346512.png")
> system("convert tmp/2mpuz1259346512.ps tmp/2mpuz1259346512.png")
> system("convert tmp/3t1pf1259346512.ps tmp/3t1pf1259346512.png")
> system("convert tmp/484ep1259346512.ps tmp/484ep1259346512.png")
> system("convert tmp/5hh6m1259346512.ps tmp/5hh6m1259346512.png")
> system("convert tmp/66ajp1259346512.ps tmp/66ajp1259346512.png")
> system("convert tmp/7yema1259346512.ps tmp/7yema1259346512.png")
> system("convert tmp/8op411259346512.ps tmp/8op411259346512.png")
> system("convert tmp/91o3c1259346512.ps tmp/91o3c1259346512.png")
> system("convert tmp/10z2ut1259346512.ps tmp/10z2ut1259346512.png")
>
>
> proc.time()
user system elapsed
2.493 1.604 5.074