R version 2.11.1 (2010-05-31)
Copyright (C) 2010 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(47.54,0,45.31,0,46.9,0,47.16,0,48.24,0,52.7,0,51.72,0,51.5,0,52.45,0,53,0,48.36,0,46.63,0,45.92,0,45.53,0,42.17,0,43.66,0,45.32,0,47.43,0,47.76,0,49.49,0,50.69,0,49.8,0,52.13,0,53.94,0,60.75,0,59.19,0,57.58,0,59.16,0,64.74,0,67.04,0,75.53,0,78.91,0,78.4,0,70.07,0,66.8,0,61.02,0,52.38,0,42.37,0,39.83,0,38.79,0,37.33,0,39.4,0,39.45,0,43.24,0,42.33,0,45.5,0,43.44,0,43.88,0,45.61,0,45.12,0,47.56,1,47.04,1,51.07,1,54.72,1,55.37,1,55.39,1,53.13,1,53.71,1,54.59,1,54.61,1),dim=c(2,60),dimnames=list(c('Y','X
'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X
'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
Y X\r
1 47.54 0
2 45.31 0
3 46.90 0
4 47.16 0
5 48.24 0
6 52.70 0
7 51.72 0
8 51.50 0
9 52.45 0
10 53.00 0
11 48.36 0
12 46.63 0
13 45.92 0
14 45.53 0
15 42.17 0
16 43.66 0
17 45.32 0
18 47.43 0
19 47.76 0
20 49.49 0
21 50.69 0
22 49.80 0
23 52.13 0
24 53.94 0
25 60.75 0
26 59.19 0
27 57.58 0
28 59.16 0
29 64.74 0
30 67.04 0
31 75.53 0
32 78.91 0
33 78.40 0
34 70.07 0
35 66.80 0
36 61.02 0
37 52.38 0
38 42.37 0
39 39.83 0
40 38.79 0
41 37.33 0
42 39.40 0
43 39.45 0
44 43.24 0
45 42.33 0
46 45.50 0
47 43.44 0
48 43.88 0
49 45.61 0
50 45.12 0
51 47.56 1
52 47.04 1
53 51.07 1
54 54.72 1
55 55.37 1
56 55.39 1
57 53.13 1
58 53.71 1
59 54.59 1
60 54.61 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `X\r`
51.264 1.455
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13.934 -5.809 -1.712 2.163 27.646
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 51.264 1.335 38.409 <2e-16 ***
`X\r` 1.455 3.269 0.445 0.658
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.438 on 58 degrees of freedom
Multiple R-squared: 0.003402, Adjusted R-squared: -0.01378
F-statistic: 0.198 on 1 and 58 DF, p-value: 0.658
> 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.913941e-03 5.827881e-03 9.970861e-01
[2,] 1.212552e-02 2.425103e-02 9.878745e-01
[3,] 6.143324e-03 1.228665e-02 9.938567e-01
[4,] 2.475267e-03 4.950534e-03 9.975247e-01
[5,] 1.202508e-03 2.405016e-03 9.987975e-01
[6,] 6.143971e-04 1.228794e-03 9.993856e-01
[7,] 1.801641e-04 3.603282e-04 9.998198e-01
[8,] 7.344883e-05 1.468977e-04 9.999266e-01
[9,] 3.506708e-05 7.013416e-05 9.999649e-01
[10,] 1.762389e-05 3.524779e-05 9.999824e-01
[11,] 3.513912e-05 7.027825e-05 9.999649e-01
[12,] 2.580757e-05 5.161515e-05 9.999742e-01
[13,] 1.105837e-05 2.211675e-05 9.999889e-01
[14,] 3.465760e-06 6.931520e-06 9.999965e-01
[15,] 1.039109e-06 2.078218e-06 9.999990e-01
[16,] 3.295277e-07 6.590555e-07 9.999997e-01
[17,] 1.253385e-07 2.506771e-07 9.999999e-01
[18,] 3.880519e-08 7.761037e-08 1.000000e+00
[19,] 2.073368e-08 4.146737e-08 1.000000e+00
[20,] 2.081043e-08 4.162086e-08 1.000000e+00
[21,] 7.064310e-07 1.412862e-06 9.999993e-01
[22,] 2.440067e-06 4.880133e-06 9.999976e-01
[23,] 3.129011e-06 6.258022e-06 9.999969e-01
[24,] 5.439452e-06 1.087890e-05 9.999946e-01
[25,] 4.863016e-05 9.726032e-05 9.999514e-01
[26,] 4.280029e-04 8.560058e-04 9.995720e-01
[27,] 1.855458e-02 3.710917e-02 9.814454e-01
[28,] 2.704190e-01 5.408380e-01 7.295810e-01
[29,] 8.371980e-01 3.256039e-01 1.628020e-01
[30,] 9.798864e-01 4.022725e-02 2.011363e-02
[31,] 9.995704e-01 8.592666e-04 4.296333e-04
[32,] 9.999983e-01 3.306187e-06 1.653094e-06
[33,] 9.999999e-01 1.861441e-07 9.307205e-08
[34,] 9.999998e-01 4.529866e-07 2.264933e-07
[35,] 9.999996e-01 7.792599e-07 3.896300e-07
[36,] 9.999995e-01 9.412016e-07 4.706008e-07
[37,] 9.999998e-01 4.366722e-07 2.183361e-07
[38,] 9.999997e-01 5.022789e-07 2.511394e-07
[39,] 9.999998e-01 4.418742e-07 2.209371e-07
[40,] 9.999992e-01 1.584421e-06 7.922106e-07
[41,] 9.999978e-01 4.321254e-06 2.160627e-06
[42,] 9.999919e-01 1.616241e-05 8.081206e-06
[43,] 9.999728e-01 5.448237e-05 2.724119e-05
[44,] 9.999091e-01 1.818535e-04 9.092674e-05
[45,] 9.996790e-01 6.420827e-04 3.210413e-04
[46,] 9.989210e-01 2.157997e-03 1.078999e-03
[47,] 9.990535e-01 1.892907e-03 9.464535e-04
[48,] 9.999368e-01 1.264686e-04 6.323432e-05
[49,] 9.999805e-01 3.894600e-05 1.947300e-05
[50,] 9.997818e-01 4.363349e-04 2.181675e-04
[51,] 9.984850e-01 3.030058e-03 1.515029e-03
> postscript(file="/var/www/rcomp/tmp/1cb6c1290878451.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/rcomp/tmp/252nf1290878451.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/rcomp/tmp/352nf1290878451.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/rcomp/tmp/452nf1290878451.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/rcomp/tmp/5xtmz1290878451.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 7 8
-3.7242 -5.9542 -4.3642 -4.1042 -3.0242 1.4358 0.4558 0.2358
9 10 11 12 13 14 15 16
1.1858 1.7358 -2.9042 -4.6342 -5.3442 -5.7342 -9.0942 -7.6042
17 18 19 20 21 22 23 24
-5.9442 -3.8342 -3.5042 -1.7742 -0.5742 -1.4642 0.8658 2.6758
25 26 27 28 29 30 31 32
9.4858 7.9258 6.3158 7.8958 13.4758 15.7758 24.2658 27.6458
33 34 35 36 37 38 39 40
27.1358 18.8058 15.5358 9.7558 1.1158 -8.8942 -11.4342 -12.4742
41 42 43 44 45 46 47 48
-13.9342 -11.8642 -11.8142 -8.0242 -8.9342 -5.7642 -7.8242 -7.3842
49 50 51 52 53 54 55 56
-5.6542 -6.1442 -5.1590 -5.6790 -1.6490 2.0010 2.6510 2.6710
57 58 59 60
0.4110 0.9910 1.8710 1.8910
> postscript(file="/var/www/rcomp/tmp/6xtmz1290878451.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 -3.7242 NA
1 -5.9542 -3.7242
2 -4.3642 -5.9542
3 -4.1042 -4.3642
4 -3.0242 -4.1042
5 1.4358 -3.0242
6 0.4558 1.4358
7 0.2358 0.4558
8 1.1858 0.2358
9 1.7358 1.1858
10 -2.9042 1.7358
11 -4.6342 -2.9042
12 -5.3442 -4.6342
13 -5.7342 -5.3442
14 -9.0942 -5.7342
15 -7.6042 -9.0942
16 -5.9442 -7.6042
17 -3.8342 -5.9442
18 -3.5042 -3.8342
19 -1.7742 -3.5042
20 -0.5742 -1.7742
21 -1.4642 -0.5742
22 0.8658 -1.4642
23 2.6758 0.8658
24 9.4858 2.6758
25 7.9258 9.4858
26 6.3158 7.9258
27 7.8958 6.3158
28 13.4758 7.8958
29 15.7758 13.4758
30 24.2658 15.7758
31 27.6458 24.2658
32 27.1358 27.6458
33 18.8058 27.1358
34 15.5358 18.8058
35 9.7558 15.5358
36 1.1158 9.7558
37 -8.8942 1.1158
38 -11.4342 -8.8942
39 -12.4742 -11.4342
40 -13.9342 -12.4742
41 -11.8642 -13.9342
42 -11.8142 -11.8642
43 -8.0242 -11.8142
44 -8.9342 -8.0242
45 -5.7642 -8.9342
46 -7.8242 -5.7642
47 -7.3842 -7.8242
48 -5.6542 -7.3842
49 -6.1442 -5.6542
50 -5.1590 -6.1442
51 -5.6790 -5.1590
52 -1.6490 -5.6790
53 2.0010 -1.6490
54 2.6510 2.0010
55 2.6710 2.6510
56 0.4110 2.6710
57 0.9910 0.4110
58 1.8710 0.9910
59 1.8910 1.8710
60 NA 1.8910
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -5.9542 -3.7242
[2,] -4.3642 -5.9542
[3,] -4.1042 -4.3642
[4,] -3.0242 -4.1042
[5,] 1.4358 -3.0242
[6,] 0.4558 1.4358
[7,] 0.2358 0.4558
[8,] 1.1858 0.2358
[9,] 1.7358 1.1858
[10,] -2.9042 1.7358
[11,] -4.6342 -2.9042
[12,] -5.3442 -4.6342
[13,] -5.7342 -5.3442
[14,] -9.0942 -5.7342
[15,] -7.6042 -9.0942
[16,] -5.9442 -7.6042
[17,] -3.8342 -5.9442
[18,] -3.5042 -3.8342
[19,] -1.7742 -3.5042
[20,] -0.5742 -1.7742
[21,] -1.4642 -0.5742
[22,] 0.8658 -1.4642
[23,] 2.6758 0.8658
[24,] 9.4858 2.6758
[25,] 7.9258 9.4858
[26,] 6.3158 7.9258
[27,] 7.8958 6.3158
[28,] 13.4758 7.8958
[29,] 15.7758 13.4758
[30,] 24.2658 15.7758
[31,] 27.6458 24.2658
[32,] 27.1358 27.6458
[33,] 18.8058 27.1358
[34,] 15.5358 18.8058
[35,] 9.7558 15.5358
[36,] 1.1158 9.7558
[37,] -8.8942 1.1158
[38,] -11.4342 -8.8942
[39,] -12.4742 -11.4342
[40,] -13.9342 -12.4742
[41,] -11.8642 -13.9342
[42,] -11.8142 -11.8642
[43,] -8.0242 -11.8142
[44,] -8.9342 -8.0242
[45,] -5.7642 -8.9342
[46,] -7.8242 -5.7642
[47,] -7.3842 -7.8242
[48,] -5.6542 -7.3842
[49,] -6.1442 -5.6542
[50,] -5.1590 -6.1442
[51,] -5.6790 -5.1590
[52,] -1.6490 -5.6790
[53,] 2.0010 -1.6490
[54,] 2.6510 2.0010
[55,] 2.6710 2.6510
[56,] 0.4110 2.6710
[57,] 0.9910 0.4110
[58,] 1.8710 0.9910
[59,] 1.8910 1.8710
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -5.9542 -3.7242
2 -4.3642 -5.9542
3 -4.1042 -4.3642
4 -3.0242 -4.1042
5 1.4358 -3.0242
6 0.4558 1.4358
7 0.2358 0.4558
8 1.1858 0.2358
9 1.7358 1.1858
10 -2.9042 1.7358
11 -4.6342 -2.9042
12 -5.3442 -4.6342
13 -5.7342 -5.3442
14 -9.0942 -5.7342
15 -7.6042 -9.0942
16 -5.9442 -7.6042
17 -3.8342 -5.9442
18 -3.5042 -3.8342
19 -1.7742 -3.5042
20 -0.5742 -1.7742
21 -1.4642 -0.5742
22 0.8658 -1.4642
23 2.6758 0.8658
24 9.4858 2.6758
25 7.9258 9.4858
26 6.3158 7.9258
27 7.8958 6.3158
28 13.4758 7.8958
29 15.7758 13.4758
30 24.2658 15.7758
31 27.6458 24.2658
32 27.1358 27.6458
33 18.8058 27.1358
34 15.5358 18.8058
35 9.7558 15.5358
36 1.1158 9.7558
37 -8.8942 1.1158
38 -11.4342 -8.8942
39 -12.4742 -11.4342
40 -13.9342 -12.4742
41 -11.8642 -13.9342
42 -11.8142 -11.8642
43 -8.0242 -11.8142
44 -8.9342 -8.0242
45 -5.7642 -8.9342
46 -7.8242 -5.7642
47 -7.3842 -7.8242
48 -5.6542 -7.3842
49 -6.1442 -5.6542
50 -5.1590 -6.1442
51 -5.6790 -5.1590
52 -1.6490 -5.6790
53 2.0010 -1.6490
54 2.6510 2.0010
55 2.6710 2.6510
56 0.4110 2.6710
57 0.9910 0.4110
58 1.8710 0.9910
59 1.8910 1.8710
> 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/rcomp/tmp/7823k1290878451.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/rcomp/tmp/8823k1290878451.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/rcomp/tmp/9jcl51290878451.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/rcomp/tmp/10jcl51290878451.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/114ujb1290878451.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/rcomp/tmp/128v0h1290878451.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/rcomp/tmp/13ewxb1290878451.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/rcomp/tmp/14p5ee1290878451.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/rcomp/tmp/15aov21290878451.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/rcomp/tmp/16wob81290878451.tab")
+ }
>
> try(system("convert tmp/1cb6c1290878451.ps tmp/1cb6c1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/252nf1290878451.ps tmp/252nf1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/352nf1290878451.ps tmp/352nf1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/452nf1290878451.ps tmp/452nf1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xtmz1290878451.ps tmp/5xtmz1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/6xtmz1290878451.ps tmp/6xtmz1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/7823k1290878451.ps tmp/7823k1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/8823k1290878451.ps tmp/8823k1290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/9jcl51290878451.ps tmp/9jcl51290878451.png",intern=TRUE))
character(0)
> try(system("convert tmp/10jcl51290878451.ps tmp/10jcl51290878451.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.610 1.810 5.416