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(89.1,0,82.6,0,102.7,0,91.8,0,94.1,0,103.1,0,93.2,0,91,0,94.3,0,99.4,0,115.7,0,116.8,0,99.8,0,96,0,115.9,0,109.1,0,117.3,0,109.8,0,112.8,0,110.7,0,100,0,113.3,0,122.4,0,112.5,0,104.2,0,92.5,0,117.2,0,109.3,0,106.1,0,118.8,0,105.3,0,106,0,102,0,112.9,0,116.5,0,114.8,0,100.5,0,85.4,0,114.6,0,109.9,0,100.7,0,115.5,0,100.7,1,99,1,102.3,1,108.8,1,105.9,1,113.2,1,95.7,1,80.9,1,113.9,1,98.1,1,102.8,1,104.7,1,95.9,1,94.6,1,101.6,1,103.9,1,110.3,1,114.1,1),dim=c(2,60),dimnames=list(c('TotaleIndustrieleProductie','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('TotaleIndustrieleProductie','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
TotaleIndustrieleProductie X
1 89.1 0
2 82.6 0
3 102.7 0
4 91.8 0
5 94.1 0
6 103.1 0
7 93.2 0
8 91.0 0
9 94.3 0
10 99.4 0
11 115.7 0
12 116.8 0
13 99.8 0
14 96.0 0
15 115.9 0
16 109.1 0
17 117.3 0
18 109.8 0
19 112.8 0
20 110.7 0
21 100.0 0
22 113.3 0
23 122.4 0
24 112.5 0
25 104.2 0
26 92.5 0
27 117.2 0
28 109.3 0
29 106.1 0
30 118.8 0
31 105.3 0
32 106.0 0
33 102.0 0
34 112.9 0
35 116.5 0
36 114.8 0
37 100.5 0
38 85.4 0
39 114.6 0
40 109.9 0
41 100.7 0
42 115.5 0
43 100.7 1
44 99.0 1
45 102.3 1
46 108.8 1
47 105.9 1
48 113.2 1
49 95.7 1
50 80.9 1
51 113.9 1
52 98.1 1
53 102.8 1
54 104.7 1
55 95.9 1
56 94.6 1
57 101.6 1
58 103.9 1
59 110.3 1
60 114.1 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
105.371 -2.794
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-22.7714 -5.6714 0.4254 7.7738 17.0286
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 105.371 1.484 70.983 <2e-16 ***
X -2.794 2.710 -1.031 0.307
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.62 on 58 degrees of freedom
Multiple R-squared: 0.01799, Adjusted R-squared: 0.001058
F-statistic: 1.062 on 1 and 58 DF, p-value: 0.3069
> 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.5619015 0.8761970 0.43809848
[2,] 0.5832948 0.8334104 0.41670520
[3,] 0.4625113 0.9250226 0.53748871
[4,] 0.3824832 0.7649664 0.61751682
[5,] 0.2969102 0.5938203 0.70308984
[6,] 0.2573409 0.5146818 0.74265908
[7,] 0.7002623 0.5994753 0.29973767
[8,] 0.8816755 0.2366489 0.11832447
[9,] 0.8428082 0.3143837 0.15719183
[10,] 0.8172358 0.3655283 0.18276416
[11,] 0.8957159 0.2085681 0.10428407
[12,] 0.8829929 0.2340142 0.11700710
[13,] 0.9277755 0.1444491 0.07222453
[14,] 0.9124057 0.1751885 0.08759426
[15,] 0.9079231 0.1841539 0.09207693
[16,] 0.8890832 0.2218335 0.11091676
[17,] 0.8624986 0.2750028 0.13750139
[18,] 0.8538470 0.2923059 0.14615297
[19,] 0.9271791 0.1456419 0.07282095
[20,] 0.9133644 0.1732711 0.08663557
[21,] 0.8808270 0.2383460 0.11917301
[22,] 0.9141617 0.1716766 0.08583831
[23,] 0.9238246 0.1523508 0.07617540
[24,] 0.8970766 0.2058468 0.10292340
[25,] 0.8598557 0.2802887 0.14014433
[26,] 0.8874571 0.2250858 0.11254288
[27,] 0.8472132 0.3055736 0.15278681
[28,] 0.7979746 0.4040508 0.20202538
[29,] 0.7535379 0.4929242 0.24646211
[30,] 0.7184153 0.5631694 0.28158472
[31,] 0.7284002 0.5431997 0.27159985
[32,] 0.7255935 0.5488130 0.27440652
[33,] 0.6712519 0.6574963 0.32874814
[34,] 0.8984604 0.2030793 0.10153965
[35,] 0.8782499 0.2435002 0.12175010
[36,] 0.8345413 0.3309174 0.16545871
[37,] 0.8356224 0.3287552 0.16437758
[38,] 0.7925825 0.4148351 0.20741753
[39,] 0.7261863 0.5476274 0.27381372
[40,] 0.6571984 0.6856032 0.34280160
[41,] 0.5707947 0.8584107 0.42920534
[42,] 0.5156756 0.9686489 0.48432445
[43,] 0.4311310 0.8622620 0.56886900
[44,] 0.4507763 0.9015525 0.54922375
[45,] 0.3918132 0.7836263 0.60818685
[46,] 0.8238424 0.3523151 0.17615755
[47,] 0.8624020 0.2751960 0.13759802
[48,] 0.8078075 0.3843850 0.19219250
[49,] 0.6950352 0.6099296 0.30496479
[50,] 0.5506333 0.8987334 0.44936669
[51,] 0.4977440 0.9954881 0.50225597
> postscript(file="/var/www/html/rcomp/tmp/1vcvz1258723685.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/2ud9z1258723685.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/39ia61258723685.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/45qvy1258723685.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/57gi91258723685.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
-16.27142857 -22.77142857 -2.67142857 -13.57142857 -11.27142857 -2.27142857
7 8 9 10 11 12
-12.17142857 -14.37142857 -11.07142857 -5.97142857 10.32857143 11.42857143
13 14 15 16 17 18
-5.57142857 -9.37142857 10.52857143 3.72857143 11.92857143 4.42857143
19 20 21 22 23 24
7.42857143 5.32857143 -5.37142857 7.92857143 17.02857143 7.12857143
25 26 27 28 29 30
-1.17142857 -12.87142857 11.82857143 3.92857143 0.72857143 13.42857143
31 32 33 34 35 36
-0.07142857 0.62857143 -3.37142857 7.52857143 11.12857143 9.42857143
37 38 39 40 41 42
-4.87142857 -19.97142857 9.22857143 4.52857143 -4.67142857 10.12857143
43 44 45 46 47 48
-1.87777778 -3.57777778 -0.27777778 6.22222222 3.32222222 10.62222222
49 50 51 52 53 54
-6.87777778 -21.67777778 11.32222222 -4.47777778 0.22222222 2.12222222
55 56 57 58 59 60
-6.67777778 -7.97777778 -0.97777778 1.32222222 7.72222222 11.52222222
> postscript(file="/var/www/html/rcomp/tmp/6sxek1258723685.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 -16.27142857 NA
1 -22.77142857 -16.27142857
2 -2.67142857 -22.77142857
3 -13.57142857 -2.67142857
4 -11.27142857 -13.57142857
5 -2.27142857 -11.27142857
6 -12.17142857 -2.27142857
7 -14.37142857 -12.17142857
8 -11.07142857 -14.37142857
9 -5.97142857 -11.07142857
10 10.32857143 -5.97142857
11 11.42857143 10.32857143
12 -5.57142857 11.42857143
13 -9.37142857 -5.57142857
14 10.52857143 -9.37142857
15 3.72857143 10.52857143
16 11.92857143 3.72857143
17 4.42857143 11.92857143
18 7.42857143 4.42857143
19 5.32857143 7.42857143
20 -5.37142857 5.32857143
21 7.92857143 -5.37142857
22 17.02857143 7.92857143
23 7.12857143 17.02857143
24 -1.17142857 7.12857143
25 -12.87142857 -1.17142857
26 11.82857143 -12.87142857
27 3.92857143 11.82857143
28 0.72857143 3.92857143
29 13.42857143 0.72857143
30 -0.07142857 13.42857143
31 0.62857143 -0.07142857
32 -3.37142857 0.62857143
33 7.52857143 -3.37142857
34 11.12857143 7.52857143
35 9.42857143 11.12857143
36 -4.87142857 9.42857143
37 -19.97142857 -4.87142857
38 9.22857143 -19.97142857
39 4.52857143 9.22857143
40 -4.67142857 4.52857143
41 10.12857143 -4.67142857
42 -1.87777778 10.12857143
43 -3.57777778 -1.87777778
44 -0.27777778 -3.57777778
45 6.22222222 -0.27777778
46 3.32222222 6.22222222
47 10.62222222 3.32222222
48 -6.87777778 10.62222222
49 -21.67777778 -6.87777778
50 11.32222222 -21.67777778
51 -4.47777778 11.32222222
52 0.22222222 -4.47777778
53 2.12222222 0.22222222
54 -6.67777778 2.12222222
55 -7.97777778 -6.67777778
56 -0.97777778 -7.97777778
57 1.32222222 -0.97777778
58 7.72222222 1.32222222
59 11.52222222 7.72222222
60 NA 11.52222222
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -22.77142857 -16.27142857
[2,] -2.67142857 -22.77142857
[3,] -13.57142857 -2.67142857
[4,] -11.27142857 -13.57142857
[5,] -2.27142857 -11.27142857
[6,] -12.17142857 -2.27142857
[7,] -14.37142857 -12.17142857
[8,] -11.07142857 -14.37142857
[9,] -5.97142857 -11.07142857
[10,] 10.32857143 -5.97142857
[11,] 11.42857143 10.32857143
[12,] -5.57142857 11.42857143
[13,] -9.37142857 -5.57142857
[14,] 10.52857143 -9.37142857
[15,] 3.72857143 10.52857143
[16,] 11.92857143 3.72857143
[17,] 4.42857143 11.92857143
[18,] 7.42857143 4.42857143
[19,] 5.32857143 7.42857143
[20,] -5.37142857 5.32857143
[21,] 7.92857143 -5.37142857
[22,] 17.02857143 7.92857143
[23,] 7.12857143 17.02857143
[24,] -1.17142857 7.12857143
[25,] -12.87142857 -1.17142857
[26,] 11.82857143 -12.87142857
[27,] 3.92857143 11.82857143
[28,] 0.72857143 3.92857143
[29,] 13.42857143 0.72857143
[30,] -0.07142857 13.42857143
[31,] 0.62857143 -0.07142857
[32,] -3.37142857 0.62857143
[33,] 7.52857143 -3.37142857
[34,] 11.12857143 7.52857143
[35,] 9.42857143 11.12857143
[36,] -4.87142857 9.42857143
[37,] -19.97142857 -4.87142857
[38,] 9.22857143 -19.97142857
[39,] 4.52857143 9.22857143
[40,] -4.67142857 4.52857143
[41,] 10.12857143 -4.67142857
[42,] -1.87777778 10.12857143
[43,] -3.57777778 -1.87777778
[44,] -0.27777778 -3.57777778
[45,] 6.22222222 -0.27777778
[46,] 3.32222222 6.22222222
[47,] 10.62222222 3.32222222
[48,] -6.87777778 10.62222222
[49,] -21.67777778 -6.87777778
[50,] 11.32222222 -21.67777778
[51,] -4.47777778 11.32222222
[52,] 0.22222222 -4.47777778
[53,] 2.12222222 0.22222222
[54,] -6.67777778 2.12222222
[55,] -7.97777778 -6.67777778
[56,] -0.97777778 -7.97777778
[57,] 1.32222222 -0.97777778
[58,] 7.72222222 1.32222222
[59,] 11.52222222 7.72222222
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -22.77142857 -16.27142857
2 -2.67142857 -22.77142857
3 -13.57142857 -2.67142857
4 -11.27142857 -13.57142857
5 -2.27142857 -11.27142857
6 -12.17142857 -2.27142857
7 -14.37142857 -12.17142857
8 -11.07142857 -14.37142857
9 -5.97142857 -11.07142857
10 10.32857143 -5.97142857
11 11.42857143 10.32857143
12 -5.57142857 11.42857143
13 -9.37142857 -5.57142857
14 10.52857143 -9.37142857
15 3.72857143 10.52857143
16 11.92857143 3.72857143
17 4.42857143 11.92857143
18 7.42857143 4.42857143
19 5.32857143 7.42857143
20 -5.37142857 5.32857143
21 7.92857143 -5.37142857
22 17.02857143 7.92857143
23 7.12857143 17.02857143
24 -1.17142857 7.12857143
25 -12.87142857 -1.17142857
26 11.82857143 -12.87142857
27 3.92857143 11.82857143
28 0.72857143 3.92857143
29 13.42857143 0.72857143
30 -0.07142857 13.42857143
31 0.62857143 -0.07142857
32 -3.37142857 0.62857143
33 7.52857143 -3.37142857
34 11.12857143 7.52857143
35 9.42857143 11.12857143
36 -4.87142857 9.42857143
37 -19.97142857 -4.87142857
38 9.22857143 -19.97142857
39 4.52857143 9.22857143
40 -4.67142857 4.52857143
41 10.12857143 -4.67142857
42 -1.87777778 10.12857143
43 -3.57777778 -1.87777778
44 -0.27777778 -3.57777778
45 6.22222222 -0.27777778
46 3.32222222 6.22222222
47 10.62222222 3.32222222
48 -6.87777778 10.62222222
49 -21.67777778 -6.87777778
50 11.32222222 -21.67777778
51 -4.47777778 11.32222222
52 0.22222222 -4.47777778
53 2.12222222 0.22222222
54 -6.67777778 2.12222222
55 -7.97777778 -6.67777778
56 -0.97777778 -7.97777778
57 1.32222222 -0.97777778
58 7.72222222 1.32222222
59 11.52222222 7.72222222
> 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/7d2fv1258723685.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/81xrq1258723685.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/92ku01258723685.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/10fxw71258723685.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/118rl41258723685.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/12ff201258723685.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/1355ag1258723685.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/14jgqc1258723685.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/15z4f71258723685.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/16v59e1258723685.tab")
+ }
>
> system("convert tmp/1vcvz1258723685.ps tmp/1vcvz1258723685.png")
> system("convert tmp/2ud9z1258723685.ps tmp/2ud9z1258723685.png")
> system("convert tmp/39ia61258723685.ps tmp/39ia61258723685.png")
> system("convert tmp/45qvy1258723685.ps tmp/45qvy1258723685.png")
> system("convert tmp/57gi91258723685.ps tmp/57gi91258723685.png")
> system("convert tmp/6sxek1258723685.ps tmp/6sxek1258723685.png")
> system("convert tmp/7d2fv1258723685.ps tmp/7d2fv1258723685.png")
> system("convert tmp/81xrq1258723685.ps tmp/81xrq1258723685.png")
> system("convert tmp/92ku01258723685.ps tmp/92ku01258723685.png")
> system("convert tmp/10fxw71258723685.ps tmp/10fxw71258723685.png")
>
>
> proc.time()
user system elapsed
2.451 1.541 4.081