R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(147768,0,137507,0,136919,0,136151,0,133001,0,125554,0,119647,0,114158,0,116193,0,152803,0,161761,0,160942,0,149470,0,139208,0,134588,0,130322,0,126611,0,122401,0,117352,0,112135,0,112879,0,148729,0,157230,0,157221,0,146681,0,136524,0,132111,1,125326,1,122716,1,116615,1,113719,1,110737,1,112093,1,143565,1,149946,1,149147,1,134339,1,122683,1,115614,1,116566,1,111272,1,104609,1,101802,1,94542,1,93051,1,124129,1,130374,1,123946,1,114971,1,105531,1,104919,0,104782,0,101281,0,94545,0,93248,0,84031,0,87486,0,115867,0,120327,0,117008,0,108811,0),dim=c(2,61),dimnames=list(c('jonger_dan_25','plan'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('jonger_dan_25','plan'),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
jonger_dan_25 plan
1 147768 0
2 137507 0
3 136919 0
4 136151 0
5 133001 0
6 125554 0
7 119647 0
8 114158 0
9 116193 0
10 152803 0
11 161761 0
12 160942 0
13 149470 0
14 139208 0
15 134588 0
16 130322 0
17 126611 0
18 122401 0
19 117352 0
20 112135 0
21 112879 0
22 148729 0
23 157230 0
24 157221 0
25 146681 0
26 136524 0
27 132111 1
28 125326 1
29 122716 1
30 116615 1
31 113719 1
32 110737 1
33 112093 1
34 143565 1
35 149946 1
36 149147 1
37 134339 1
38 122683 1
39 115614 1
40 116566 1
41 111272 1
42 104609 1
43 101802 1
44 94542 1
45 93051 1
46 124129 1
47 130374 1
48 123946 1
49 114971 1
50 105531 1
51 104919 0
52 104782 0
53 101281 0
54 94545 0
55 93248 0
56 84031 0
57 87486 0
58 115867 0
59 120327 0
60 117008 0
61 108811 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) plan
126110 -6551
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-42079 -11952 -2944 11397 35651
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 126110 3123 40.385 <2e-16 ***
plan -6551 4978 -1.316 0.193
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 18990 on 59 degrees of freedom
Multiple R-squared: 0.02851, Adjusted R-squared: 0.01205
F-statistic: 1.732 on 1 and 59 DF, p-value: 0.1933
> 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.04650185 0.09300369 0.95349815
[2,] 0.04693978 0.09387956 0.95306022
[3,] 0.06346864 0.12693729 0.93653136
[4,] 0.09323566 0.18647131 0.90676434
[5,] 0.08312236 0.16624471 0.91687764
[6,] 0.13645850 0.27291701 0.86354150
[7,] 0.29055857 0.58111714 0.70944143
[8,] 0.41866345 0.83732690 0.58133655
[9,] 0.39856748 0.79713496 0.60143252
[10,] 0.32703998 0.65407996 0.67296002
[11,] 0.25972323 0.51944646 0.74027677
[12,] 0.20575796 0.41151591 0.79424204
[13,] 0.16691197 0.33382394 0.83308803
[14,] 0.14404530 0.28809060 0.85595470
[15,] 0.13946054 0.27892108 0.86053946
[16,] 0.15492495 0.30984991 0.84507505
[17,] 0.15706361 0.31412722 0.84293639
[18,] 0.18077570 0.36155141 0.81922430
[19,] 0.31298900 0.62597801 0.68701100
[20,] 0.52579711 0.94840578 0.47420289
[21,] 0.65243995 0.69512010 0.34756005
[22,] 0.71636858 0.56726284 0.28363142
[23,] 0.67197593 0.65604814 0.32802407
[24,] 0.61071353 0.77857295 0.38928647
[25,] 0.54292427 0.91415145 0.45707573
[26,] 0.48082987 0.96165973 0.51917013
[27,] 0.42433144 0.84866288 0.57566856
[28,] 0.37917167 0.75834333 0.62082833
[29,] 0.32564300 0.65128599 0.67435700
[30,] 0.42997144 0.85994288 0.57002856
[31,] 0.65828939 0.68342122 0.34171061
[32,] 0.86338392 0.27323215 0.13661608
[33,] 0.89338567 0.21322866 0.10661433
[34,] 0.87404657 0.25190686 0.12595343
[35,] 0.84076302 0.31847396 0.15923698
[36,] 0.80158911 0.39682177 0.19841089
[37,] 0.75687897 0.48624206 0.24312103
[38,] 0.73171165 0.53657671 0.26828835
[39,] 0.72364338 0.55271323 0.27635662
[40,] 0.80293733 0.39412533 0.19706267
[41,] 0.91152963 0.17694075 0.08847037
[42,] 0.87298411 0.25403177 0.12701589
[43,] 0.86805792 0.26388415 0.13194208
[44,] 0.84461118 0.31077764 0.15538882
[45,] 0.79090396 0.41819208 0.20909604
[46,] 0.71563483 0.56873033 0.28436517
[47,] 0.66511142 0.66977716 0.33488858
[48,] 0.59744690 0.80510620 0.40255310
[49,] 0.52039452 0.95921097 0.47960548
[50,] 0.47325395 0.94650790 0.52674605
[51,] 0.42739130 0.85478260 0.57260870
[52,] 0.58071215 0.83857571 0.41928785
> postscript(file="/var/www/html/rcomp/tmp/1nryl1229507676.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/22djh1229507676.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/3oruj1229507676.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/4jws21229507676.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/5q7hj1229507676.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
21658.2703 11397.2703 10809.2703 10041.2703 6891.2703 -555.7297
7 8 9 10 11 12
-6462.7297 -11951.7297 -9916.7297 26693.2703 35651.2703 34832.2703
13 14 15 16 17 18
23360.2703 13098.2703 8478.2703 4212.2703 501.2703 -3708.7297
19 20 21 22 23 24
-8757.7297 -13974.7297 -13230.7297 22619.2703 31120.2703 31111.2703
25 26 27 28 29 30
20571.2703 10414.2703 12552.5000 5767.5000 3157.5000 -2943.5000
31 32 33 34 35 36
-5839.5000 -8821.5000 -7465.5000 24006.5000 30387.5000 29588.5000
37 38 39 40 41 42
14780.5000 3124.5000 -3944.5000 -2992.5000 -8286.5000 -14949.5000
43 44 45 46 47 48
-17756.5000 -25016.5000 -26507.5000 4570.5000 10815.5000 4387.5000
49 50 51 52 53 54
-4587.5000 -14027.5000 -21190.7297 -21327.7297 -24828.7297 -31564.7297
55 56 57 58 59 60
-32861.7297 -42078.7297 -38623.7297 -10242.7297 -5782.7297 -9101.7297
61
-17298.7297
> postscript(file="/var/www/html/rcomp/tmp/661sx1229507676.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 21658.2703 NA
1 11397.2703 21658.2703
2 10809.2703 11397.2703
3 10041.2703 10809.2703
4 6891.2703 10041.2703
5 -555.7297 6891.2703
6 -6462.7297 -555.7297
7 -11951.7297 -6462.7297
8 -9916.7297 -11951.7297
9 26693.2703 -9916.7297
10 35651.2703 26693.2703
11 34832.2703 35651.2703
12 23360.2703 34832.2703
13 13098.2703 23360.2703
14 8478.2703 13098.2703
15 4212.2703 8478.2703
16 501.2703 4212.2703
17 -3708.7297 501.2703
18 -8757.7297 -3708.7297
19 -13974.7297 -8757.7297
20 -13230.7297 -13974.7297
21 22619.2703 -13230.7297
22 31120.2703 22619.2703
23 31111.2703 31120.2703
24 20571.2703 31111.2703
25 10414.2703 20571.2703
26 12552.5000 10414.2703
27 5767.5000 12552.5000
28 3157.5000 5767.5000
29 -2943.5000 3157.5000
30 -5839.5000 -2943.5000
31 -8821.5000 -5839.5000
32 -7465.5000 -8821.5000
33 24006.5000 -7465.5000
34 30387.5000 24006.5000
35 29588.5000 30387.5000
36 14780.5000 29588.5000
37 3124.5000 14780.5000
38 -3944.5000 3124.5000
39 -2992.5000 -3944.5000
40 -8286.5000 -2992.5000
41 -14949.5000 -8286.5000
42 -17756.5000 -14949.5000
43 -25016.5000 -17756.5000
44 -26507.5000 -25016.5000
45 4570.5000 -26507.5000
46 10815.5000 4570.5000
47 4387.5000 10815.5000
48 -4587.5000 4387.5000
49 -14027.5000 -4587.5000
50 -21190.7297 -14027.5000
51 -21327.7297 -21190.7297
52 -24828.7297 -21327.7297
53 -31564.7297 -24828.7297
54 -32861.7297 -31564.7297
55 -42078.7297 -32861.7297
56 -38623.7297 -42078.7297
57 -10242.7297 -38623.7297
58 -5782.7297 -10242.7297
59 -9101.7297 -5782.7297
60 -17298.7297 -9101.7297
61 NA -17298.7297
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 11397.2703 21658.2703
[2,] 10809.2703 11397.2703
[3,] 10041.2703 10809.2703
[4,] 6891.2703 10041.2703
[5,] -555.7297 6891.2703
[6,] -6462.7297 -555.7297
[7,] -11951.7297 -6462.7297
[8,] -9916.7297 -11951.7297
[9,] 26693.2703 -9916.7297
[10,] 35651.2703 26693.2703
[11,] 34832.2703 35651.2703
[12,] 23360.2703 34832.2703
[13,] 13098.2703 23360.2703
[14,] 8478.2703 13098.2703
[15,] 4212.2703 8478.2703
[16,] 501.2703 4212.2703
[17,] -3708.7297 501.2703
[18,] -8757.7297 -3708.7297
[19,] -13974.7297 -8757.7297
[20,] -13230.7297 -13974.7297
[21,] 22619.2703 -13230.7297
[22,] 31120.2703 22619.2703
[23,] 31111.2703 31120.2703
[24,] 20571.2703 31111.2703
[25,] 10414.2703 20571.2703
[26,] 12552.5000 10414.2703
[27,] 5767.5000 12552.5000
[28,] 3157.5000 5767.5000
[29,] -2943.5000 3157.5000
[30,] -5839.5000 -2943.5000
[31,] -8821.5000 -5839.5000
[32,] -7465.5000 -8821.5000
[33,] 24006.5000 -7465.5000
[34,] 30387.5000 24006.5000
[35,] 29588.5000 30387.5000
[36,] 14780.5000 29588.5000
[37,] 3124.5000 14780.5000
[38,] -3944.5000 3124.5000
[39,] -2992.5000 -3944.5000
[40,] -8286.5000 -2992.5000
[41,] -14949.5000 -8286.5000
[42,] -17756.5000 -14949.5000
[43,] -25016.5000 -17756.5000
[44,] -26507.5000 -25016.5000
[45,] 4570.5000 -26507.5000
[46,] 10815.5000 4570.5000
[47,] 4387.5000 10815.5000
[48,] -4587.5000 4387.5000
[49,] -14027.5000 -4587.5000
[50,] -21190.7297 -14027.5000
[51,] -21327.7297 -21190.7297
[52,] -24828.7297 -21327.7297
[53,] -31564.7297 -24828.7297
[54,] -32861.7297 -31564.7297
[55,] -42078.7297 -32861.7297
[56,] -38623.7297 -42078.7297
[57,] -10242.7297 -38623.7297
[58,] -5782.7297 -10242.7297
[59,] -9101.7297 -5782.7297
[60,] -17298.7297 -9101.7297
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 11397.2703 21658.2703
2 10809.2703 11397.2703
3 10041.2703 10809.2703
4 6891.2703 10041.2703
5 -555.7297 6891.2703
6 -6462.7297 -555.7297
7 -11951.7297 -6462.7297
8 -9916.7297 -11951.7297
9 26693.2703 -9916.7297
10 35651.2703 26693.2703
11 34832.2703 35651.2703
12 23360.2703 34832.2703
13 13098.2703 23360.2703
14 8478.2703 13098.2703
15 4212.2703 8478.2703
16 501.2703 4212.2703
17 -3708.7297 501.2703
18 -8757.7297 -3708.7297
19 -13974.7297 -8757.7297
20 -13230.7297 -13974.7297
21 22619.2703 -13230.7297
22 31120.2703 22619.2703
23 31111.2703 31120.2703
24 20571.2703 31111.2703
25 10414.2703 20571.2703
26 12552.5000 10414.2703
27 5767.5000 12552.5000
28 3157.5000 5767.5000
29 -2943.5000 3157.5000
30 -5839.5000 -2943.5000
31 -8821.5000 -5839.5000
32 -7465.5000 -8821.5000
33 24006.5000 -7465.5000
34 30387.5000 24006.5000
35 29588.5000 30387.5000
36 14780.5000 29588.5000
37 3124.5000 14780.5000
38 -3944.5000 3124.5000
39 -2992.5000 -3944.5000
40 -8286.5000 -2992.5000
41 -14949.5000 -8286.5000
42 -17756.5000 -14949.5000
43 -25016.5000 -17756.5000
44 -26507.5000 -25016.5000
45 4570.5000 -26507.5000
46 10815.5000 4570.5000
47 4387.5000 10815.5000
48 -4587.5000 4387.5000
49 -14027.5000 -4587.5000
50 -21190.7297 -14027.5000
51 -21327.7297 -21190.7297
52 -24828.7297 -21327.7297
53 -31564.7297 -24828.7297
54 -32861.7297 -31564.7297
55 -42078.7297 -32861.7297
56 -38623.7297 -42078.7297
57 -10242.7297 -38623.7297
58 -5782.7297 -10242.7297
59 -9101.7297 -5782.7297
60 -17298.7297 -9101.7297
> 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/7glls1229507676.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/8wahy1229507677.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/9li4q1229507677.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/10u2ru1229507677.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/11cgxe1229507677.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/121c721229507677.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/13w2z01229507677.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/14hsfz1229507678.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/1546qo1229507678.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/16ivru1229507678.tab")
+ }
> system("convert tmp/1nryl1229507676.ps tmp/1nryl1229507676.png")
> system("convert tmp/22djh1229507676.ps tmp/22djh1229507676.png")
> system("convert tmp/3oruj1229507676.ps tmp/3oruj1229507676.png")
> system("convert tmp/4jws21229507676.ps tmp/4jws21229507676.png")
> system("convert tmp/5q7hj1229507676.ps tmp/5q7hj1229507676.png")
> system("convert tmp/661sx1229507676.ps tmp/661sx1229507676.png")
> system("convert tmp/7glls1229507676.ps tmp/7glls1229507676.png")
> system("convert tmp/8wahy1229507677.ps tmp/8wahy1229507677.png")
> system("convert tmp/9li4q1229507677.ps tmp/9li4q1229507677.png")
> system("convert tmp/10u2ru1229507677.ps tmp/10u2ru1229507677.png")
>
>
> proc.time()
user system elapsed
2.494 1.616 5.044