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(2253,14.9,2218,18.6,1855,19.1,2187,18.8,1852,18.2,1570,18,1851,19,1954,20.7,1828,21.2,2251,20.7,2277,19.6,2085,18.6,2282,18.7,2266,23.8,1878,24.9,2267,24.8,2069,23.8,1746,22.3,2299,21.7,2360,20.7,2214,19.7,2825,18.4,2355,17.4,2333,17,3016,18,2155,23.8,2172,25.5,2150,25.6,2533,23.7,2058,22,2160,21.3,2260,20.7,2498,20.4,2695,20.3,2799,20.4,2946,19.8,2930,19.5,2318,23.1,2540,23.5,2570,23.5,2669,22.9,2450,21.9,2842,21.5,3440,20.5,2678,20.2,2981,19.4,2260,19.2,2844,18.8,2546,18.8,2456,22.6,2295,23.3,2379,23,2479,21.4,2057,19.9,2280,18.8,2351,18.6,2276,18.4,2548,18.6,2311,19.9,2201,19.2),dim=c(2,60),dimnames=list(c('wngbw','<25'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('wngbw','<25'),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
wngbw <25
1 2253 14.9
2 2218 18.6
3 1855 19.1
4 2187 18.8
5 1852 18.2
6 1570 18.0
7 1851 19.0
8 1954 20.7
9 1828 21.2
10 2251 20.7
11 2277 19.6
12 2085 18.6
13 2282 18.7
14 2266 23.8
15 1878 24.9
16 2267 24.8
17 2069 23.8
18 1746 22.3
19 2299 21.7
20 2360 20.7
21 2214 19.7
22 2825 18.4
23 2355 17.4
24 2333 17.0
25 3016 18.0
26 2155 23.8
27 2172 25.5
28 2150 25.6
29 2533 23.7
30 2058 22.0
31 2160 21.3
32 2260 20.7
33 2498 20.4
34 2695 20.3
35 2799 20.4
36 2946 19.8
37 2930 19.5
38 2318 23.1
39 2540 23.5
40 2570 23.5
41 2669 22.9
42 2450 21.9
43 2842 21.5
44 3440 20.5
45 2678 20.2
46 2981 19.4
47 2260 19.2
48 2844 18.8
49 2546 18.8
50 2456 22.6
51 2295 23.3
52 2379 23.0
53 2479 21.4
54 2057 19.9
55 2280 18.8
56 2351 18.6
57 2276 18.4
58 2548 18.6
59 2311 19.9
60 2201 19.2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `<25`
2613.95 -12.61
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-816.97 -171.39 -49.92 181.32 1084.56
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2613.95 412.47 6.337 3.76e-08 ***
`<25` -12.61 19.86 -0.635 0.528
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 351.5 on 58 degrees of freedom
Multiple R-squared: 0.006903, Adjusted R-squared: -0.01022
F-statistic: 0.4032 on 1 and 58 DF, p-value: 0.5279
> 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.20783982 0.415679638 0.792160181
[2,] 0.45401292 0.908025840 0.545987080
[3,] 0.34770920 0.695418401 0.652290799
[4,] 0.26319806 0.526396112 0.736801944
[5,] 0.19388224 0.387764471 0.806117765
[6,] 0.24189993 0.483799868 0.758100066
[7,] 0.24564465 0.491289294 0.754355353
[8,] 0.19439341 0.388786818 0.805606591
[9,] 0.18518182 0.370363649 0.814818175
[10,] 0.16236000 0.324719996 0.837640002
[11,] 0.14076977 0.281539533 0.859230234
[12,] 0.11756810 0.235136196 0.882431902
[13,] 0.08336471 0.166729427 0.916635287
[14,] 0.13475319 0.269506385 0.865246807
[15,] 0.12478779 0.249575588 0.875212206
[16,] 0.12611356 0.252227130 0.873886435
[17,] 0.10776166 0.215523323 0.892238338
[18,] 0.34204505 0.684090106 0.657954947
[19,] 0.31468524 0.629370486 0.685314757
[20,] 0.29178700 0.583574008 0.708212996
[21,] 0.60756279 0.784874421 0.392437210
[22,] 0.55443880 0.891122396 0.445561198
[23,] 0.49744736 0.994894721 0.502552639
[24,] 0.44820652 0.896413050 0.551793475
[25,] 0.44607912 0.892158245 0.553920878
[26,] 0.45037206 0.900744115 0.549627943
[27,] 0.43118631 0.862372610 0.568813695
[28,] 0.39494230 0.789884607 0.605057697
[29,] 0.36169664 0.723393285 0.638303358
[30,] 0.38501564 0.770031271 0.614984365
[31,] 0.44969268 0.899385351 0.550307325
[32,] 0.59150380 0.816992405 0.408496202
[33,] 0.69695709 0.606085816 0.303042908
[34,] 0.64831495 0.703370101 0.351685050
[35,] 0.59506527 0.809869466 0.404934733
[36,] 0.53991512 0.920169758 0.460084879
[37,] 0.50262117 0.994757664 0.497378832
[38,] 0.42765881 0.855317612 0.572341194
[39,] 0.45892908 0.917858170 0.541070915
[40,] 0.95968113 0.080637740 0.040318870
[41,] 0.95409022 0.091819559 0.045909780
[42,] 0.99298679 0.014026421 0.007013211
[43,] 0.98752153 0.024956941 0.012478471
[44,] 0.99851537 0.002969269 0.001484635
[45,] 0.99844666 0.003106688 0.001553344
[46,] 0.99649819 0.007003613 0.003501807
[47,] 0.99087510 0.018249793 0.009124896
[48,] 0.97634046 0.047319089 0.023659544
[49,] 0.98511373 0.029772541 0.014886270
[50,] 0.97560019 0.048799610 0.024399805
[51,] 0.92882769 0.142344625 0.071172312
> postscript(file="/var/www/html/rcomp/tmp/11im31258733380.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/2azhw1258733380.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/3ev2e1258733380.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/40gwy1258733380.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/5kgoy1258733380.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
-173.057683 -161.400093 -518.095013 -189.878061 -532.444157 -816.966189
7 8 9 10 11 12
-523.356029 -398.918758 -518.613678 -101.918758 -89.789933 -294.400093
13 14 15 16 17 18
-96.139077 -47.827263 -421.956087 -34.217103 -244.827263 -586.742502
19 20 21 22 23 24
-41.308598 7.081242 -151.528917 443.077875 -39.532284 -66.576348
25 26 27 28 29 30
629.033811 -158.827263 -120.389992 -141.128976 217.911721 -278.525550
31 32 33 34 35 36
-185.352662 -92.918758 141.298194 337.037179 442.298194 581.732099
37 38 39 40 41 42
561.949051 -4.654375 222.389689 252.389689 343.823594 112.213434
43 44 45 46 47 48
499.169370 1084.559210 318.776163 611.688035 -111.833997 467.121939
49 50 51 52 53 54
169.121939 127.040546 -25.132343 55.084609 134.908354 -306.006885
55 56 57 58 59 60
-96.878061 -28.400093 -105.922125 168.599907 -52.006885 -170.833997
> postscript(file="/var/www/html/rcomp/tmp/6t6ke1258733380.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 -173.057683 NA
1 -161.400093 -173.057683
2 -518.095013 -161.400093
3 -189.878061 -518.095013
4 -532.444157 -189.878061
5 -816.966189 -532.444157
6 -523.356029 -816.966189
7 -398.918758 -523.356029
8 -518.613678 -398.918758
9 -101.918758 -518.613678
10 -89.789933 -101.918758
11 -294.400093 -89.789933
12 -96.139077 -294.400093
13 -47.827263 -96.139077
14 -421.956087 -47.827263
15 -34.217103 -421.956087
16 -244.827263 -34.217103
17 -586.742502 -244.827263
18 -41.308598 -586.742502
19 7.081242 -41.308598
20 -151.528917 7.081242
21 443.077875 -151.528917
22 -39.532284 443.077875
23 -66.576348 -39.532284
24 629.033811 -66.576348
25 -158.827263 629.033811
26 -120.389992 -158.827263
27 -141.128976 -120.389992
28 217.911721 -141.128976
29 -278.525550 217.911721
30 -185.352662 -278.525550
31 -92.918758 -185.352662
32 141.298194 -92.918758
33 337.037179 141.298194
34 442.298194 337.037179
35 581.732099 442.298194
36 561.949051 581.732099
37 -4.654375 561.949051
38 222.389689 -4.654375
39 252.389689 222.389689
40 343.823594 252.389689
41 112.213434 343.823594
42 499.169370 112.213434
43 1084.559210 499.169370
44 318.776163 1084.559210
45 611.688035 318.776163
46 -111.833997 611.688035
47 467.121939 -111.833997
48 169.121939 467.121939
49 127.040546 169.121939
50 -25.132343 127.040546
51 55.084609 -25.132343
52 134.908354 55.084609
53 -306.006885 134.908354
54 -96.878061 -306.006885
55 -28.400093 -96.878061
56 -105.922125 -28.400093
57 168.599907 -105.922125
58 -52.006885 168.599907
59 -170.833997 -52.006885
60 NA -170.833997
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -161.400093 -173.057683
[2,] -518.095013 -161.400093
[3,] -189.878061 -518.095013
[4,] -532.444157 -189.878061
[5,] -816.966189 -532.444157
[6,] -523.356029 -816.966189
[7,] -398.918758 -523.356029
[8,] -518.613678 -398.918758
[9,] -101.918758 -518.613678
[10,] -89.789933 -101.918758
[11,] -294.400093 -89.789933
[12,] -96.139077 -294.400093
[13,] -47.827263 -96.139077
[14,] -421.956087 -47.827263
[15,] -34.217103 -421.956087
[16,] -244.827263 -34.217103
[17,] -586.742502 -244.827263
[18,] -41.308598 -586.742502
[19,] 7.081242 -41.308598
[20,] -151.528917 7.081242
[21,] 443.077875 -151.528917
[22,] -39.532284 443.077875
[23,] -66.576348 -39.532284
[24,] 629.033811 -66.576348
[25,] -158.827263 629.033811
[26,] -120.389992 -158.827263
[27,] -141.128976 -120.389992
[28,] 217.911721 -141.128976
[29,] -278.525550 217.911721
[30,] -185.352662 -278.525550
[31,] -92.918758 -185.352662
[32,] 141.298194 -92.918758
[33,] 337.037179 141.298194
[34,] 442.298194 337.037179
[35,] 581.732099 442.298194
[36,] 561.949051 581.732099
[37,] -4.654375 561.949051
[38,] 222.389689 -4.654375
[39,] 252.389689 222.389689
[40,] 343.823594 252.389689
[41,] 112.213434 343.823594
[42,] 499.169370 112.213434
[43,] 1084.559210 499.169370
[44,] 318.776163 1084.559210
[45,] 611.688035 318.776163
[46,] -111.833997 611.688035
[47,] 467.121939 -111.833997
[48,] 169.121939 467.121939
[49,] 127.040546 169.121939
[50,] -25.132343 127.040546
[51,] 55.084609 -25.132343
[52,] 134.908354 55.084609
[53,] -306.006885 134.908354
[54,] -96.878061 -306.006885
[55,] -28.400093 -96.878061
[56,] -105.922125 -28.400093
[57,] 168.599907 -105.922125
[58,] -52.006885 168.599907
[59,] -170.833997 -52.006885
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -161.400093 -173.057683
2 -518.095013 -161.400093
3 -189.878061 -518.095013
4 -532.444157 -189.878061
5 -816.966189 -532.444157
6 -523.356029 -816.966189
7 -398.918758 -523.356029
8 -518.613678 -398.918758
9 -101.918758 -518.613678
10 -89.789933 -101.918758
11 -294.400093 -89.789933
12 -96.139077 -294.400093
13 -47.827263 -96.139077
14 -421.956087 -47.827263
15 -34.217103 -421.956087
16 -244.827263 -34.217103
17 -586.742502 -244.827263
18 -41.308598 -586.742502
19 7.081242 -41.308598
20 -151.528917 7.081242
21 443.077875 -151.528917
22 -39.532284 443.077875
23 -66.576348 -39.532284
24 629.033811 -66.576348
25 -158.827263 629.033811
26 -120.389992 -158.827263
27 -141.128976 -120.389992
28 217.911721 -141.128976
29 -278.525550 217.911721
30 -185.352662 -278.525550
31 -92.918758 -185.352662
32 141.298194 -92.918758
33 337.037179 141.298194
34 442.298194 337.037179
35 581.732099 442.298194
36 561.949051 581.732099
37 -4.654375 561.949051
38 222.389689 -4.654375
39 252.389689 222.389689
40 343.823594 252.389689
41 112.213434 343.823594
42 499.169370 112.213434
43 1084.559210 499.169370
44 318.776163 1084.559210
45 611.688035 318.776163
46 -111.833997 611.688035
47 467.121939 -111.833997
48 169.121939 467.121939
49 127.040546 169.121939
50 -25.132343 127.040546
51 55.084609 -25.132343
52 134.908354 55.084609
53 -306.006885 134.908354
54 -96.878061 -306.006885
55 -28.400093 -96.878061
56 -105.922125 -28.400093
57 168.599907 -105.922125
58 -52.006885 168.599907
59 -170.833997 -52.006885
> 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/7mbzs1258733380.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/8b5bk1258733380.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/93iss1258733380.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/10jlqf1258733380.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/117mfk1258733380.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/125b391258733380.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/13xlcy1258733380.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/14szdx1258733380.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/15i19c1258733380.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/16h1ap1258733381.tab")
+ }
> system("convert tmp/11im31258733380.ps tmp/11im31258733380.png")
> system("convert tmp/2azhw1258733380.ps tmp/2azhw1258733380.png")
> system("convert tmp/3ev2e1258733380.ps tmp/3ev2e1258733380.png")
> system("convert tmp/40gwy1258733380.ps tmp/40gwy1258733380.png")
> system("convert tmp/5kgoy1258733380.ps tmp/5kgoy1258733380.png")
> system("convert tmp/6t6ke1258733380.ps tmp/6t6ke1258733380.png")
> system("convert tmp/7mbzs1258733380.ps tmp/7mbzs1258733380.png")
> system("convert tmp/8b5bk1258733380.ps tmp/8b5bk1258733380.png")
> system("convert tmp/93iss1258733380.ps tmp/93iss1258733380.png")
> system("convert tmp/10jlqf1258733380.ps tmp/10jlqf1258733380.png")
>
>
> proc.time()
user system elapsed
2.568 1.622 5.915