R version 2.7.0 (2008-04-22)
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(565464,0,547344,0,554788,0,562325,0,560854,0,555332,0,543599,0,536662,0,542722,0,593530,0,610763,0,612613,0,611324,0,594167,0,595454,0,590865,0,589379,0,584428,0,573100,0,567456,0,569028,0,620735,0,628884,0,628232,0,612117,0,595404,0,597141,0,593408,0,590072,0,579799,0,574205,0,572775,0,572942,0,619567,0,625809,0,619916,0,587625,0,565742,0,557274,0,560576,1,548854,1,531673,1,525919,1,511038,1,498662,1,555362,1,564591,1,541657,1,527070,1,509846,1,514258,1,516922,1,507561,1,492622,1,490243,1,469357,1,477580,1,528379,1,533590,1,517945,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
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
Y X
1 565464 0
2 547344 0
3 554788 0
4 562325 0
5 560854 0
6 555332 0
7 543599 0
8 536662 0
9 542722 0
10 593530 0
11 610763 0
12 612613 0
13 611324 0
14 594167 0
15 595454 0
16 590865 0
17 589379 0
18 584428 0
19 573100 0
20 567456 0
21 569028 0
22 620735 0
23 628884 0
24 628232 0
25 612117 0
26 595404 0
27 597141 0
28 593408 0
29 590072 0
30 579799 0
31 574205 0
32 572775 0
33 572942 0
34 619567 0
35 625809 0
36 619916 0
37 587625 0
38 565742 0
39 557274 0
40 560576 1
41 548854 1
42 531673 1
43 525919 1
44 511038 1
45 498662 1
46 555362 1
47 564591 1
48 541657 1
49 527070 1
50 509846 1
51 514258 1
52 516922 1
53 507561 1
54 492622 1
55 490243 1
56 469357 1
57 477580 1
58 528379 1
59 533590 1
60 517945 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
584688 -64512
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-50819 -19016 1338 15430 44415
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 584688 4152 140.825 < 2e-16 ***
X -64512 7018 -9.192 6.4e-13 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 25930 on 58 degrees of freedom
Multiple R-squared: 0.593, Adjusted R-squared: 0.586
F-statistic: 84.5 on 1 and 58 DF, p-value: 6.394e-13
> 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.04313750 0.08627500 0.9568625
[2,] 0.01253387 0.02506773 0.9874661
[3,] 0.01369157 0.02738315 0.9863084
[4,] 0.02645450 0.05290899 0.9735455
[5,] 0.02019636 0.04039273 0.9798036
[6,] 0.18335778 0.36671556 0.8166422
[7,] 0.57076680 0.85846639 0.4292332
[8,] 0.77361138 0.45277724 0.2263886
[9,] 0.85271914 0.29456171 0.1472809
[10,] 0.83036500 0.33927000 0.1696350
[11,] 0.80493992 0.39012016 0.1950601
[12,] 0.76087511 0.47824978 0.2391249
[13,] 0.70691249 0.58617501 0.2930875
[14,] 0.63982552 0.72034895 0.3601745
[15,] 0.57514727 0.84970547 0.4248527
[16,] 0.52751879 0.94496242 0.4724812
[17,] 0.47932474 0.95864948 0.5206753
[18,] 0.59194148 0.81611705 0.4080585
[19,] 0.73749561 0.52500878 0.2625044
[20,] 0.83206463 0.33587074 0.1679354
[21,] 0.83243001 0.33513997 0.1675700
[22,] 0.78789180 0.42421640 0.2121082
[23,] 0.74018539 0.51962922 0.2598146
[24,] 0.68057759 0.63884483 0.3194224
[25,] 0.61169197 0.77661605 0.3883080
[26,] 0.54103899 0.91792202 0.4589610
[27,] 0.48162502 0.96325004 0.5183750
[28,] 0.43042530 0.86085060 0.5695747
[29,] 0.38602382 0.77204764 0.6139762
[30,] 0.41386025 0.82772049 0.5861398
[31,] 0.50854869 0.98290261 0.4914513
[32,] 0.60706887 0.78586227 0.3929311
[33,] 0.56251405 0.87497191 0.4374860
[34,] 0.50196344 0.99607312 0.4980366
[35,] 0.45225431 0.90450861 0.5477457
[36,] 0.50411910 0.99176179 0.4958809
[37,] 0.50862457 0.98275085 0.4913754
[38,] 0.45902840 0.91805679 0.5409716
[39,] 0.39651098 0.79302195 0.6034890
[40,] 0.34070359 0.68140719 0.6592964
[41,] 0.31847439 0.63694878 0.6815256
[42,] 0.39449852 0.78899704 0.6055015
[43,] 0.64790558 0.70418884 0.3520944
[44,] 0.70379364 0.59241271 0.2962064
[45,] 0.67464624 0.65070753 0.3253538
[46,] 0.58700104 0.82599792 0.4129990
[47,] 0.49524732 0.99049465 0.5047527
[48,] 0.40988002 0.81976003 0.5901200
[49,] 0.30290052 0.60580103 0.6970995
[50,] 0.21954279 0.43908558 0.7804572
[51,] 0.15001933 0.30003866 0.8499807
> postscript(file="/var/www/html/rcomp/tmp/15j6q1229682600.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/2zdbv1229682600.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/37qre1229682600.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/4eg6d1229682600.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/5dbzg1229682600.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
-19224.3077 -37344.3077 -29900.3077 -22363.3077 -23834.3077 -29356.3077
7 8 9 10 11 12
-41089.3077 -48026.3077 -41966.3077 8841.6923 26074.6923 27924.6923
13 14 15 16 17 18
26635.6923 9478.6923 10765.6923 6176.6923 4690.6923 -260.3077
19 20 21 22 23 24
-11588.3077 -17232.3077 -15660.3077 36046.6923 44195.6923 43543.6923
25 26 27 28 29 30
27428.6923 10715.6923 12452.6923 8719.6923 5383.6923 -4889.3077
31 32 33 34 35 36
-10483.3077 -11913.3077 -11746.3077 34878.6923 41120.6923 35227.6923
37 38 39 40 41 42
2936.6923 -18946.3077 -27414.3077 40399.5714 28677.5714 11496.5714
43 44 45 46 47 48
5742.5714 -9138.4286 -21514.4286 35185.5714 44414.5714 21480.5714
49 50 51 52 53 54
6893.5714 -10330.4286 -5918.4286 -3254.4286 -12615.4286 -27554.4286
55 56 57 58 59 60
-29933.4286 -50819.4286 -42596.4286 8202.5714 13413.5714 -2231.4286
> postscript(file="/var/www/html/rcomp/tmp/6sxzi1229682600.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 -19224.3077 NA
1 -37344.3077 -19224.3077
2 -29900.3077 -37344.3077
3 -22363.3077 -29900.3077
4 -23834.3077 -22363.3077
5 -29356.3077 -23834.3077
6 -41089.3077 -29356.3077
7 -48026.3077 -41089.3077
8 -41966.3077 -48026.3077
9 8841.6923 -41966.3077
10 26074.6923 8841.6923
11 27924.6923 26074.6923
12 26635.6923 27924.6923
13 9478.6923 26635.6923
14 10765.6923 9478.6923
15 6176.6923 10765.6923
16 4690.6923 6176.6923
17 -260.3077 4690.6923
18 -11588.3077 -260.3077
19 -17232.3077 -11588.3077
20 -15660.3077 -17232.3077
21 36046.6923 -15660.3077
22 44195.6923 36046.6923
23 43543.6923 44195.6923
24 27428.6923 43543.6923
25 10715.6923 27428.6923
26 12452.6923 10715.6923
27 8719.6923 12452.6923
28 5383.6923 8719.6923
29 -4889.3077 5383.6923
30 -10483.3077 -4889.3077
31 -11913.3077 -10483.3077
32 -11746.3077 -11913.3077
33 34878.6923 -11746.3077
34 41120.6923 34878.6923
35 35227.6923 41120.6923
36 2936.6923 35227.6923
37 -18946.3077 2936.6923
38 -27414.3077 -18946.3077
39 40399.5714 -27414.3077
40 28677.5714 40399.5714
41 11496.5714 28677.5714
42 5742.5714 11496.5714
43 -9138.4286 5742.5714
44 -21514.4286 -9138.4286
45 35185.5714 -21514.4286
46 44414.5714 35185.5714
47 21480.5714 44414.5714
48 6893.5714 21480.5714
49 -10330.4286 6893.5714
50 -5918.4286 -10330.4286
51 -3254.4286 -5918.4286
52 -12615.4286 -3254.4286
53 -27554.4286 -12615.4286
54 -29933.4286 -27554.4286
55 -50819.4286 -29933.4286
56 -42596.4286 -50819.4286
57 8202.5714 -42596.4286
58 13413.5714 8202.5714
59 -2231.4286 13413.5714
60 NA -2231.4286
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -37344.3077 -19224.3077
[2,] -29900.3077 -37344.3077
[3,] -22363.3077 -29900.3077
[4,] -23834.3077 -22363.3077
[5,] -29356.3077 -23834.3077
[6,] -41089.3077 -29356.3077
[7,] -48026.3077 -41089.3077
[8,] -41966.3077 -48026.3077
[9,] 8841.6923 -41966.3077
[10,] 26074.6923 8841.6923
[11,] 27924.6923 26074.6923
[12,] 26635.6923 27924.6923
[13,] 9478.6923 26635.6923
[14,] 10765.6923 9478.6923
[15,] 6176.6923 10765.6923
[16,] 4690.6923 6176.6923
[17,] -260.3077 4690.6923
[18,] -11588.3077 -260.3077
[19,] -17232.3077 -11588.3077
[20,] -15660.3077 -17232.3077
[21,] 36046.6923 -15660.3077
[22,] 44195.6923 36046.6923
[23,] 43543.6923 44195.6923
[24,] 27428.6923 43543.6923
[25,] 10715.6923 27428.6923
[26,] 12452.6923 10715.6923
[27,] 8719.6923 12452.6923
[28,] 5383.6923 8719.6923
[29,] -4889.3077 5383.6923
[30,] -10483.3077 -4889.3077
[31,] -11913.3077 -10483.3077
[32,] -11746.3077 -11913.3077
[33,] 34878.6923 -11746.3077
[34,] 41120.6923 34878.6923
[35,] 35227.6923 41120.6923
[36,] 2936.6923 35227.6923
[37,] -18946.3077 2936.6923
[38,] -27414.3077 -18946.3077
[39,] 40399.5714 -27414.3077
[40,] 28677.5714 40399.5714
[41,] 11496.5714 28677.5714
[42,] 5742.5714 11496.5714
[43,] -9138.4286 5742.5714
[44,] -21514.4286 -9138.4286
[45,] 35185.5714 -21514.4286
[46,] 44414.5714 35185.5714
[47,] 21480.5714 44414.5714
[48,] 6893.5714 21480.5714
[49,] -10330.4286 6893.5714
[50,] -5918.4286 -10330.4286
[51,] -3254.4286 -5918.4286
[52,] -12615.4286 -3254.4286
[53,] -27554.4286 -12615.4286
[54,] -29933.4286 -27554.4286
[55,] -50819.4286 -29933.4286
[56,] -42596.4286 -50819.4286
[57,] 8202.5714 -42596.4286
[58,] 13413.5714 8202.5714
[59,] -2231.4286 13413.5714
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -37344.3077 -19224.3077
2 -29900.3077 -37344.3077
3 -22363.3077 -29900.3077
4 -23834.3077 -22363.3077
5 -29356.3077 -23834.3077
6 -41089.3077 -29356.3077
7 -48026.3077 -41089.3077
8 -41966.3077 -48026.3077
9 8841.6923 -41966.3077
10 26074.6923 8841.6923
11 27924.6923 26074.6923
12 26635.6923 27924.6923
13 9478.6923 26635.6923
14 10765.6923 9478.6923
15 6176.6923 10765.6923
16 4690.6923 6176.6923
17 -260.3077 4690.6923
18 -11588.3077 -260.3077
19 -17232.3077 -11588.3077
20 -15660.3077 -17232.3077
21 36046.6923 -15660.3077
22 44195.6923 36046.6923
23 43543.6923 44195.6923
24 27428.6923 43543.6923
25 10715.6923 27428.6923
26 12452.6923 10715.6923
27 8719.6923 12452.6923
28 5383.6923 8719.6923
29 -4889.3077 5383.6923
30 -10483.3077 -4889.3077
31 -11913.3077 -10483.3077
32 -11746.3077 -11913.3077
33 34878.6923 -11746.3077
34 41120.6923 34878.6923
35 35227.6923 41120.6923
36 2936.6923 35227.6923
37 -18946.3077 2936.6923
38 -27414.3077 -18946.3077
39 40399.5714 -27414.3077
40 28677.5714 40399.5714
41 11496.5714 28677.5714
42 5742.5714 11496.5714
43 -9138.4286 5742.5714
44 -21514.4286 -9138.4286
45 35185.5714 -21514.4286
46 44414.5714 35185.5714
47 21480.5714 44414.5714
48 6893.5714 21480.5714
49 -10330.4286 6893.5714
50 -5918.4286 -10330.4286
51 -3254.4286 -5918.4286
52 -12615.4286 -3254.4286
53 -27554.4286 -12615.4286
54 -29933.4286 -27554.4286
55 -50819.4286 -29933.4286
56 -42596.4286 -50819.4286
57 8202.5714 -42596.4286
58 13413.5714 8202.5714
59 -2231.4286 13413.5714
> 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/74aku1229682600.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/8w9ah1229682600.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/98nop1229682600.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/10o8gn1229682600.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/11ai3y1229682600.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/12o64y1229682601.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/13alzk1229682601.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/1401451229682601.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/150xa81229682601.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/16fxfv1229682601.tab")
+ }
>
> system("convert tmp/15j6q1229682600.ps tmp/15j6q1229682600.png")
> system("convert tmp/2zdbv1229682600.ps tmp/2zdbv1229682600.png")
> system("convert tmp/37qre1229682600.ps tmp/37qre1229682600.png")
> system("convert tmp/4eg6d1229682600.ps tmp/4eg6d1229682600.png")
> system("convert tmp/5dbzg1229682600.ps tmp/5dbzg1229682600.png")
> system("convert tmp/6sxzi1229682600.ps tmp/6sxzi1229682600.png")
> system("convert tmp/74aku1229682600.ps tmp/74aku1229682600.png")
> system("convert tmp/8w9ah1229682600.ps tmp/8w9ah1229682600.png")
> system("convert tmp/98nop1229682600.ps tmp/98nop1229682600.png")
> system("convert tmp/10o8gn1229682600.ps tmp/10o8gn1229682600.png")
>
>
> proc.time()
user system elapsed
4.980 2.692 5.372