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.
Natural language support but running in an English locale
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(167.16,179.84,174.44,180.35,193.17,195.16,202.43,189.91,195.98,212.09,205.81,204.31,196.07,199.98,199.10,198.31,195.72,223.04,238.41,259.73,326.54,335.15,321.81,368.62,369.59,425.00,439.72,362.23,328.76,348.55,328.18,329.34,295.55,237.38,226.85,220.14,239.36,224.69,230.98,233.47,256.70,253.41,224.95,210.37,191.09,198.85,211.04,206.25,201.51,194.54,191.07,192.82,181.88,157.67,195.82,246.25,271.69,270.29),dim=c(1,58),dimnames=list(c('Tarwe'),1:58))
> y <- array(NA,dim=c(1,58),dimnames=list(c('Tarwe'),1:58))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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
Tarwe M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 167.16 1 0 0 0 0 0 0 0 0 0 0 1
2 179.84 0 1 0 0 0 0 0 0 0 0 0 2
3 174.44 0 0 1 0 0 0 0 0 0 0 0 3
4 180.35 0 0 0 1 0 0 0 0 0 0 0 4
5 193.17 0 0 0 0 1 0 0 0 0 0 0 5
6 195.16 0 0 0 0 0 1 0 0 0 0 0 6
7 202.43 0 0 0 0 0 0 1 0 0 0 0 7
8 189.91 0 0 0 0 0 0 0 1 0 0 0 8
9 195.98 0 0 0 0 0 0 0 0 1 0 0 9
10 212.09 0 0 0 0 0 0 0 0 0 1 0 10
11 205.81 0 0 0 0 0 0 0 0 0 0 1 11
12 204.31 0 0 0 0 0 0 0 0 0 0 0 12
13 196.07 1 0 0 0 0 0 0 0 0 0 0 13
14 199.98 0 1 0 0 0 0 0 0 0 0 0 14
15 199.10 0 0 1 0 0 0 0 0 0 0 0 15
16 198.31 0 0 0 1 0 0 0 0 0 0 0 16
17 195.72 0 0 0 0 1 0 0 0 0 0 0 17
18 223.04 0 0 0 0 0 1 0 0 0 0 0 18
19 238.41 0 0 0 0 0 0 1 0 0 0 0 19
20 259.73 0 0 0 0 0 0 0 1 0 0 0 20
21 326.54 0 0 0 0 0 0 0 0 1 0 0 21
22 335.15 0 0 0 0 0 0 0 0 0 1 0 22
23 321.81 0 0 0 0 0 0 0 0 0 0 1 23
24 368.62 0 0 0 0 0 0 0 0 0 0 0 24
25 369.59 1 0 0 0 0 0 0 0 0 0 0 25
26 425.00 0 1 0 0 0 0 0 0 0 0 0 26
27 439.72 0 0 1 0 0 0 0 0 0 0 0 27
28 362.23 0 0 0 1 0 0 0 0 0 0 0 28
29 328.76 0 0 0 0 1 0 0 0 0 0 0 29
30 348.55 0 0 0 0 0 1 0 0 0 0 0 30
31 328.18 0 0 0 0 0 0 1 0 0 0 0 31
32 329.34 0 0 0 0 0 0 0 1 0 0 0 32
33 295.55 0 0 0 0 0 0 0 0 1 0 0 33
34 237.38 0 0 0 0 0 0 0 0 0 1 0 34
35 226.85 0 0 0 0 0 0 0 0 0 0 1 35
36 220.14 0 0 0 0 0 0 0 0 0 0 0 36
37 239.36 1 0 0 0 0 0 0 0 0 0 0 37
38 224.69 0 1 0 0 0 0 0 0 0 0 0 38
39 230.98 0 0 1 0 0 0 0 0 0 0 0 39
40 233.47 0 0 0 1 0 0 0 0 0 0 0 40
41 256.70 0 0 0 0 1 0 0 0 0 0 0 41
42 253.41 0 0 0 0 0 1 0 0 0 0 0 42
43 224.95 0 0 0 0 0 0 1 0 0 0 0 43
44 210.37 0 0 0 0 0 0 0 1 0 0 0 44
45 191.09 0 0 0 0 0 0 0 0 1 0 0 45
46 198.85 0 0 0 0 0 0 0 0 0 1 0 46
47 211.04 0 0 0 0 0 0 0 0 0 0 1 47
48 206.25 0 0 0 0 0 0 0 0 0 0 0 48
49 201.51 1 0 0 0 0 0 0 0 0 0 0 49
50 194.54 0 1 0 0 0 0 0 0 0 0 0 50
51 191.07 0 0 1 0 0 0 0 0 0 0 0 51
52 192.82 0 0 0 1 0 0 0 0 0 0 0 52
53 181.88 0 0 0 0 1 0 0 0 0 0 0 53
54 157.67 0 0 0 0 0 1 0 0 0 0 0 54
55 195.82 0 0 0 0 0 0 1 0 0 0 0 55
56 246.25 0 0 0 0 0 0 0 1 0 0 0 56
57 271.69 0 0 0 0 0 0 0 0 1 0 0 57
58 270.29 0 0 0 0 0 0 0 0 0 1 0 58
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
245.1283 -14.3084 -4.3931 -2.2978 -16.0806 -18.4273
M6 M7 M8 M9 M10 M11
-14.2640 -12.0287 -3.0234 5.8698 0.2951 -8.2958
t
0.1567
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-81.66 -45.52 -31.20 15.92 192.66
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 245.1283 41.3217 5.932 3.94e-07 ***
M1 -14.3084 50.1307 -0.285 0.777
M2 -4.3931 50.0992 -0.088 0.931
M3 -2.2978 50.0746 -0.046 0.964
M4 -16.0806 50.0571 -0.321 0.750
M5 -18.4273 50.0465 -0.368 0.714
M6 -14.2640 50.0430 -0.285 0.777
M7 -12.0287 50.0465 -0.240 0.811
M8 -3.0234 50.0571 -0.060 0.952
M9 5.8698 50.0746 0.117 0.907
M10 0.2951 50.0992 0.006 0.995
M11 -8.2958 52.7533 -0.157 0.876
t 0.1567 0.5927 0.264 0.793
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 74.6 on 45 degrees of freedom
Multiple R-squared: 0.01498, Adjusted R-squared: -0.2477
F-statistic: 0.05704 on 12 and 45 DF, p-value: 1
> 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,] 2.189830e-04 4.379660e-04 0.99978102
[2,] 3.947203e-04 7.894405e-04 0.99960528
[3,] 7.741925e-05 1.548385e-04 0.99992258
[4,] 3.388418e-05 6.776836e-05 0.99996612
[5,] 6.463838e-04 1.292768e-03 0.99935362
[6,] 3.045378e-02 6.090756e-02 0.96954622
[7,] 5.550080e-02 1.110016e-01 0.94449920
[8,] 5.643504e-02 1.128701e-01 0.94356496
[9,] 1.218793e-01 2.437585e-01 0.87812073
[10,] 1.669789e-01 3.339579e-01 0.83302106
[11,] 3.907075e-01 7.814150e-01 0.60929248
[12,] 7.354178e-01 5.291644e-01 0.26458220
[13,] 7.425916e-01 5.148169e-01 0.25740843
[14,] 6.945298e-01 6.109403e-01 0.30547015
[15,] 7.425639e-01 5.148721e-01 0.25743606
[16,] 7.801456e-01 4.397089e-01 0.21985445
[17,] 8.093010e-01 3.813980e-01 0.19069898
[18,] 8.482076e-01 3.035848e-01 0.15179240
[19,] 9.087490e-01 1.825019e-01 0.09125096
[20,] 9.185568e-01 1.628864e-01 0.08144321
[21,] 9.235994e-01 1.528012e-01 0.07640062
[22,] 9.053794e-01 1.892412e-01 0.09462058
[23,] 8.837569e-01 2.324862e-01 0.11624308
[24,] 8.438340e-01 3.123321e-01 0.15616604
[25,] 7.720225e-01 4.559550e-01 0.22797751
[26,] 7.386578e-01 5.226843e-01 0.26134217
[27,] 8.787820e-01 2.424359e-01 0.12121796
> postscript(file="/var/www/html/freestat/rcomp/tmp/1kxcl1291028739.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/freestat/rcomp/tmp/2v6b61291028739.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/freestat/rcomp/tmp/3v6b61291028739.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/freestat/rcomp/tmp/4v6b61291028739.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/freestat/rcomp/tmp/5v6b61291028739.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 = 58
Frequency = 1
1 2 3 4 5 6 7
-63.816636 -61.208636 -68.860636 -49.324636 -34.314636 -36.644636 -31.766636
8 9 10 11 12 13 14
-53.448636 -56.428636 -34.900636 -32.746477 -42.698977 -36.787318 -42.949318
15 16 17 18 19 20 21
-46.081318 -33.245318 -33.645318 -10.645318 2.332682 14.490682 72.250682
22 23 24 25 26 27 28
86.278682 81.372841 119.730341 134.852000 180.190000 192.658000 128.794000
29 30 31 32 33 34 35
97.514000 112.984000 90.222000 82.220000 39.380000 -13.372000 -15.467841
36 37 38 39 40 41 42
-30.630341 2.741318 -22.000682 -17.962682 -1.846682 23.573318 15.963318
43 44 45 46 47 48 49
-14.888682 -38.630682 -66.960682 -53.782682 -33.158523 -46.401023 -36.989364
50 51 52 53 54 55 56
-54.031364 -59.753364 -44.377364 -53.127364 -81.657364 -45.899364 -4.631364
57 58
11.758636 15.776636
> postscript(file="/var/www/html/freestat/rcomp/tmp/6nxs81291028739.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 = 58
Frequency = 1
lag(myerror, k = 1) myerror
0 -63.816636 NA
1 -61.208636 -63.816636
2 -68.860636 -61.208636
3 -49.324636 -68.860636
4 -34.314636 -49.324636
5 -36.644636 -34.314636
6 -31.766636 -36.644636
7 -53.448636 -31.766636
8 -56.428636 -53.448636
9 -34.900636 -56.428636
10 -32.746477 -34.900636
11 -42.698977 -32.746477
12 -36.787318 -42.698977
13 -42.949318 -36.787318
14 -46.081318 -42.949318
15 -33.245318 -46.081318
16 -33.645318 -33.245318
17 -10.645318 -33.645318
18 2.332682 -10.645318
19 14.490682 2.332682
20 72.250682 14.490682
21 86.278682 72.250682
22 81.372841 86.278682
23 119.730341 81.372841
24 134.852000 119.730341
25 180.190000 134.852000
26 192.658000 180.190000
27 128.794000 192.658000
28 97.514000 128.794000
29 112.984000 97.514000
30 90.222000 112.984000
31 82.220000 90.222000
32 39.380000 82.220000
33 -13.372000 39.380000
34 -15.467841 -13.372000
35 -30.630341 -15.467841
36 2.741318 -30.630341
37 -22.000682 2.741318
38 -17.962682 -22.000682
39 -1.846682 -17.962682
40 23.573318 -1.846682
41 15.963318 23.573318
42 -14.888682 15.963318
43 -38.630682 -14.888682
44 -66.960682 -38.630682
45 -53.782682 -66.960682
46 -33.158523 -53.782682
47 -46.401023 -33.158523
48 -36.989364 -46.401023
49 -54.031364 -36.989364
50 -59.753364 -54.031364
51 -44.377364 -59.753364
52 -53.127364 -44.377364
53 -81.657364 -53.127364
54 -45.899364 -81.657364
55 -4.631364 -45.899364
56 11.758636 -4.631364
57 15.776636 11.758636
58 NA 15.776636
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -61.208636 -63.816636
[2,] -68.860636 -61.208636
[3,] -49.324636 -68.860636
[4,] -34.314636 -49.324636
[5,] -36.644636 -34.314636
[6,] -31.766636 -36.644636
[7,] -53.448636 -31.766636
[8,] -56.428636 -53.448636
[9,] -34.900636 -56.428636
[10,] -32.746477 -34.900636
[11,] -42.698977 -32.746477
[12,] -36.787318 -42.698977
[13,] -42.949318 -36.787318
[14,] -46.081318 -42.949318
[15,] -33.245318 -46.081318
[16,] -33.645318 -33.245318
[17,] -10.645318 -33.645318
[18,] 2.332682 -10.645318
[19,] 14.490682 2.332682
[20,] 72.250682 14.490682
[21,] 86.278682 72.250682
[22,] 81.372841 86.278682
[23,] 119.730341 81.372841
[24,] 134.852000 119.730341
[25,] 180.190000 134.852000
[26,] 192.658000 180.190000
[27,] 128.794000 192.658000
[28,] 97.514000 128.794000
[29,] 112.984000 97.514000
[30,] 90.222000 112.984000
[31,] 82.220000 90.222000
[32,] 39.380000 82.220000
[33,] -13.372000 39.380000
[34,] -15.467841 -13.372000
[35,] -30.630341 -15.467841
[36,] 2.741318 -30.630341
[37,] -22.000682 2.741318
[38,] -17.962682 -22.000682
[39,] -1.846682 -17.962682
[40,] 23.573318 -1.846682
[41,] 15.963318 23.573318
[42,] -14.888682 15.963318
[43,] -38.630682 -14.888682
[44,] -66.960682 -38.630682
[45,] -53.782682 -66.960682
[46,] -33.158523 -53.782682
[47,] -46.401023 -33.158523
[48,] -36.989364 -46.401023
[49,] -54.031364 -36.989364
[50,] -59.753364 -54.031364
[51,] -44.377364 -59.753364
[52,] -53.127364 -44.377364
[53,] -81.657364 -53.127364
[54,] -45.899364 -81.657364
[55,] -4.631364 -45.899364
[56,] 11.758636 -4.631364
[57,] 15.776636 11.758636
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -61.208636 -63.816636
2 -68.860636 -61.208636
3 -49.324636 -68.860636
4 -34.314636 -49.324636
5 -36.644636 -34.314636
6 -31.766636 -36.644636
7 -53.448636 -31.766636
8 -56.428636 -53.448636
9 -34.900636 -56.428636
10 -32.746477 -34.900636
11 -42.698977 -32.746477
12 -36.787318 -42.698977
13 -42.949318 -36.787318
14 -46.081318 -42.949318
15 -33.245318 -46.081318
16 -33.645318 -33.245318
17 -10.645318 -33.645318
18 2.332682 -10.645318
19 14.490682 2.332682
20 72.250682 14.490682
21 86.278682 72.250682
22 81.372841 86.278682
23 119.730341 81.372841
24 134.852000 119.730341
25 180.190000 134.852000
26 192.658000 180.190000
27 128.794000 192.658000
28 97.514000 128.794000
29 112.984000 97.514000
30 90.222000 112.984000
31 82.220000 90.222000
32 39.380000 82.220000
33 -13.372000 39.380000
34 -15.467841 -13.372000
35 -30.630341 -15.467841
36 2.741318 -30.630341
37 -22.000682 2.741318
38 -17.962682 -22.000682
39 -1.846682 -17.962682
40 23.573318 -1.846682
41 15.963318 23.573318
42 -14.888682 15.963318
43 -38.630682 -14.888682
44 -66.960682 -38.630682
45 -53.782682 -66.960682
46 -33.158523 -53.782682
47 -46.401023 -33.158523
48 -36.989364 -46.401023
49 -54.031364 -36.989364
50 -59.753364 -54.031364
51 -44.377364 -59.753364
52 -53.127364 -44.377364
53 -81.657364 -53.127364
54 -45.899364 -81.657364
55 -4.631364 -45.899364
56 11.758636 -4.631364
57 15.776636 11.758636
> 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/freestat/rcomp/tmp/7g79u1291028739.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/freestat/rcomp/tmp/8g79u1291028739.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/freestat/rcomp/tmp/9g79u1291028739.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/freestat/rcomp/tmp/10rgre1291028739.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11uy7k1291028739.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/freestat/rcomp/tmp/12gz581291028739.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/freestat/rcomp/tmp/134ik21291028739.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/freestat/rcomp/tmp/14f9k51291028739.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/freestat/rcomp/tmp/15ja0b1291028739.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/freestat/rcomp/tmp/16xjy21291028739.tab")
+ }
>
> try(system("convert tmp/1kxcl1291028739.ps tmp/1kxcl1291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/2v6b61291028739.ps tmp/2v6b61291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/3v6b61291028739.ps tmp/3v6b61291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/4v6b61291028739.ps tmp/4v6b61291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/5v6b61291028739.ps tmp/5v6b61291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/6nxs81291028739.ps tmp/6nxs81291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/7g79u1291028739.ps tmp/7g79u1291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/8g79u1291028739.ps tmp/8g79u1291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/9g79u1291028739.ps tmp/9g79u1291028739.png",intern=TRUE))
character(0)
> try(system("convert tmp/10rgre1291028739.ps tmp/10rgre1291028739.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.775 2.471 4.263