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(34,0,39,0,40,0,45,0,43,0,42,0,49,0,43,0,50,0,44,0,40,0,41,0,45,0,45,0,48,0,54,0,47,0,35,0,28,0,28,0,34,0,23,0,33,0,38,0,41,0,47,0,46,0,45,0,47,0,49,0,50,0,56,0,50,0,56,0,58,0,59,0,51,0,59,0,60,0,60,0,68,0,62,0,62,0,58,0,56,0,50,0,52,0,36,0,33,0,26,0,28,0,27,0,20,0,16,0,11,0,0,1,3,1,10,1,0,1,3,1),dim=c(2,60),dimnames=list(c('Eco','Val'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Eco','Val'),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
Eco Val
1 34 0
2 39 0
3 40 0
4 45 0
5 43 0
6 42 0
7 49 0
8 43 0
9 50 0
10 44 0
11 40 0
12 41 0
13 45 0
14 45 0
15 48 0
16 54 0
17 47 0
18 35 0
19 28 0
20 28 0
21 34 0
22 23 0
23 33 0
24 38 0
25 41 0
26 47 0
27 46 0
28 45 0
29 47 0
30 49 0
31 50 0
32 56 0
33 50 0
34 56 0
35 58 0
36 59 0
37 51 0
38 59 0
39 60 0
40 60 0
41 68 0
42 62 0
43 62 0
44 58 0
45 56 0
46 50 0
47 52 0
48 36 0
49 33 0
50 26 0
51 28 0
52 27 0
53 20 0
54 16 0
55 11 0
56 0 1
57 3 1
58 10 1
59 0 1
60 3 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Val
43.76 -40.56
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-32.764 -6.264 1.236 6.909 24.236
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 43.764 1.633 26.800 < 2e-16 ***
Val -40.564 5.657 -7.171 1.51e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 12.11 on 58 degrees of freedom
Multiple R-squared: 0.4699, Adjusted R-squared: 0.4608
F-statistic: 51.42 on 1 and 58 DF, p-value: 1.515e-09
> 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,] 7.044386e-02 1.408877e-01 0.92955614
[2,] 2.306839e-02 4.613679e-02 0.97693161
[3,] 2.596652e-02 5.193303e-02 0.97403348
[4,] 9.228093e-03 1.845619e-02 0.99077191
[5,] 9.032865e-03 1.806573e-02 0.99096713
[6,] 3.302575e-03 6.605150e-03 0.99669743
[7,] 1.301460e-03 2.602921e-03 0.99869854
[8,] 4.459640e-04 8.919281e-04 0.99955404
[9,] 1.573592e-04 3.147185e-04 0.99984264
[10,] 5.285680e-05 1.057136e-04 0.99994714
[11,] 2.861656e-05 5.723312e-05 0.99997138
[12,] 8.823621e-05 1.764724e-04 0.99991176
[13,] 3.497601e-05 6.995202e-05 0.99996502
[14,] 4.563156e-05 9.126311e-05 0.99995437
[15,] 3.583412e-04 7.166824e-04 0.99964166
[16,] 1.152925e-03 2.305851e-03 0.99884707
[17,] 9.319116e-04 1.863823e-03 0.99906809
[18,] 5.228395e-03 1.045679e-02 0.99477160
[19,] 4.344820e-03 8.689641e-03 0.99565518
[20,] 2.532221e-03 5.064441e-03 0.99746778
[21,] 1.346351e-03 2.692702e-03 0.99865365
[22,] 8.524339e-04 1.704868e-03 0.99914757
[23,] 4.892785e-04 9.785571e-04 0.99951072
[24,] 2.585569e-04 5.171138e-04 0.99974144
[25,] 1.488002e-04 2.976003e-04 0.99985120
[26,] 9.828784e-05 1.965757e-04 0.99990171
[27,] 6.925344e-05 1.385069e-04 0.99993075
[28,] 1.104627e-04 2.209253e-04 0.99988954
[29,] 7.100207e-05 1.420041e-04 0.99992900
[30,] 9.500142e-05 1.900028e-04 0.99990500
[31,] 1.595492e-04 3.190984e-04 0.99984045
[32,] 2.827478e-04 5.654956e-04 0.99971725
[33,] 1.806655e-04 3.613311e-04 0.99981933
[34,] 2.954408e-04 5.908816e-04 0.99970456
[35,] 5.441243e-04 1.088249e-03 0.99945588
[36,] 9.941923e-04 1.988385e-03 0.99900581
[37,] 7.248232e-03 1.449646e-02 0.99275177
[38,] 1.906306e-02 3.812612e-02 0.98093694
[39,] 5.743522e-02 1.148704e-01 0.94256478
[40,] 1.279851e-01 2.559702e-01 0.87201489
[41,] 2.843221e-01 5.686442e-01 0.71567788
[42,] 4.582593e-01 9.165185e-01 0.54174073
[43,] 8.837816e-01 2.324367e-01 0.11621836
[44,] 9.317420e-01 1.365159e-01 0.06825797
[45,] 9.615534e-01 7.689328e-02 0.03844664
[46,] 9.558834e-01 8.823326e-02 0.04411663
[47,] 9.673915e-01 6.521705e-02 0.03260852
[48,] 9.878186e-01 2.436283e-02 0.01218142
[49,] 9.864018e-01 2.719631e-02 0.01359816
[50,] 9.754525e-01 4.909506e-02 0.02454753
[51,] 9.357159e-01 1.285682e-01 0.06428409
> postscript(file="/var/www/html/rcomp/tmp/11rdz1228497351.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/2n6k71228497351.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/3rgkt1228497351.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/4cucs1228497351.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/5si9p1228497351.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
-9.7636364 -4.7636364 -3.7636364 1.2363636 -0.7636364 -1.7636364
7 8 9 10 11 12
5.2363636 -0.7636364 6.2363636 0.2363636 -3.7636364 -2.7636364
13 14 15 16 17 18
1.2363636 1.2363636 4.2363636 10.2363636 3.2363636 -8.7636364
19 20 21 22 23 24
-15.7636364 -15.7636364 -9.7636364 -20.7636364 -10.7636364 -5.7636364
25 26 27 28 29 30
-2.7636364 3.2363636 2.2363636 1.2363636 3.2363636 5.2363636
31 32 33 34 35 36
6.2363636 12.2363636 6.2363636 12.2363636 14.2363636 15.2363636
37 38 39 40 41 42
7.2363636 15.2363636 16.2363636 16.2363636 24.2363636 18.2363636
43 44 45 46 47 48
18.2363636 14.2363636 12.2363636 6.2363636 8.2363636 -7.7636364
49 50 51 52 53 54
-10.7636364 -17.7636364 -15.7636364 -16.7636364 -23.7636364 -27.7636364
55 56 57 58 59 60
-32.7636364 -3.2000000 -0.2000000 6.8000000 -3.2000000 -0.2000000
> postscript(file="/var/www/html/rcomp/tmp/66l6r1228497351.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 -9.7636364 NA
1 -4.7636364 -9.7636364
2 -3.7636364 -4.7636364
3 1.2363636 -3.7636364
4 -0.7636364 1.2363636
5 -1.7636364 -0.7636364
6 5.2363636 -1.7636364
7 -0.7636364 5.2363636
8 6.2363636 -0.7636364
9 0.2363636 6.2363636
10 -3.7636364 0.2363636
11 -2.7636364 -3.7636364
12 1.2363636 -2.7636364
13 1.2363636 1.2363636
14 4.2363636 1.2363636
15 10.2363636 4.2363636
16 3.2363636 10.2363636
17 -8.7636364 3.2363636
18 -15.7636364 -8.7636364
19 -15.7636364 -15.7636364
20 -9.7636364 -15.7636364
21 -20.7636364 -9.7636364
22 -10.7636364 -20.7636364
23 -5.7636364 -10.7636364
24 -2.7636364 -5.7636364
25 3.2363636 -2.7636364
26 2.2363636 3.2363636
27 1.2363636 2.2363636
28 3.2363636 1.2363636
29 5.2363636 3.2363636
30 6.2363636 5.2363636
31 12.2363636 6.2363636
32 6.2363636 12.2363636
33 12.2363636 6.2363636
34 14.2363636 12.2363636
35 15.2363636 14.2363636
36 7.2363636 15.2363636
37 15.2363636 7.2363636
38 16.2363636 15.2363636
39 16.2363636 16.2363636
40 24.2363636 16.2363636
41 18.2363636 24.2363636
42 18.2363636 18.2363636
43 14.2363636 18.2363636
44 12.2363636 14.2363636
45 6.2363636 12.2363636
46 8.2363636 6.2363636
47 -7.7636364 8.2363636
48 -10.7636364 -7.7636364
49 -17.7636364 -10.7636364
50 -15.7636364 -17.7636364
51 -16.7636364 -15.7636364
52 -23.7636364 -16.7636364
53 -27.7636364 -23.7636364
54 -32.7636364 -27.7636364
55 -3.2000000 -32.7636364
56 -0.2000000 -3.2000000
57 6.8000000 -0.2000000
58 -3.2000000 6.8000000
59 -0.2000000 -3.2000000
60 NA -0.2000000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -4.7636364 -9.7636364
[2,] -3.7636364 -4.7636364
[3,] 1.2363636 -3.7636364
[4,] -0.7636364 1.2363636
[5,] -1.7636364 -0.7636364
[6,] 5.2363636 -1.7636364
[7,] -0.7636364 5.2363636
[8,] 6.2363636 -0.7636364
[9,] 0.2363636 6.2363636
[10,] -3.7636364 0.2363636
[11,] -2.7636364 -3.7636364
[12,] 1.2363636 -2.7636364
[13,] 1.2363636 1.2363636
[14,] 4.2363636 1.2363636
[15,] 10.2363636 4.2363636
[16,] 3.2363636 10.2363636
[17,] -8.7636364 3.2363636
[18,] -15.7636364 -8.7636364
[19,] -15.7636364 -15.7636364
[20,] -9.7636364 -15.7636364
[21,] -20.7636364 -9.7636364
[22,] -10.7636364 -20.7636364
[23,] -5.7636364 -10.7636364
[24,] -2.7636364 -5.7636364
[25,] 3.2363636 -2.7636364
[26,] 2.2363636 3.2363636
[27,] 1.2363636 2.2363636
[28,] 3.2363636 1.2363636
[29,] 5.2363636 3.2363636
[30,] 6.2363636 5.2363636
[31,] 12.2363636 6.2363636
[32,] 6.2363636 12.2363636
[33,] 12.2363636 6.2363636
[34,] 14.2363636 12.2363636
[35,] 15.2363636 14.2363636
[36,] 7.2363636 15.2363636
[37,] 15.2363636 7.2363636
[38,] 16.2363636 15.2363636
[39,] 16.2363636 16.2363636
[40,] 24.2363636 16.2363636
[41,] 18.2363636 24.2363636
[42,] 18.2363636 18.2363636
[43,] 14.2363636 18.2363636
[44,] 12.2363636 14.2363636
[45,] 6.2363636 12.2363636
[46,] 8.2363636 6.2363636
[47,] -7.7636364 8.2363636
[48,] -10.7636364 -7.7636364
[49,] -17.7636364 -10.7636364
[50,] -15.7636364 -17.7636364
[51,] -16.7636364 -15.7636364
[52,] -23.7636364 -16.7636364
[53,] -27.7636364 -23.7636364
[54,] -32.7636364 -27.7636364
[55,] -3.2000000 -32.7636364
[56,] -0.2000000 -3.2000000
[57,] 6.8000000 -0.2000000
[58,] -3.2000000 6.8000000
[59,] -0.2000000 -3.2000000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -4.7636364 -9.7636364
2 -3.7636364 -4.7636364
3 1.2363636 -3.7636364
4 -0.7636364 1.2363636
5 -1.7636364 -0.7636364
6 5.2363636 -1.7636364
7 -0.7636364 5.2363636
8 6.2363636 -0.7636364
9 0.2363636 6.2363636
10 -3.7636364 0.2363636
11 -2.7636364 -3.7636364
12 1.2363636 -2.7636364
13 1.2363636 1.2363636
14 4.2363636 1.2363636
15 10.2363636 4.2363636
16 3.2363636 10.2363636
17 -8.7636364 3.2363636
18 -15.7636364 -8.7636364
19 -15.7636364 -15.7636364
20 -9.7636364 -15.7636364
21 -20.7636364 -9.7636364
22 -10.7636364 -20.7636364
23 -5.7636364 -10.7636364
24 -2.7636364 -5.7636364
25 3.2363636 -2.7636364
26 2.2363636 3.2363636
27 1.2363636 2.2363636
28 3.2363636 1.2363636
29 5.2363636 3.2363636
30 6.2363636 5.2363636
31 12.2363636 6.2363636
32 6.2363636 12.2363636
33 12.2363636 6.2363636
34 14.2363636 12.2363636
35 15.2363636 14.2363636
36 7.2363636 15.2363636
37 15.2363636 7.2363636
38 16.2363636 15.2363636
39 16.2363636 16.2363636
40 24.2363636 16.2363636
41 18.2363636 24.2363636
42 18.2363636 18.2363636
43 14.2363636 18.2363636
44 12.2363636 14.2363636
45 6.2363636 12.2363636
46 8.2363636 6.2363636
47 -7.7636364 8.2363636
48 -10.7636364 -7.7636364
49 -17.7636364 -10.7636364
50 -15.7636364 -17.7636364
51 -16.7636364 -15.7636364
52 -23.7636364 -16.7636364
53 -27.7636364 -23.7636364
54 -32.7636364 -27.7636364
55 -3.2000000 -32.7636364
56 -0.2000000 -3.2000000
57 6.8000000 -0.2000000
58 -3.2000000 6.8000000
59 -0.2000000 -3.2000000
> 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/7puze1228497351.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/80q411228497351.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/9dhh21228497351.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/10ql991228497351.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/1162841228497351.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/12u1ei1228497351.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/13zj211228497351.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/14qcp11228497351.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/152vrk1228497352.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/163ybn1228497352.tab")
+ }
>
> system("convert tmp/11rdz1228497351.ps tmp/11rdz1228497351.png")
> system("convert tmp/2n6k71228497351.ps tmp/2n6k71228497351.png")
> system("convert tmp/3rgkt1228497351.ps tmp/3rgkt1228497351.png")
> system("convert tmp/4cucs1228497351.ps tmp/4cucs1228497351.png")
> system("convert tmp/5si9p1228497351.ps tmp/5si9p1228497351.png")
> system("convert tmp/66l6r1228497351.ps tmp/66l6r1228497351.png")
> system("convert tmp/7puze1228497351.ps tmp/7puze1228497351.png")
> system("convert tmp/80q411228497351.ps tmp/80q411228497351.png")
> system("convert tmp/9dhh21228497351.ps tmp/9dhh21228497351.png")
> system("convert tmp/10ql991228497351.ps tmp/10ql991228497351.png")
>
>
> proc.time()
user system elapsed
2.493 1.563 3.228