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(2236,0,2084.9,0,2409.5,0,2199.3,0,2203.5,0,2254.1,0,1975.8,0,1742.2,0,2520.6,0,2438.1,0,2126.3,0,2267.5,0,2201.1,0,2128.5,0,2596,1,2458.2,0,2210.5,0,2621.2,0,2231.4,0,2103.6,0,2685.8,0,2539.3,0,2462.4,0,2693.3,0,2307.7,0,2385.9,0,2737.6,1,2653.9,0,2545.4,0,2848.8,0,2359.5,0,2488.3,0,2861.1,0,2717.9,0,2844,0,2749,0,2652.9,0,2660.2,0,3187.1,1,2774.1,0,3158.2,0,3244.6,0,2665.5,0,2820.8,0,2983.4,0,3077.4,0,3024.8,0,2731.8,0,3046.2,0,2834.8,0,3292.8,0,2946.1,0,3196.9,0,3284.2,0,3003,0,2979,0,3137.4,0,3630.2,0,3270.7,0,2942.3,0),dim=c(2,60),dimnames=list(c('The_Netherlands','Dummy'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('The_Netherlands','Dummy'),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
The_Netherlands Dummy
1 2236.0 0
2 2084.9 0
3 2409.5 0
4 2199.3 0
5 2203.5 0
6 2254.1 0
7 1975.8 0
8 1742.2 0
9 2520.6 0
10 2438.1 0
11 2126.3 0
12 2267.5 0
13 2201.1 0
14 2128.5 0
15 2596.0 1
16 2458.2 0
17 2210.5 0
18 2621.2 0
19 2231.4 0
20 2103.6 0
21 2685.8 0
22 2539.3 0
23 2462.4 0
24 2693.3 0
25 2307.7 0
26 2385.9 0
27 2737.6 1
28 2653.9 0
29 2545.4 0
30 2848.8 0
31 2359.5 0
32 2488.3 0
33 2861.1 0
34 2717.9 0
35 2844.0 0
36 2749.0 0
37 2652.9 0
38 2660.2 0
39 3187.1 1
40 2774.1 0
41 3158.2 0
42 3244.6 0
43 2665.5 0
44 2820.8 0
45 2983.4 0
46 3077.4 0
47 3024.8 0
48 2731.8 0
49 3046.2 0
50 2834.8 0
51 3292.8 0
52 2946.1 0
53 3196.9 0
54 3284.2 0
55 3003.0 0
56 2979.0 0
57 3137.4 0
58 3630.2 0
59 3270.7 0
60 2942.3 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
2647.6 192.7
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-905.377 -301.027 9.473 306.748 982.623
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2647.58 52.54 50.40 <2e-16 ***
Dummy 192.66 234.95 0.82 0.416
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 396.6 on 58 degrees of freedom
Multiple R-squared: 0.01146, Adjusted R-squared: -0.005584
F-statistic: 0.6724 on 1 and 58 DF, p-value: 0.4156
> 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.05190388 0.10380776 0.94809612
[2,] 0.01520494 0.03040988 0.98479506
[3,] 0.02213918 0.04427837 0.97786082
[4,] 0.10996418 0.21992835 0.89003582
[5,] 0.14284251 0.28568502 0.85715749
[6,] 0.12114589 0.24229177 0.87885411
[7,] 0.08813012 0.17626023 0.91186988
[8,] 0.05964491 0.11928983 0.94035509
[9,] 0.04133083 0.08266165 0.95866917
[10,] 0.03304566 0.06609131 0.96695434
[11,] 0.01956314 0.03912629 0.98043686
[12,] 0.02008067 0.04016134 0.97991933
[13,] 0.01600508 0.03201017 0.98399492
[14,] 0.03015763 0.06031527 0.96984237
[15,] 0.02703088 0.05406177 0.97296912
[16,] 0.03795850 0.07591700 0.96204150
[17,] 0.07470181 0.14940363 0.92529819
[18,] 0.08186178 0.16372356 0.91813822
[19,] 0.08238497 0.16476994 0.91761503
[20,] 0.11369185 0.22738371 0.88630815
[21,] 0.13325226 0.26650453 0.86674774
[22,] 0.15323580 0.30647161 0.84676420
[23,] 0.13786395 0.27572791 0.86213605
[24,] 0.16797095 0.33594190 0.83202905
[25,] 0.18999418 0.37998837 0.81000582
[26,] 0.27358408 0.54716815 0.72641592
[27,] 0.37896404 0.75792807 0.62103596
[28,] 0.46573088 0.93146177 0.53426912
[29,] 0.54709196 0.90581608 0.45290804
[30,] 0.58621960 0.82756081 0.41378040
[31,] 0.62632914 0.74734171 0.37367086
[32,] 0.65192789 0.69614423 0.34807211
[33,] 0.70255973 0.59488054 0.29744027
[34,] 0.76198233 0.47603534 0.23801767
[35,] 0.74977529 0.50044942 0.25022471
[36,] 0.77726044 0.44547911 0.22273956
[37,] 0.83247351 0.33505298 0.16752649
[38,] 0.88672949 0.22654102 0.11327051
[39,] 0.91883761 0.16232478 0.08116239
[40,] 0.92066602 0.15866797 0.07933398
[41,] 0.90598920 0.18802160 0.09401080
[42,] 0.88701644 0.22596712 0.11298356
[43,] 0.85788249 0.28423501 0.14211751
[44,] 0.89476785 0.21046430 0.10523215
[45,] 0.86064499 0.27871002 0.13935501
[46,] 0.87589949 0.24820102 0.12410051
[47,] 0.85192499 0.29615002 0.14807501
[48,] 0.82103230 0.35793540 0.17896770
[49,] 0.73773524 0.52452952 0.26226476
[50,] 0.64543407 0.70913185 0.35456593
[51,] 0.52222188 0.95555625 0.47777812
> postscript(file="/var/www/html/rcomp/tmp/125bt1229298297.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/2a8ir1229298297.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/3isxl1229298297.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/4syhj1229298297.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/50zzy1229298297.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
-411.577193 -562.677193 -238.077193 -448.277193 -444.077193 -393.477193
7 8 9 10 11 12
-671.777193 -905.377193 -126.977193 -209.477193 -521.277193 -380.077193
13 14 15 16 17 18
-446.477193 -519.077193 -244.233333 -189.377193 -437.077193 -26.377193
19 20 21 22 23 24
-416.177193 -543.977193 38.222807 -108.277193 -185.177193 45.722807
25 26 27 28 29 30
-339.877193 -261.677193 -102.633333 6.322807 -102.177193 201.222807
31 32 33 34 35 36
-288.077193 -159.277193 213.522807 70.322807 196.422807 101.422807
37 38 39 40 41 42
5.322807 12.622807 346.866667 126.522807 510.622807 597.022807
43 44 45 46 47 48
17.922807 173.222807 335.822807 429.822807 377.222807 84.222807
49 50 51 52 53 54
398.622807 187.222807 645.222807 298.522807 549.322807 636.622807
55 56 57 58 59 60
355.422807 331.422807 489.822807 982.622807 623.122807 294.722807
> postscript(file="/var/www/html/rcomp/tmp/65rz91229298297.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 -411.577193 NA
1 -562.677193 -411.577193
2 -238.077193 -562.677193
3 -448.277193 -238.077193
4 -444.077193 -448.277193
5 -393.477193 -444.077193
6 -671.777193 -393.477193
7 -905.377193 -671.777193
8 -126.977193 -905.377193
9 -209.477193 -126.977193
10 -521.277193 -209.477193
11 -380.077193 -521.277193
12 -446.477193 -380.077193
13 -519.077193 -446.477193
14 -244.233333 -519.077193
15 -189.377193 -244.233333
16 -437.077193 -189.377193
17 -26.377193 -437.077193
18 -416.177193 -26.377193
19 -543.977193 -416.177193
20 38.222807 -543.977193
21 -108.277193 38.222807
22 -185.177193 -108.277193
23 45.722807 -185.177193
24 -339.877193 45.722807
25 -261.677193 -339.877193
26 -102.633333 -261.677193
27 6.322807 -102.633333
28 -102.177193 6.322807
29 201.222807 -102.177193
30 -288.077193 201.222807
31 -159.277193 -288.077193
32 213.522807 -159.277193
33 70.322807 213.522807
34 196.422807 70.322807
35 101.422807 196.422807
36 5.322807 101.422807
37 12.622807 5.322807
38 346.866667 12.622807
39 126.522807 346.866667
40 510.622807 126.522807
41 597.022807 510.622807
42 17.922807 597.022807
43 173.222807 17.922807
44 335.822807 173.222807
45 429.822807 335.822807
46 377.222807 429.822807
47 84.222807 377.222807
48 398.622807 84.222807
49 187.222807 398.622807
50 645.222807 187.222807
51 298.522807 645.222807
52 549.322807 298.522807
53 636.622807 549.322807
54 355.422807 636.622807
55 331.422807 355.422807
56 489.822807 331.422807
57 982.622807 489.822807
58 623.122807 982.622807
59 294.722807 623.122807
60 NA 294.722807
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -562.677193 -411.577193
[2,] -238.077193 -562.677193
[3,] -448.277193 -238.077193
[4,] -444.077193 -448.277193
[5,] -393.477193 -444.077193
[6,] -671.777193 -393.477193
[7,] -905.377193 -671.777193
[8,] -126.977193 -905.377193
[9,] -209.477193 -126.977193
[10,] -521.277193 -209.477193
[11,] -380.077193 -521.277193
[12,] -446.477193 -380.077193
[13,] -519.077193 -446.477193
[14,] -244.233333 -519.077193
[15,] -189.377193 -244.233333
[16,] -437.077193 -189.377193
[17,] -26.377193 -437.077193
[18,] -416.177193 -26.377193
[19,] -543.977193 -416.177193
[20,] 38.222807 -543.977193
[21,] -108.277193 38.222807
[22,] -185.177193 -108.277193
[23,] 45.722807 -185.177193
[24,] -339.877193 45.722807
[25,] -261.677193 -339.877193
[26,] -102.633333 -261.677193
[27,] 6.322807 -102.633333
[28,] -102.177193 6.322807
[29,] 201.222807 -102.177193
[30,] -288.077193 201.222807
[31,] -159.277193 -288.077193
[32,] 213.522807 -159.277193
[33,] 70.322807 213.522807
[34,] 196.422807 70.322807
[35,] 101.422807 196.422807
[36,] 5.322807 101.422807
[37,] 12.622807 5.322807
[38,] 346.866667 12.622807
[39,] 126.522807 346.866667
[40,] 510.622807 126.522807
[41,] 597.022807 510.622807
[42,] 17.922807 597.022807
[43,] 173.222807 17.922807
[44,] 335.822807 173.222807
[45,] 429.822807 335.822807
[46,] 377.222807 429.822807
[47,] 84.222807 377.222807
[48,] 398.622807 84.222807
[49,] 187.222807 398.622807
[50,] 645.222807 187.222807
[51,] 298.522807 645.222807
[52,] 549.322807 298.522807
[53,] 636.622807 549.322807
[54,] 355.422807 636.622807
[55,] 331.422807 355.422807
[56,] 489.822807 331.422807
[57,] 982.622807 489.822807
[58,] 623.122807 982.622807
[59,] 294.722807 623.122807
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -562.677193 -411.577193
2 -238.077193 -562.677193
3 -448.277193 -238.077193
4 -444.077193 -448.277193
5 -393.477193 -444.077193
6 -671.777193 -393.477193
7 -905.377193 -671.777193
8 -126.977193 -905.377193
9 -209.477193 -126.977193
10 -521.277193 -209.477193
11 -380.077193 -521.277193
12 -446.477193 -380.077193
13 -519.077193 -446.477193
14 -244.233333 -519.077193
15 -189.377193 -244.233333
16 -437.077193 -189.377193
17 -26.377193 -437.077193
18 -416.177193 -26.377193
19 -543.977193 -416.177193
20 38.222807 -543.977193
21 -108.277193 38.222807
22 -185.177193 -108.277193
23 45.722807 -185.177193
24 -339.877193 45.722807
25 -261.677193 -339.877193
26 -102.633333 -261.677193
27 6.322807 -102.633333
28 -102.177193 6.322807
29 201.222807 -102.177193
30 -288.077193 201.222807
31 -159.277193 -288.077193
32 213.522807 -159.277193
33 70.322807 213.522807
34 196.422807 70.322807
35 101.422807 196.422807
36 5.322807 101.422807
37 12.622807 5.322807
38 346.866667 12.622807
39 126.522807 346.866667
40 510.622807 126.522807
41 597.022807 510.622807
42 17.922807 597.022807
43 173.222807 17.922807
44 335.822807 173.222807
45 429.822807 335.822807
46 377.222807 429.822807
47 84.222807 377.222807
48 398.622807 84.222807
49 187.222807 398.622807
50 645.222807 187.222807
51 298.522807 645.222807
52 549.322807 298.522807
53 636.622807 549.322807
54 355.422807 636.622807
55 331.422807 355.422807
56 489.822807 331.422807
57 982.622807 489.822807
58 623.122807 982.622807
59 294.722807 623.122807
> 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/7qd6y1229298297.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/8a3qp1229298297.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/93zb01229298297.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/10tj331229298297.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/118pq41229298297.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/12882s1229298297.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/13vxj61229298297.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/145igl1229298297.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/15bqh71229298297.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/163ena1229298298.tab")
+ }
>
> system("convert tmp/125bt1229298297.ps tmp/125bt1229298297.png")
> system("convert tmp/2a8ir1229298297.ps tmp/2a8ir1229298297.png")
> system("convert tmp/3isxl1229298297.ps tmp/3isxl1229298297.png")
> system("convert tmp/4syhj1229298297.ps tmp/4syhj1229298297.png")
> system("convert tmp/50zzy1229298297.ps tmp/50zzy1229298297.png")
> system("convert tmp/65rz91229298297.ps tmp/65rz91229298297.png")
> system("convert tmp/7qd6y1229298297.ps tmp/7qd6y1229298297.png")
> system("convert tmp/8a3qp1229298297.ps tmp/8a3qp1229298297.png")
> system("convert tmp/93zb01229298297.ps tmp/93zb01229298297.png")
> system("convert tmp/10tj331229298297.ps tmp/10tj331229298297.png")
>
>
> proc.time()
user system elapsed
2.496 1.609 3.536