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(12.6,18,15.7,16,13.2,19,20.3,18,12.8,23,8,20,0.9,20,3.6,15,14.1,17,21.7,16,24.5,15,18.9,10,13.9,13,11,10,5.8,19,15.5,21,22.4,17,31.7,16,30.3,17,31.4,14,20.2,18,19.7,17,10.8,14,13.2,15,15.1,16,15.6,11,15.5,15,12.7,13,10.9,17,10,16,9.1,9,10.3,17,16.9,15,22,12,27.6,12,28.9,12,31,12,32.9,4,38.1,7,28.8,4,29,3,21.8,3,28.8,0,25.6,5,28.2,3,20.2,4,17.9,3,16.3,10,13.2,4,8.1,1,4.5,1,-0.1,8,0,5,2.3,4,2.8,0,2.9,2,0.1,7,3.5,6,8.6,9,13.8,10),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 12.6 18
2 15.7 16
3 13.2 19
4 20.3 18
5 12.8 23
6 8.0 20
7 0.9 20
8 3.6 15
9 14.1 17
10 21.7 16
11 24.5 15
12 18.9 10
13 13.9 13
14 11.0 10
15 5.8 19
16 15.5 21
17 22.4 17
18 31.7 16
19 30.3 17
20 31.4 14
21 20.2 18
22 19.7 17
23 10.8 14
24 13.2 15
25 15.1 16
26 15.6 11
27 15.5 15
28 12.7 13
29 10.9 17
30 10.0 16
31 9.1 9
32 10.3 17
33 16.9 15
34 22.0 12
35 27.6 12
36 28.9 12
37 31.0 12
38 32.9 4
39 38.1 7
40 28.8 4
41 29.0 3
42 21.8 3
43 28.8 0
44 25.6 5
45 28.2 3
46 20.2 4
47 17.9 3
48 16.3 10
49 13.2 4
50 8.1 1
51 4.5 1
52 -0.1 8
53 0.0 5
54 2.3 4
55 2.8 0
56 2.9 2
57 0.1 7
58 3.5 6
59 8.6 9
60 13.8 10
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
16.3381 -0.0224
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-16.2589 -6.2439 -0.6909 6.0587 21.9187
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.3381 2.6260 6.222 5.86e-08 ***
X -0.0224 0.2038 -0.110 0.913
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.775 on 58 degrees of freedom
Multiple R-squared: 0.0002082, Adjusted R-squared: -0.01703
F-statistic: 0.01208 on 1 and 58 DF, p-value: 0.9129
> 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.047996924 0.095993849 0.95200308
[2,] 0.042582953 0.085165906 0.95741705
[3,] 0.136165741 0.272331481 0.86383426
[4,] 0.179109585 0.358219169 0.82089042
[5,] 0.111895721 0.223791443 0.88810428
[6,] 0.120569296 0.241138591 0.87943070
[7,] 0.126991442 0.253982884 0.87300856
[8,] 0.079571185 0.159142371 0.92042881
[9,] 0.050739085 0.101478170 0.94926091
[10,] 0.042317959 0.084635917 0.95768204
[11,] 0.037278115 0.074556230 0.96272188
[12,] 0.025208732 0.050417464 0.97479127
[13,] 0.025752275 0.051504550 0.97424773
[14,] 0.086977247 0.173954493 0.91302275
[15,] 0.152964514 0.305929027 0.84703549
[16,] 0.218477247 0.436954494 0.78152275
[17,] 0.173325412 0.346650825 0.82667459
[18,] 0.131119401 0.262238803 0.86888060
[19,] 0.111773712 0.223547423 0.88822629
[20,] 0.082687978 0.165375956 0.91731202
[21,] 0.056622940 0.113245880 0.94337706
[22,] 0.038879163 0.077758326 0.96112084
[23,] 0.025060105 0.050120210 0.97493990
[24,] 0.017452435 0.034904870 0.98254756
[25,] 0.012423843 0.024847686 0.98757616
[26,] 0.009663967 0.019327935 0.99033603
[27,] 0.008838320 0.017676639 0.99116168
[28,] 0.007204386 0.014408772 0.99279561
[29,] 0.004438369 0.008876739 0.99556163
[30,] 0.002858352 0.005716703 0.99714165
[31,] 0.002904950 0.005809901 0.99709505
[32,] 0.003417267 0.006834534 0.99658273
[33,] 0.006113639 0.012227277 0.99388636
[34,] 0.009259273 0.018518546 0.99074073
[35,] 0.045252111 0.090504222 0.95474789
[36,] 0.055885642 0.111771285 0.94411436
[37,] 0.076395694 0.152791388 0.92360431
[38,] 0.076612022 0.153224043 0.92338798
[39,] 0.133766037 0.267532073 0.86623396
[40,] 0.212748538 0.425497077 0.78725146
[41,] 0.532059578 0.935880844 0.46794042
[42,] 0.706437072 0.587125856 0.29356293
[43,] 0.869323140 0.261353720 0.13067686
[44,] 0.907545754 0.184908493 0.09245425
[45,] 0.956482796 0.087034409 0.04351720
[46,] 0.968548427 0.062903146 0.03145157
[47,] 0.963316652 0.073366696 0.03668335
[48,] 0.973393301 0.053213399 0.02660670
[49,] 0.967301239 0.065397522 0.03269876
[50,] 0.930295520 0.139408960 0.06970448
[51,] 0.874453895 0.251092211 0.12554611
> postscript(file="/var/www/html/rcomp/tmp/1ghxi1258738252.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/2x1221258738252.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/3tjt21258738252.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/4uas31258738252.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/5zfla1258738252.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
-3.3349300 -0.2797270 -2.7125315 4.3650700 -3.0229375 -7.8901330
7 8 9 10 11 12
-14.9901330 -12.4021255 -1.8573285 5.7202730 8.4978745 2.7858819
13 14 15 16 17 18
-2.1469225 -5.1141181 -10.1125315 -0.3677345 6.4426715 15.7202730
19 20 21 22 23 24
14.3426715 15.3754760 4.2650700 3.7426715 -5.2245240 -2.8021255
25 26 27 28 29 30
-0.8797270 -0.4917196 -0.5021255 -3.3469225 -5.0573285 -5.9797270
31 32 33 34 35 36
-7.0365166 -5.6573285 0.8978745 5.9306790 11.5306790 12.8306790
37 38 39 40 41 42
14.9306790 16.6514909 21.9186864 12.5514909 12.7290924 5.5290924
43 44 45 46 47 48
12.4618969 9.3738894 11.9290924 3.9514909 1.6290924 0.1858819
49 50 51 52 53 54
-3.0485091 -8.2157046 -11.8157046 -16.2589151 -16.2261106 -13.9485091
55 56 57 58 59 60
-13.5381031 -13.3933061 -16.0813136 -12.7037121 -7.5365166 -2.3141181
> postscript(file="/var/www/html/rcomp/tmp/6ew041258738252.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.3349300 NA
1 -0.2797270 -3.3349300
2 -2.7125315 -0.2797270
3 4.3650700 -2.7125315
4 -3.0229375 4.3650700
5 -7.8901330 -3.0229375
6 -14.9901330 -7.8901330
7 -12.4021255 -14.9901330
8 -1.8573285 -12.4021255
9 5.7202730 -1.8573285
10 8.4978745 5.7202730
11 2.7858819 8.4978745
12 -2.1469225 2.7858819
13 -5.1141181 -2.1469225
14 -10.1125315 -5.1141181
15 -0.3677345 -10.1125315
16 6.4426715 -0.3677345
17 15.7202730 6.4426715
18 14.3426715 15.7202730
19 15.3754760 14.3426715
20 4.2650700 15.3754760
21 3.7426715 4.2650700
22 -5.2245240 3.7426715
23 -2.8021255 -5.2245240
24 -0.8797270 -2.8021255
25 -0.4917196 -0.8797270
26 -0.5021255 -0.4917196
27 -3.3469225 -0.5021255
28 -5.0573285 -3.3469225
29 -5.9797270 -5.0573285
30 -7.0365166 -5.9797270
31 -5.6573285 -7.0365166
32 0.8978745 -5.6573285
33 5.9306790 0.8978745
34 11.5306790 5.9306790
35 12.8306790 11.5306790
36 14.9306790 12.8306790
37 16.6514909 14.9306790
38 21.9186864 16.6514909
39 12.5514909 21.9186864
40 12.7290924 12.5514909
41 5.5290924 12.7290924
42 12.4618969 5.5290924
43 9.3738894 12.4618969
44 11.9290924 9.3738894
45 3.9514909 11.9290924
46 1.6290924 3.9514909
47 0.1858819 1.6290924
48 -3.0485091 0.1858819
49 -8.2157046 -3.0485091
50 -11.8157046 -8.2157046
51 -16.2589151 -11.8157046
52 -16.2261106 -16.2589151
53 -13.9485091 -16.2261106
54 -13.5381031 -13.9485091
55 -13.3933061 -13.5381031
56 -16.0813136 -13.3933061
57 -12.7037121 -16.0813136
58 -7.5365166 -12.7037121
59 -2.3141181 -7.5365166
60 NA -2.3141181
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.2797270 -3.3349300
[2,] -2.7125315 -0.2797270
[3,] 4.3650700 -2.7125315
[4,] -3.0229375 4.3650700
[5,] -7.8901330 -3.0229375
[6,] -14.9901330 -7.8901330
[7,] -12.4021255 -14.9901330
[8,] -1.8573285 -12.4021255
[9,] 5.7202730 -1.8573285
[10,] 8.4978745 5.7202730
[11,] 2.7858819 8.4978745
[12,] -2.1469225 2.7858819
[13,] -5.1141181 -2.1469225
[14,] -10.1125315 -5.1141181
[15,] -0.3677345 -10.1125315
[16,] 6.4426715 -0.3677345
[17,] 15.7202730 6.4426715
[18,] 14.3426715 15.7202730
[19,] 15.3754760 14.3426715
[20,] 4.2650700 15.3754760
[21,] 3.7426715 4.2650700
[22,] -5.2245240 3.7426715
[23,] -2.8021255 -5.2245240
[24,] -0.8797270 -2.8021255
[25,] -0.4917196 -0.8797270
[26,] -0.5021255 -0.4917196
[27,] -3.3469225 -0.5021255
[28,] -5.0573285 -3.3469225
[29,] -5.9797270 -5.0573285
[30,] -7.0365166 -5.9797270
[31,] -5.6573285 -7.0365166
[32,] 0.8978745 -5.6573285
[33,] 5.9306790 0.8978745
[34,] 11.5306790 5.9306790
[35,] 12.8306790 11.5306790
[36,] 14.9306790 12.8306790
[37,] 16.6514909 14.9306790
[38,] 21.9186864 16.6514909
[39,] 12.5514909 21.9186864
[40,] 12.7290924 12.5514909
[41,] 5.5290924 12.7290924
[42,] 12.4618969 5.5290924
[43,] 9.3738894 12.4618969
[44,] 11.9290924 9.3738894
[45,] 3.9514909 11.9290924
[46,] 1.6290924 3.9514909
[47,] 0.1858819 1.6290924
[48,] -3.0485091 0.1858819
[49,] -8.2157046 -3.0485091
[50,] -11.8157046 -8.2157046
[51,] -16.2589151 -11.8157046
[52,] -16.2261106 -16.2589151
[53,] -13.9485091 -16.2261106
[54,] -13.5381031 -13.9485091
[55,] -13.3933061 -13.5381031
[56,] -16.0813136 -13.3933061
[57,] -12.7037121 -16.0813136
[58,] -7.5365166 -12.7037121
[59,] -2.3141181 -7.5365166
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.2797270 -3.3349300
2 -2.7125315 -0.2797270
3 4.3650700 -2.7125315
4 -3.0229375 4.3650700
5 -7.8901330 -3.0229375
6 -14.9901330 -7.8901330
7 -12.4021255 -14.9901330
8 -1.8573285 -12.4021255
9 5.7202730 -1.8573285
10 8.4978745 5.7202730
11 2.7858819 8.4978745
12 -2.1469225 2.7858819
13 -5.1141181 -2.1469225
14 -10.1125315 -5.1141181
15 -0.3677345 -10.1125315
16 6.4426715 -0.3677345
17 15.7202730 6.4426715
18 14.3426715 15.7202730
19 15.3754760 14.3426715
20 4.2650700 15.3754760
21 3.7426715 4.2650700
22 -5.2245240 3.7426715
23 -2.8021255 -5.2245240
24 -0.8797270 -2.8021255
25 -0.4917196 -0.8797270
26 -0.5021255 -0.4917196
27 -3.3469225 -0.5021255
28 -5.0573285 -3.3469225
29 -5.9797270 -5.0573285
30 -7.0365166 -5.9797270
31 -5.6573285 -7.0365166
32 0.8978745 -5.6573285
33 5.9306790 0.8978745
34 11.5306790 5.9306790
35 12.8306790 11.5306790
36 14.9306790 12.8306790
37 16.6514909 14.9306790
38 21.9186864 16.6514909
39 12.5514909 21.9186864
40 12.7290924 12.5514909
41 5.5290924 12.7290924
42 12.4618969 5.5290924
43 9.3738894 12.4618969
44 11.9290924 9.3738894
45 3.9514909 11.9290924
46 1.6290924 3.9514909
47 0.1858819 1.6290924
48 -3.0485091 0.1858819
49 -8.2157046 -3.0485091
50 -11.8157046 -8.2157046
51 -16.2589151 -11.8157046
52 -16.2261106 -16.2589151
53 -13.9485091 -16.2261106
54 -13.5381031 -13.9485091
55 -13.3933061 -13.5381031
56 -16.0813136 -13.3933061
57 -12.7037121 -16.0813136
58 -7.5365166 -12.7037121
59 -2.3141181 -7.5365166
> 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/78msm1258738252.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/8b7nn1258738252.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/98kfd1258738252.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/106u8r1258738252.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/115xxw1258738252.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/12f2o11258738252.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/13mjr11258738252.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/14d8w71258738252.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/154owv1258738252.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/16llba1258738252.tab")
+ }
> system("convert tmp/1ghxi1258738252.ps tmp/1ghxi1258738252.png")
> system("convert tmp/2x1221258738252.ps tmp/2x1221258738252.png")
> system("convert tmp/3tjt21258738252.ps tmp/3tjt21258738252.png")
> system("convert tmp/4uas31258738252.ps tmp/4uas31258738252.png")
> system("convert tmp/5zfla1258738252.ps tmp/5zfla1258738252.png")
> system("convert tmp/6ew041258738252.ps tmp/6ew041258738252.png")
> system("convert tmp/78msm1258738252.ps tmp/78msm1258738252.png")
> system("convert tmp/8b7nn1258738252.ps tmp/8b7nn1258738252.png")
> system("convert tmp/98kfd1258738252.ps tmp/98kfd1258738252.png")
> system("convert tmp/106u8r1258738252.ps tmp/106u8r1258738252.png")
>
>
> proc.time()
user system elapsed
2.442 1.535 2.969