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(280,1258,557,1199,831,1158,1081,1427,1318,934,1578,709,1859,1186,2141,986,2428,1033,2715,1257,3004,1105,3309,1179,269,1092,537,1092,813,1087,1068,2028,1411,2039,1675,2010,1958,754,2242,760,2524,715,2836,855,3143,971,3522,815,285,915,574,843,865,761,1147,1858,1516,2968,1789,4061,2087,3661,2372,3269,2669,2857,2966,2568,3270,2274,3652,1987,329,683,658,381,988,71,1303,1772,1603,3485,1929,5181,2235,4479,2544,3782,2872,3067,3198,2489,3544,1903,3903,1330,332,736,665,483,1001,242,1329,1334,1639,2423,1975,3523,2304,2986,2640,2462,2992,1908,3330,1575,3690,1237,4063,904),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 280 1258
2 557 1199
3 831 1158
4 1081 1427
5 1318 934
6 1578 709
7 1859 1186
8 2141 986
9 2428 1033
10 2715 1257
11 3004 1105
12 3309 1179
13 269 1092
14 537 1092
15 813 1087
16 1068 2028
17 1411 2039
18 1675 2010
19 1958 754
20 2242 760
21 2524 715
22 2836 855
23 3143 971
24 3522 815
25 285 915
26 574 843
27 865 761
28 1147 1858
29 1516 2968
30 1789 4061
31 2087 3661
32 2372 3269
33 2669 2857
34 2966 2568
35 3270 2274
36 3652 1987
37 329 683
38 658 381
39 988 71
40 1303 1772
41 1603 3485
42 1929 5181
43 2235 4479
44 2544 3782
45 2872 3067
46 3198 2489
47 3544 1903
48 3903 1330
49 332 736
50 665 483
51 1001 242
52 1329 1334
53 1639 2423
54 1975 3523
55 2304 2986
56 2640 2462
57 2992 1908
58 3330 1575
59 3690 1237
60 4063 904
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
1574.6126 0.2198
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1571.1 -814.4 -308.1 836.3 2289.7
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1574.6126 250.3629 6.289 4.52e-08 ***
X 0.2198 0.1211 1.815 0.0747 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1055 on 58 degrees of freedom
Multiple R-squared: 0.05376, Adjusted R-squared: 0.03744
F-statistic: 3.295 on 1 and 58 DF, p-value: 0.07466
> 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.09037906 1.807581e-01 9.096209e-01
[2,] 0.03438026 6.876052e-02 9.656197e-01
[3,] 0.06913221 1.382644e-01 9.308678e-01
[4,] 0.07468457 1.493691e-01 9.253154e-01
[5,] 0.10242715 2.048543e-01 8.975728e-01
[6,] 0.21329904 4.265981e-01 7.867010e-01
[7,] 0.30690926 6.138185e-01 6.930907e-01
[8,] 0.45390657 9.078131e-01 5.460934e-01
[9,] 0.54017651 9.196470e-01 4.598235e-01
[10,] 0.55116100 8.976780e-01 4.488390e-01
[11,] 0.51550239 9.689952e-01 4.844976e-01
[12,] 0.44612560 8.922512e-01 5.538744e-01
[13,] 0.37456723 7.491345e-01 6.254328e-01
[14,] 0.30761500 6.152300e-01 6.923850e-01
[15,] 0.24176170 4.835234e-01 7.582383e-01
[16,] 0.19490501 3.898100e-01 8.050950e-01
[17,] 0.16698693 3.339739e-01 8.330131e-01
[18,] 0.16634613 3.326923e-01 8.336539e-01
[19,] 0.20114425 4.022885e-01 7.988557e-01
[20,] 0.28690407 5.738081e-01 7.130959e-01
[21,] 0.38353276 7.670655e-01 6.164672e-01
[22,] 0.42401186 8.480237e-01 5.759881e-01
[23,] 0.41879182 8.375836e-01 5.812082e-01
[24,] 0.37397718 7.479544e-01 6.260228e-01
[25,] 0.33714647 6.742929e-01 6.628535e-01
[26,] 0.30761194 6.152239e-01 6.923881e-01
[27,] 0.26319486 5.263897e-01 7.368051e-01
[28,] 0.22004408 4.400882e-01 7.799559e-01
[29,] 0.18882608 3.776522e-01 8.111739e-01
[30,] 0.17645274 3.529055e-01 8.235473e-01
[31,] 0.19146475 3.829295e-01 8.085353e-01
[32,] 0.26436093 5.287219e-01 7.356391e-01
[33,] 0.31962092 6.392418e-01 6.803791e-01
[34,] 0.33140237 6.628047e-01 6.685976e-01
[35,] 0.31338070 6.267614e-01 6.866193e-01
[36,] 0.29090333 5.818067e-01 7.090967e-01
[37,] 0.25973246 5.194649e-01 7.402675e-01
[38,] 0.22664860 4.532972e-01 7.733514e-01
[39,] 0.18450245 3.690049e-01 8.154976e-01
[40,] 0.14035855 2.807171e-01 8.596414e-01
[41,] 0.10474226 2.094845e-01 8.952577e-01
[42,] 0.08841933 1.768387e-01 9.115807e-01
[43,] 0.10235909 2.047182e-01 8.976409e-01
[44,] 0.18837209 3.767442e-01 8.116279e-01
[45,] 0.27047517 5.409503e-01 7.295248e-01
[46,] 0.37688182 7.537636e-01 6.231182e-01
[47,] 0.69858193 6.028361e-01 3.014181e-01
[48,] 0.98184757 3.630486e-02 1.815243e-02
[49,] 0.99995092 9.815523e-05 4.907761e-05
[50,] 0.99979872 4.025676e-04 2.012838e-04
[51,] 0.99925704 1.485924e-03 7.429620e-04
> postscript(file="/var/www/html/rcomp/tmp/115e01258722531.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/2f6tc1258722531.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/3dz1n1258722531.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/4ejws1258722531.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/5huc01258722531.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
-1571.09111 -1281.12431 -998.11349 -807.23329 -461.88361 -152.43397
7 8 9 10 11 12
23.73278 349.68802 626.35854 864.12867 1186.53465 1475.27121
13 14 15 16 17 18
-1545.60826 -1277.60826 -1000.50937 -952.31879 -611.73633 -341.36282
19 20 21 22 23 24
217.67610 500.35745 792.24738 1073.47871 1354.98467 1768.26975
25 26 27 28 29 30
-1490.70787 -1185.88398 -876.86233 -835.95683 -710.90843 -678.12383
31 32 33 34 35 36
-292.21334 78.93893 466.48673 827.00206 1195.61626 1640.69204
37 38 39 40 41 42
-1395.71979 -1000.34737 -602.21674 -661.05608 -737.53273 -784.27318
43 44 45 46 47 48
-323.99028 138.19374 623.33373 1076.36438 1551.15324 2036.08501
49 50 51 52 53 54
-1404.36792 -1015.76454 -626.79848 -538.79410 -468.13039 -373.88423
55 56 57 58 59 60
73.13560 524.29833 998.05436 1409.23983 1843.52419 2289.70967
> postscript(file="/var/www/html/rcomp/tmp/6ka6p1258722531.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 -1571.09111 NA
1 -1281.12431 -1571.09111
2 -998.11349 -1281.12431
3 -807.23329 -998.11349
4 -461.88361 -807.23329
5 -152.43397 -461.88361
6 23.73278 -152.43397
7 349.68802 23.73278
8 626.35854 349.68802
9 864.12867 626.35854
10 1186.53465 864.12867
11 1475.27121 1186.53465
12 -1545.60826 1475.27121
13 -1277.60826 -1545.60826
14 -1000.50937 -1277.60826
15 -952.31879 -1000.50937
16 -611.73633 -952.31879
17 -341.36282 -611.73633
18 217.67610 -341.36282
19 500.35745 217.67610
20 792.24738 500.35745
21 1073.47871 792.24738
22 1354.98467 1073.47871
23 1768.26975 1354.98467
24 -1490.70787 1768.26975
25 -1185.88398 -1490.70787
26 -876.86233 -1185.88398
27 -835.95683 -876.86233
28 -710.90843 -835.95683
29 -678.12383 -710.90843
30 -292.21334 -678.12383
31 78.93893 -292.21334
32 466.48673 78.93893
33 827.00206 466.48673
34 1195.61626 827.00206
35 1640.69204 1195.61626
36 -1395.71979 1640.69204
37 -1000.34737 -1395.71979
38 -602.21674 -1000.34737
39 -661.05608 -602.21674
40 -737.53273 -661.05608
41 -784.27318 -737.53273
42 -323.99028 -784.27318
43 138.19374 -323.99028
44 623.33373 138.19374
45 1076.36438 623.33373
46 1551.15324 1076.36438
47 2036.08501 1551.15324
48 -1404.36792 2036.08501
49 -1015.76454 -1404.36792
50 -626.79848 -1015.76454
51 -538.79410 -626.79848
52 -468.13039 -538.79410
53 -373.88423 -468.13039
54 73.13560 -373.88423
55 524.29833 73.13560
56 998.05436 524.29833
57 1409.23983 998.05436
58 1843.52419 1409.23983
59 2289.70967 1843.52419
60 NA 2289.70967
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1281.12431 -1571.09111
[2,] -998.11349 -1281.12431
[3,] -807.23329 -998.11349
[4,] -461.88361 -807.23329
[5,] -152.43397 -461.88361
[6,] 23.73278 -152.43397
[7,] 349.68802 23.73278
[8,] 626.35854 349.68802
[9,] 864.12867 626.35854
[10,] 1186.53465 864.12867
[11,] 1475.27121 1186.53465
[12,] -1545.60826 1475.27121
[13,] -1277.60826 -1545.60826
[14,] -1000.50937 -1277.60826
[15,] -952.31879 -1000.50937
[16,] -611.73633 -952.31879
[17,] -341.36282 -611.73633
[18,] 217.67610 -341.36282
[19,] 500.35745 217.67610
[20,] 792.24738 500.35745
[21,] 1073.47871 792.24738
[22,] 1354.98467 1073.47871
[23,] 1768.26975 1354.98467
[24,] -1490.70787 1768.26975
[25,] -1185.88398 -1490.70787
[26,] -876.86233 -1185.88398
[27,] -835.95683 -876.86233
[28,] -710.90843 -835.95683
[29,] -678.12383 -710.90843
[30,] -292.21334 -678.12383
[31,] 78.93893 -292.21334
[32,] 466.48673 78.93893
[33,] 827.00206 466.48673
[34,] 1195.61626 827.00206
[35,] 1640.69204 1195.61626
[36,] -1395.71979 1640.69204
[37,] -1000.34737 -1395.71979
[38,] -602.21674 -1000.34737
[39,] -661.05608 -602.21674
[40,] -737.53273 -661.05608
[41,] -784.27318 -737.53273
[42,] -323.99028 -784.27318
[43,] 138.19374 -323.99028
[44,] 623.33373 138.19374
[45,] 1076.36438 623.33373
[46,] 1551.15324 1076.36438
[47,] 2036.08501 1551.15324
[48,] -1404.36792 2036.08501
[49,] -1015.76454 -1404.36792
[50,] -626.79848 -1015.76454
[51,] -538.79410 -626.79848
[52,] -468.13039 -538.79410
[53,] -373.88423 -468.13039
[54,] 73.13560 -373.88423
[55,] 524.29833 73.13560
[56,] 998.05436 524.29833
[57,] 1409.23983 998.05436
[58,] 1843.52419 1409.23983
[59,] 2289.70967 1843.52419
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1281.12431 -1571.09111
2 -998.11349 -1281.12431
3 -807.23329 -998.11349
4 -461.88361 -807.23329
5 -152.43397 -461.88361
6 23.73278 -152.43397
7 349.68802 23.73278
8 626.35854 349.68802
9 864.12867 626.35854
10 1186.53465 864.12867
11 1475.27121 1186.53465
12 -1545.60826 1475.27121
13 -1277.60826 -1545.60826
14 -1000.50937 -1277.60826
15 -952.31879 -1000.50937
16 -611.73633 -952.31879
17 -341.36282 -611.73633
18 217.67610 -341.36282
19 500.35745 217.67610
20 792.24738 500.35745
21 1073.47871 792.24738
22 1354.98467 1073.47871
23 1768.26975 1354.98467
24 -1490.70787 1768.26975
25 -1185.88398 -1490.70787
26 -876.86233 -1185.88398
27 -835.95683 -876.86233
28 -710.90843 -835.95683
29 -678.12383 -710.90843
30 -292.21334 -678.12383
31 78.93893 -292.21334
32 466.48673 78.93893
33 827.00206 466.48673
34 1195.61626 827.00206
35 1640.69204 1195.61626
36 -1395.71979 1640.69204
37 -1000.34737 -1395.71979
38 -602.21674 -1000.34737
39 -661.05608 -602.21674
40 -737.53273 -661.05608
41 -784.27318 -737.53273
42 -323.99028 -784.27318
43 138.19374 -323.99028
44 623.33373 138.19374
45 1076.36438 623.33373
46 1551.15324 1076.36438
47 2036.08501 1551.15324
48 -1404.36792 2036.08501
49 -1015.76454 -1404.36792
50 -626.79848 -1015.76454
51 -538.79410 -626.79848
52 -468.13039 -538.79410
53 -373.88423 -468.13039
54 73.13560 -373.88423
55 524.29833 73.13560
56 998.05436 524.29833
57 1409.23983 998.05436
58 1843.52419 1409.23983
59 2289.70967 1843.52419
> 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/7ftiu1258722531.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/888g11258722531.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/9442p1258722531.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/10dtza1258722531.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/11rjbr1258722531.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/127ns01258722531.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/13xcei1258722531.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/140x391258722531.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/153n8g1258722531.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/164b2n1258722531.tab")
+ }
>
> system("convert tmp/115e01258722531.ps tmp/115e01258722531.png")
> system("convert tmp/2f6tc1258722531.ps tmp/2f6tc1258722531.png")
> system("convert tmp/3dz1n1258722531.ps tmp/3dz1n1258722531.png")
> system("convert tmp/4ejws1258722531.ps tmp/4ejws1258722531.png")
> system("convert tmp/5huc01258722531.ps tmp/5huc01258722531.png")
> system("convert tmp/6ka6p1258722531.ps tmp/6ka6p1258722531.png")
> system("convert tmp/7ftiu1258722531.ps tmp/7ftiu1258722531.png")
> system("convert tmp/888g11258722531.ps tmp/888g11258722531.png")
> system("convert tmp/9442p1258722531.ps tmp/9442p1258722531.png")
> system("convert tmp/10dtza1258722531.ps tmp/10dtza1258722531.png")
>
>
> proc.time()
user system elapsed
2.492 1.585 3.306