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(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.1,198.31,195.72,223.04,238.41,259.73,326.54,335.15,321.81,368.62,369.59,425,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.7,253.41,224.95,210.37,191.09,198.85,211.04,206.25),dim=c(1,48),dimnames=list(c('Tarweprijs'),1:48))
> y <- array(NA,dim=c(1,48),dimnames=list(c('Tarweprijs'),1:48))
> 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
Tarweprijs 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
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
208.365 8.419 21.369 23.670 4.817 3.433
M6 M7 M8 M9 M10 M11
13.503 5.573 3.036 6.607 -1.198 -7.070
t
1.382
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-86.08 -48.59 -26.02 44.07 170.37
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 208.3646 46.1157 4.518 6.81e-05 ***
M1 8.4190 55.5557 0.152 0.880
M2 21.3693 55.4242 0.386 0.702
M3 23.6696 55.3049 0.428 0.671
M4 4.8174 55.1980 0.087 0.931
M5 3.4328 55.1035 0.062 0.951
M6 13.5031 55.0215 0.245 0.808
M7 5.5734 54.9519 0.101 0.920
M8 3.0362 54.8950 0.055 0.956
M9 6.6065 54.8507 0.120 0.905
M10 -1.1981 54.8190 -0.022 0.983
M11 -7.0703 54.8000 -0.129 0.898
t 1.3822 0.8337 1.658 0.106
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 77.49 on 35 degrees of freedom
Multiple R-squared: 0.07978, Adjusted R-squared: -0.2357
F-statistic: 0.2529 on 12 and 35 DF, p-value: 0.993
> 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.0001720264 0.0003440529 0.99982797
[2,] 0.0003439360 0.0006878720 0.99965606
[3,] 0.0001016714 0.0002033428 0.99989833
[4,] 0.0000815433 0.0001630866 0.99991846
[5,] 0.0034320814 0.0068641628 0.99656792
[6,] 0.1251046654 0.2502093308 0.87489533
[7,] 0.2009015455 0.4018030911 0.79909845
[8,] 0.2301133655 0.4602267310 0.76988663
[9,] 0.3409353285 0.6818706571 0.65906467
[10,] 0.3826143075 0.7652286151 0.61738569
[11,] 0.6516778295 0.6966443410 0.34832217
[12,] 0.9251042981 0.1497914038 0.07489570
[13,] 0.9166029346 0.1667941307 0.08339707
[14,] 0.8452959380 0.3094081240 0.15470406
[15,] 0.7580074908 0.4839850184 0.24199251
[16,] 0.6862399408 0.6275201183 0.31376006
[17,] 0.7387794482 0.5224411035 0.26122055
> postscript(file="/var/www/html/rcomp/tmp/14zv21290940195.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/24zv21290940195.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/34zv21290940195.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/4fqu51290940195.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/5fqu51290940195.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 = 48
Frequency = 1
1 2 3 4 5 6 7
-51.005750 -52.658250 -61.740750 -38.360750 -25.538250 -35.000750 -21.183250
8 9 10 11 12 13 14
-32.548250 -31.430750 -8.898250 -10.688250 -20.640750 -38.681917 -49.104417
15 16 17 18 19 20 21
-53.666917 -36.986917 -39.574417 -23.706917 -1.789417 20.685583 82.543083
22 23 24 25 26 27 28
97.575583 88.725583 127.083083 118.251917 159.329417 170.366917 110.346917
29 30 31 32 33 34 35
76.879417 85.216917 71.394417 73.709417 34.966917 -16.780583 -22.820583
36 37 38 39 40 41 42
-37.983083 -28.564250 -57.566750 -54.959250 -34.999250 -11.766750 -26.509250
43 44 45 46 47 48
-48.421750 -61.846750 -86.079250 -71.896750 -55.216750 -68.459250
> postscript(file="/var/www/html/rcomp/tmp/6fqu51290940195.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 = 48
Frequency = 1
lag(myerror, k = 1) myerror
0 -51.005750 NA
1 -52.658250 -51.005750
2 -61.740750 -52.658250
3 -38.360750 -61.740750
4 -25.538250 -38.360750
5 -35.000750 -25.538250
6 -21.183250 -35.000750
7 -32.548250 -21.183250
8 -31.430750 -32.548250
9 -8.898250 -31.430750
10 -10.688250 -8.898250
11 -20.640750 -10.688250
12 -38.681917 -20.640750
13 -49.104417 -38.681917
14 -53.666917 -49.104417
15 -36.986917 -53.666917
16 -39.574417 -36.986917
17 -23.706917 -39.574417
18 -1.789417 -23.706917
19 20.685583 -1.789417
20 82.543083 20.685583
21 97.575583 82.543083
22 88.725583 97.575583
23 127.083083 88.725583
24 118.251917 127.083083
25 159.329417 118.251917
26 170.366917 159.329417
27 110.346917 170.366917
28 76.879417 110.346917
29 85.216917 76.879417
30 71.394417 85.216917
31 73.709417 71.394417
32 34.966917 73.709417
33 -16.780583 34.966917
34 -22.820583 -16.780583
35 -37.983083 -22.820583
36 -28.564250 -37.983083
37 -57.566750 -28.564250
38 -54.959250 -57.566750
39 -34.999250 -54.959250
40 -11.766750 -34.999250
41 -26.509250 -11.766750
42 -48.421750 -26.509250
43 -61.846750 -48.421750
44 -86.079250 -61.846750
45 -71.896750 -86.079250
46 -55.216750 -71.896750
47 -68.459250 -55.216750
48 NA -68.459250
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -52.658250 -51.005750
[2,] -61.740750 -52.658250
[3,] -38.360750 -61.740750
[4,] -25.538250 -38.360750
[5,] -35.000750 -25.538250
[6,] -21.183250 -35.000750
[7,] -32.548250 -21.183250
[8,] -31.430750 -32.548250
[9,] -8.898250 -31.430750
[10,] -10.688250 -8.898250
[11,] -20.640750 -10.688250
[12,] -38.681917 -20.640750
[13,] -49.104417 -38.681917
[14,] -53.666917 -49.104417
[15,] -36.986917 -53.666917
[16,] -39.574417 -36.986917
[17,] -23.706917 -39.574417
[18,] -1.789417 -23.706917
[19,] 20.685583 -1.789417
[20,] 82.543083 20.685583
[21,] 97.575583 82.543083
[22,] 88.725583 97.575583
[23,] 127.083083 88.725583
[24,] 118.251917 127.083083
[25,] 159.329417 118.251917
[26,] 170.366917 159.329417
[27,] 110.346917 170.366917
[28,] 76.879417 110.346917
[29,] 85.216917 76.879417
[30,] 71.394417 85.216917
[31,] 73.709417 71.394417
[32,] 34.966917 73.709417
[33,] -16.780583 34.966917
[34,] -22.820583 -16.780583
[35,] -37.983083 -22.820583
[36,] -28.564250 -37.983083
[37,] -57.566750 -28.564250
[38,] -54.959250 -57.566750
[39,] -34.999250 -54.959250
[40,] -11.766750 -34.999250
[41,] -26.509250 -11.766750
[42,] -48.421750 -26.509250
[43,] -61.846750 -48.421750
[44,] -86.079250 -61.846750
[45,] -71.896750 -86.079250
[46,] -55.216750 -71.896750
[47,] -68.459250 -55.216750
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -52.658250 -51.005750
2 -61.740750 -52.658250
3 -38.360750 -61.740750
4 -25.538250 -38.360750
5 -35.000750 -25.538250
6 -21.183250 -35.000750
7 -32.548250 -21.183250
8 -31.430750 -32.548250
9 -8.898250 -31.430750
10 -10.688250 -8.898250
11 -20.640750 -10.688250
12 -38.681917 -20.640750
13 -49.104417 -38.681917
14 -53.666917 -49.104417
15 -36.986917 -53.666917
16 -39.574417 -36.986917
17 -23.706917 -39.574417
18 -1.789417 -23.706917
19 20.685583 -1.789417
20 82.543083 20.685583
21 97.575583 82.543083
22 88.725583 97.575583
23 127.083083 88.725583
24 118.251917 127.083083
25 159.329417 118.251917
26 170.366917 159.329417
27 110.346917 170.366917
28 76.879417 110.346917
29 85.216917 76.879417
30 71.394417 85.216917
31 73.709417 71.394417
32 34.966917 73.709417
33 -16.780583 34.966917
34 -22.820583 -16.780583
35 -37.983083 -22.820583
36 -28.564250 -37.983083
37 -57.566750 -28.564250
38 -54.959250 -57.566750
39 -34.999250 -54.959250
40 -11.766750 -34.999250
41 -26.509250 -11.766750
42 -48.421750 -26.509250
43 -61.846750 -48.421750
44 -86.079250 -61.846750
45 -71.896750 -86.079250
46 -55.216750 -71.896750
47 -68.459250 -55.216750
> 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/78ib81290940195.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/8irab1290940195.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/9irab1290940195.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/10irab1290940195.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/11wjqk1290940195.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/12ijoq1290940195.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/13etmz1290940195.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/14hbl41290940195.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/153ujb1290940195.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/16odiy1290940195.tab")
+ }
>
> try(system("convert tmp/14zv21290940195.ps tmp/14zv21290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/24zv21290940195.ps tmp/24zv21290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/34zv21290940195.ps tmp/34zv21290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/4fqu51290940195.ps tmp/4fqu51290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/5fqu51290940195.ps tmp/5fqu51290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/6fqu51290940195.ps tmp/6fqu51290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/78ib81290940195.ps tmp/78ib81290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/8irab1290940195.ps tmp/8irab1290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/9irab1290940195.ps tmp/9irab1290940195.png",intern=TRUE))
character(0)
> try(system("convert tmp/10irab1290940195.ps tmp/10irab1290940195.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.310 1.548 5.870