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(93.0,0,99.2,0,112.2,0,112.1,0,103.3,0,108.2,0,90.4,0,72.8,0,111.0,0,117.9,0,111.3,0,110.5,0,94.8,0,100.4,0,132.1,0,114.6,0,101.9,0,130.2,0,84.0,0,86.4,0,122.3,0,120.9,0,110.2,0,112.6,0,102.0,0,105.0,0,130.5,0,115.5,0,103.7,0,130.9,0,89.1,0,93.8,0,123.8,0,111.9,0,118.3,0,116.9,0,103.6,1,116.6,1,141.3,1,107.0,1,125.2,1,136.4,1,91.6,1,95.3,1,132.3,1,130.6,1,131.9,1,118.6,1,114.3,1,111.3,1,126.5,1,112.1,1,119.3,1,142.4,1,101.1,1,97.4,1,129.1,1,136.9,1,129.8,1,123.9,1),dim=c(2,60),dimnames=list(c('INV','INVA'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('INV','INVA'),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
INV INVA
1 93.0 0
2 99.2 0
3 112.2 0
4 112.1 0
5 103.3 0
6 108.2 0
7 90.4 0
8 72.8 0
9 111.0 0
10 117.9 0
11 111.3 0
12 110.5 0
13 94.8 0
14 100.4 0
15 132.1 0
16 114.6 0
17 101.9 0
18 130.2 0
19 84.0 0
20 86.4 0
21 122.3 0
22 120.9 0
23 110.2 0
24 112.6 0
25 102.0 0
26 105.0 0
27 130.5 0
28 115.5 0
29 103.7 0
30 130.9 0
31 89.1 0
32 93.8 0
33 123.8 0
34 111.9 0
35 118.3 0
36 116.9 0
37 103.6 1
38 116.6 1
39 141.3 1
40 107.0 1
41 125.2 1
42 136.4 1
43 91.6 1
44 95.3 1
45 132.3 1
46 130.6 1
47 131.9 1
48 118.6 1
49 114.3 1
50 111.3 1
51 126.5 1
52 112.1 1
53 119.3 1
54 142.4 1
55 101.1 1
56 97.4 1
57 129.1 1
58 136.9 1
59 129.8 1
60 123.9 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) INVA
108.16 11.61
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-35.358 -8.593 2.592 10.057 23.942
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 108.158 2.407 44.928 < 2e-16 ***
INVA 11.613 3.806 3.051 0.00344 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 14.44 on 58 degrees of freedom
Multiple R-squared: 0.1383, Adjusted R-squared: 0.1234
F-statistic: 9.307 on 1 and 58 DF, p-value: 0.003439
> 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.2592408 0.5184816 0.7407592
[2,] 0.1395563 0.2791127 0.8604437
[3,] 0.1665345 0.3330690 0.8334655
[4,] 0.5893392 0.8213216 0.4106608
[5,] 0.5332696 0.9334609 0.4667304
[6,] 0.5526329 0.8947343 0.4473671
[7,] 0.4778040 0.9556081 0.5221960
[8,] 0.3968549 0.7937097 0.6031451
[9,] 0.3481276 0.6962552 0.6518724
[10,] 0.2721158 0.5442316 0.7278842
[11,] 0.5061633 0.9876733 0.4938367
[12,] 0.4476718 0.8953435 0.5523282
[13,] 0.3720325 0.7440651 0.6279675
[14,] 0.5036748 0.9926505 0.4963252
[15,] 0.6264494 0.7471013 0.3735506
[16,] 0.7059287 0.5881426 0.2940713
[17,] 0.7089361 0.5821277 0.2910639
[18,] 0.6944405 0.6111190 0.3055595
[19,] 0.6258243 0.7483513 0.3741757
[20,] 0.5580850 0.8838301 0.4419150
[21,] 0.4993741 0.9987482 0.5006259
[22,] 0.4319396 0.8638793 0.5680604
[23,] 0.5205241 0.9589519 0.4794759
[24,] 0.4598242 0.9196484 0.5401758
[25,] 0.3965345 0.7930690 0.6034655
[26,] 0.4862183 0.9724366 0.5137817
[27,] 0.5526722 0.8946557 0.4473278
[28,] 0.5929339 0.8141322 0.4070661
[29,] 0.5692682 0.8614637 0.4307318
[30,] 0.4996887 0.9993775 0.5003113
[31,] 0.4392837 0.8785674 0.5607163
[32,] 0.3748701 0.7497403 0.6251299
[33,] 0.3543247 0.7086495 0.6456753
[34,] 0.2971106 0.5942212 0.7028894
[35,] 0.3957124 0.7914248 0.6042876
[36,] 0.3722964 0.7445929 0.6277036
[37,] 0.3084435 0.6168870 0.6915565
[38,] 0.3233014 0.6466028 0.6766986
[39,] 0.5351689 0.9296621 0.4648311
[40,] 0.7034386 0.5931228 0.2965614
[41,] 0.6780151 0.6439698 0.3219849
[42,] 0.6338464 0.7323072 0.3661536
[43,] 0.6006098 0.7987803 0.3993902
[44,] 0.5022786 0.9954427 0.4977214
[45,] 0.4162590 0.8325181 0.5837410
[46,] 0.3545950 0.7091900 0.6454050
[47,] 0.2678389 0.5356778 0.7321611
[48,] 0.2079350 0.4158700 0.7920650
[49,] 0.1322862 0.2645725 0.8677138
[50,] 0.1810447 0.3620894 0.8189553
[51,] 0.2290846 0.4581692 0.7709154
> postscript(file="/var/www/html/freestat/rcomp/tmp/14uq71229618873.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/2dcnh1229618873.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/3qe0l1229618873.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/4h9pd1229618873.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/55zos1229618873.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
-15.15833333 -8.95833333 4.04166667 3.94166667 -4.85833333 0.04166667
7 8 9 10 11 12
-17.75833333 -35.35833333 2.84166667 9.74166667 3.14166667 2.34166667
13 14 15 16 17 18
-13.35833333 -7.75833333 23.94166667 6.44166667 -6.25833333 22.04166667
19 20 21 22 23 24
-24.15833333 -21.75833333 14.14166667 12.74166667 2.04166667 4.44166667
25 26 27 28 29 30
-6.15833333 -3.15833333 22.34166667 7.34166667 -4.45833333 22.74166667
31 32 33 34 35 36
-19.05833333 -14.35833333 15.64166667 3.74166667 10.14166667 8.74166667
37 38 39 40 41 42
-16.17083333 -3.17083333 21.52916667 -12.77083333 5.42916667 16.62916667
43 44 45 46 47 48
-28.17083333 -24.47083333 12.52916667 10.82916667 12.12916667 -1.17083333
49 50 51 52 53 54
-5.47083333 -8.47083333 6.72916667 -7.67083333 -0.47083333 22.62916667
55 56 57 58 59 60
-18.67083333 -22.37083333 9.32916667 17.12916667 10.02916667 4.12916667
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ckkh1229618873.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 -15.15833333 NA
1 -8.95833333 -15.15833333
2 4.04166667 -8.95833333
3 3.94166667 4.04166667
4 -4.85833333 3.94166667
5 0.04166667 -4.85833333
6 -17.75833333 0.04166667
7 -35.35833333 -17.75833333
8 2.84166667 -35.35833333
9 9.74166667 2.84166667
10 3.14166667 9.74166667
11 2.34166667 3.14166667
12 -13.35833333 2.34166667
13 -7.75833333 -13.35833333
14 23.94166667 -7.75833333
15 6.44166667 23.94166667
16 -6.25833333 6.44166667
17 22.04166667 -6.25833333
18 -24.15833333 22.04166667
19 -21.75833333 -24.15833333
20 14.14166667 -21.75833333
21 12.74166667 14.14166667
22 2.04166667 12.74166667
23 4.44166667 2.04166667
24 -6.15833333 4.44166667
25 -3.15833333 -6.15833333
26 22.34166667 -3.15833333
27 7.34166667 22.34166667
28 -4.45833333 7.34166667
29 22.74166667 -4.45833333
30 -19.05833333 22.74166667
31 -14.35833333 -19.05833333
32 15.64166667 -14.35833333
33 3.74166667 15.64166667
34 10.14166667 3.74166667
35 8.74166667 10.14166667
36 -16.17083333 8.74166667
37 -3.17083333 -16.17083333
38 21.52916667 -3.17083333
39 -12.77083333 21.52916667
40 5.42916667 -12.77083333
41 16.62916667 5.42916667
42 -28.17083333 16.62916667
43 -24.47083333 -28.17083333
44 12.52916667 -24.47083333
45 10.82916667 12.52916667
46 12.12916667 10.82916667
47 -1.17083333 12.12916667
48 -5.47083333 -1.17083333
49 -8.47083333 -5.47083333
50 6.72916667 -8.47083333
51 -7.67083333 6.72916667
52 -0.47083333 -7.67083333
53 22.62916667 -0.47083333
54 -18.67083333 22.62916667
55 -22.37083333 -18.67083333
56 9.32916667 -22.37083333
57 17.12916667 9.32916667
58 10.02916667 17.12916667
59 4.12916667 10.02916667
60 NA 4.12916667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -8.95833333 -15.15833333
[2,] 4.04166667 -8.95833333
[3,] 3.94166667 4.04166667
[4,] -4.85833333 3.94166667
[5,] 0.04166667 -4.85833333
[6,] -17.75833333 0.04166667
[7,] -35.35833333 -17.75833333
[8,] 2.84166667 -35.35833333
[9,] 9.74166667 2.84166667
[10,] 3.14166667 9.74166667
[11,] 2.34166667 3.14166667
[12,] -13.35833333 2.34166667
[13,] -7.75833333 -13.35833333
[14,] 23.94166667 -7.75833333
[15,] 6.44166667 23.94166667
[16,] -6.25833333 6.44166667
[17,] 22.04166667 -6.25833333
[18,] -24.15833333 22.04166667
[19,] -21.75833333 -24.15833333
[20,] 14.14166667 -21.75833333
[21,] 12.74166667 14.14166667
[22,] 2.04166667 12.74166667
[23,] 4.44166667 2.04166667
[24,] -6.15833333 4.44166667
[25,] -3.15833333 -6.15833333
[26,] 22.34166667 -3.15833333
[27,] 7.34166667 22.34166667
[28,] -4.45833333 7.34166667
[29,] 22.74166667 -4.45833333
[30,] -19.05833333 22.74166667
[31,] -14.35833333 -19.05833333
[32,] 15.64166667 -14.35833333
[33,] 3.74166667 15.64166667
[34,] 10.14166667 3.74166667
[35,] 8.74166667 10.14166667
[36,] -16.17083333 8.74166667
[37,] -3.17083333 -16.17083333
[38,] 21.52916667 -3.17083333
[39,] -12.77083333 21.52916667
[40,] 5.42916667 -12.77083333
[41,] 16.62916667 5.42916667
[42,] -28.17083333 16.62916667
[43,] -24.47083333 -28.17083333
[44,] 12.52916667 -24.47083333
[45,] 10.82916667 12.52916667
[46,] 12.12916667 10.82916667
[47,] -1.17083333 12.12916667
[48,] -5.47083333 -1.17083333
[49,] -8.47083333 -5.47083333
[50,] 6.72916667 -8.47083333
[51,] -7.67083333 6.72916667
[52,] -0.47083333 -7.67083333
[53,] 22.62916667 -0.47083333
[54,] -18.67083333 22.62916667
[55,] -22.37083333 -18.67083333
[56,] 9.32916667 -22.37083333
[57,] 17.12916667 9.32916667
[58,] 10.02916667 17.12916667
[59,] 4.12916667 10.02916667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -8.95833333 -15.15833333
2 4.04166667 -8.95833333
3 3.94166667 4.04166667
4 -4.85833333 3.94166667
5 0.04166667 -4.85833333
6 -17.75833333 0.04166667
7 -35.35833333 -17.75833333
8 2.84166667 -35.35833333
9 9.74166667 2.84166667
10 3.14166667 9.74166667
11 2.34166667 3.14166667
12 -13.35833333 2.34166667
13 -7.75833333 -13.35833333
14 23.94166667 -7.75833333
15 6.44166667 23.94166667
16 -6.25833333 6.44166667
17 22.04166667 -6.25833333
18 -24.15833333 22.04166667
19 -21.75833333 -24.15833333
20 14.14166667 -21.75833333
21 12.74166667 14.14166667
22 2.04166667 12.74166667
23 4.44166667 2.04166667
24 -6.15833333 4.44166667
25 -3.15833333 -6.15833333
26 22.34166667 -3.15833333
27 7.34166667 22.34166667
28 -4.45833333 7.34166667
29 22.74166667 -4.45833333
30 -19.05833333 22.74166667
31 -14.35833333 -19.05833333
32 15.64166667 -14.35833333
33 3.74166667 15.64166667
34 10.14166667 3.74166667
35 8.74166667 10.14166667
36 -16.17083333 8.74166667
37 -3.17083333 -16.17083333
38 21.52916667 -3.17083333
39 -12.77083333 21.52916667
40 5.42916667 -12.77083333
41 16.62916667 5.42916667
42 -28.17083333 16.62916667
43 -24.47083333 -28.17083333
44 12.52916667 -24.47083333
45 10.82916667 12.52916667
46 12.12916667 10.82916667
47 -1.17083333 12.12916667
48 -5.47083333 -1.17083333
49 -8.47083333 -5.47083333
50 6.72916667 -8.47083333
51 -7.67083333 6.72916667
52 -0.47083333 -7.67083333
53 22.62916667 -0.47083333
54 -18.67083333 22.62916667
55 -22.37083333 -18.67083333
56 9.32916667 -22.37083333
57 17.12916667 9.32916667
58 10.02916667 17.12916667
59 4.12916667 10.02916667
> 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/79tqm1229618873.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/8jx1r1229618873.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/94qyo1229618873.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/10kpde1229618873.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/11usyr1229618873.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/12fwxm1229618873.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/13y9dm1229618874.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/14wjom1229618874.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/15zxa91229618874.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/16tibe1229618874.tab")
+ }
>
> system("convert tmp/14uq71229618873.ps tmp/14uq71229618873.png")
> system("convert tmp/2dcnh1229618873.ps tmp/2dcnh1229618873.png")
> system("convert tmp/3qe0l1229618873.ps tmp/3qe0l1229618873.png")
> system("convert tmp/4h9pd1229618873.ps tmp/4h9pd1229618873.png")
> system("convert tmp/55zos1229618873.ps tmp/55zos1229618873.png")
> system("convert tmp/6ckkh1229618873.ps tmp/6ckkh1229618873.png")
> system("convert tmp/79tqm1229618873.ps tmp/79tqm1229618873.png")
> system("convert tmp/8jx1r1229618873.ps tmp/8jx1r1229618873.png")
> system("convert tmp/94qyo1229618873.ps tmp/94qyo1229618873.png")
> system("convert tmp/10kpde1229618873.ps tmp/10kpde1229618873.png")
>
>
> proc.time()
user system elapsed
3.676 2.492 4.019