R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(1962
+ ,9.5
+ ,5.569
+ ,1.933
+ ,0.226
+ ,1963
+ ,9.6
+ ,5.634
+ ,1.947
+ ,0.231
+ ,1964
+ ,9.4
+ ,5.433
+ ,1.936
+ ,0.225
+ ,1965
+ ,9.4
+ ,5.425
+ ,1.956
+ ,0.229
+ ,1966
+ ,9.5
+ ,5.412
+ ,1.965
+ ,0.236
+ ,1967
+ ,9.4
+ ,5.247
+ ,1.973
+ ,0.234
+ ,1968
+ ,9.7
+ ,5.31
+ ,1.988
+ ,0.253
+ ,1969
+ ,9.5
+ ,5.168
+ ,1.985
+ ,0.251
+ ,1970
+ ,9.5
+ ,4.927
+ ,1.986
+ ,0.243
+ ,1971
+ ,9.3
+ ,4.929
+ ,1.993
+ ,0.239
+ ,1972
+ ,9.4
+ ,4.902
+ ,2.003
+ ,0.237
+ ,1973
+ ,9.3
+ ,4.82
+ ,2
+ ,0.23
+ ,1974
+ ,9.1
+ ,4.588
+ ,2.015
+ ,0.221
+ ,1975
+ ,8.8
+ ,4.312
+ ,2.001
+ ,0.203
+ ,1976
+ ,8.8
+ ,4.269
+ ,2.025
+ ,0.195
+ ,1977
+ ,8.6
+ ,4.137
+ ,2.035
+ ,0.182
+ ,1978
+ ,8.7
+ ,4.099
+ ,2.049
+ ,0.183
+ ,1979
+ ,8.5
+ ,4.016
+ ,2.04
+ ,0.175
+ ,1980
+ ,8.7
+ ,4.121
+ ,2.079
+ ,0.181
+ ,1981
+ ,8.6
+ ,3.97
+ ,2.064
+ ,0.176
+ ,1982
+ ,8.5
+ ,3.89
+ ,2.083
+ ,0.172
+ ,1983
+ ,8.6
+ ,3.889
+ ,2.091
+ ,0.176
+ ,1984
+ ,8.6
+ ,3.788
+ ,2.108
+ ,0.172
+ ,1985
+ ,8.7
+ ,3.75
+ ,2.113
+ ,0.174
+ ,1986
+ ,8.7
+ ,3.651
+ ,2.115
+ ,0.172
+ ,1987
+ ,8.7
+ ,3.559
+ ,2.117
+ ,0.174
+ ,1988
+ ,8.8
+ ,3.525
+ ,2.125
+ ,0.18
+ ,1989
+ ,8.7
+ ,3.32
+ ,2.142
+ ,0.205
+ ,1990
+ ,8.6
+ ,3.218
+ ,2.16
+ ,0.207
+ ,1991
+ ,8.5
+ ,3.138
+ ,2.158
+ ,0.207
+ ,1992
+ ,8.5
+ ,3.061
+ ,2.143
+ ,0.208
+ ,1993
+ ,8.8
+ ,3.099
+ ,2.146
+ ,0.22
+ ,1994
+ ,8.8
+ ,2.997
+ ,2.131
+ ,0.227
+ ,1995
+ ,8.8
+ ,2.963
+ ,2.117
+ ,0.234
+ ,1996
+ ,8.8
+ ,2.883
+ ,2.087
+ ,0.24
+ ,1997
+ ,8.6
+ ,2.804
+ ,2.057
+ ,0.24
+ ,1998
+ ,8.6
+ ,2.724
+ ,2.024
+ ,0.242
+ ,1999
+ ,8.8
+ ,2.678
+ ,2.027
+ ,0.252
+ ,2000
+ ,8.7
+ ,2.576
+ ,1.996
+ ,0.25
+ ,2001
+ ,8.5
+ ,2.478
+ ,1.96
+ ,0.253)
+ ,dim=c(5
+ ,40)
+ ,dimnames=list(c('Year'
+ ,'Rate'
+ ,'Heart_disease'
+ ,'Cancer'
+ ,'Diabetes
')
+ ,1:40))
> y <- array(NA,dim=c(5,40),dimnames=list(c('Year','Rate','Heart_disease','Cancer','Diabetes
'),1:40))
> 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 = '4'
> 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
Cancer Year Rate Heart_disease Diabetes\r
1 1.933 1962 9.5 5.569 0.226
2 1.947 1963 9.6 5.634 0.231
3 1.936 1964 9.4 5.433 0.225
4 1.956 1965 9.4 5.425 0.229
5 1.965 1966 9.5 5.412 0.236
6 1.973 1967 9.4 5.247 0.234
7 1.988 1968 9.7 5.310 0.253
8 1.985 1969 9.5 5.168 0.251
9 1.986 1970 9.5 4.927 0.243
10 1.993 1971 9.3 4.929 0.239
11 2.003 1972 9.4 4.902 0.237
12 2.000 1973 9.3 4.820 0.230
13 2.015 1974 9.1 4.588 0.221
14 2.001 1975 8.8 4.312 0.203
15 2.025 1976 8.8 4.269 0.195
16 2.035 1977 8.6 4.137 0.182
17 2.049 1978 8.7 4.099 0.183
18 2.040 1979 8.5 4.016 0.175
19 2.079 1980 8.7 4.121 0.181
20 2.064 1981 8.6 3.970 0.176
21 2.083 1982 8.5 3.890 0.172
22 2.091 1983 8.6 3.889 0.176
23 2.108 1984 8.6 3.788 0.172
24 2.113 1985 8.7 3.750 0.174
25 2.115 1986 8.7 3.651 0.172
26 2.117 1987 8.7 3.559 0.174
27 2.125 1988 8.8 3.525 0.180
28 2.142 1989 8.7 3.320 0.205
29 2.160 1990 8.6 3.218 0.207
30 2.158 1991 8.5 3.138 0.207
31 2.143 1992 8.5 3.061 0.208
32 2.146 1993 8.8 3.099 0.220
33 2.131 1994 8.8 2.997 0.227
34 2.117 1995 8.8 2.963 0.234
35 2.087 1996 8.8 2.883 0.240
36 2.057 1997 8.6 2.804 0.240
37 2.024 1998 8.6 2.724 0.242
38 2.027 1999 8.8 2.678 0.252
39 1.996 2000 8.7 2.576 0.250
40 1.960 2001 8.5 2.478 0.253
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Year Rate Heart_disease `Diabetes\r`
9.850085 -0.004333 0.220653 -0.165991 -2.429068
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.073004 -0.024617 0.004358 0.014749 0.082967
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.850085 14.351660 0.686 0.49702
Year -0.004333 0.007220 -0.600 0.55228
Rate 0.220653 0.070746 3.119 0.00362 **
Heart_disease -0.165991 0.102635 -1.617 0.11479
`Diabetes\r` -2.429068 0.421367 -5.765 1.58e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.03607 on 35 degrees of freedom
Multiple R-squared: 0.7523, Adjusted R-squared: 0.724
F-statistic: 26.57 on 4 and 35 DF, p-value: 3.514e-10
> 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,] 4.967267e-03 9.934535e-03 0.99503273
[2,] 6.605356e-04 1.321071e-03 0.99933946
[3,] 7.749350e-05 1.549870e-04 0.99992251
[4,] 8.641991e-06 1.728398e-05 0.99999136
[5,] 1.895560e-06 3.791120e-06 0.99999810
[6,] 4.638941e-06 9.277883e-06 0.99999536
[7,] 6.418164e-07 1.283633e-06 0.99999936
[8,] 5.856750e-07 1.171350e-06 0.99999941
[9,] 4.875351e-07 9.750702e-07 0.99999951
[10,] 4.725639e-07 9.451278e-07 0.99999953
[11,] 2.622306e-06 5.244612e-06 0.99999738
[12,] 1.432426e-06 2.864851e-06 0.99999857
[13,] 7.731210e-06 1.546242e-05 0.99999227
[14,] 1.119224e-05 2.238447e-05 0.99998881
[15,] 4.016788e-06 8.033577e-06 0.99999598
[16,] 2.067459e-06 4.134919e-06 0.99999793
[17,] 9.451887e-07 1.890377e-06 0.99999905
[18,] 7.818838e-07 1.563768e-06 0.99999922
[19,] 7.523953e-07 1.504791e-06 0.99999925
[20,] 1.479638e-05 2.959275e-05 0.99998520
[21,] 1.795460e-01 3.590920e-01 0.82045398
[22,] 9.100168e-01 1.799664e-01 0.08998322
[23,] 9.024621e-01 1.950758e-01 0.09753792
[24,] 8.378389e-01 3.243222e-01 0.16216111
[25,] 7.804293e-01 4.391415e-01 0.21957073
> postscript(file="/var/wessaorg/rcomp/tmp/185q61321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2xcup1321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/34tpt1321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/46rm81321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/50eji1321913905.ps",horizontal=F,onefile=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 = 40
Frequency = 1
1 2 3 4 5 6
-0.038664679 -0.019462263 -0.029937347 0.002783946 0.008897182 0.011048749
7 8 9 10 11 12
0.020795524 0.037830195 -0.016273285 0.029805987 0.012733734 0.005517233
13 14 15 16 17 18
0.008609217 -0.024398720 -0.022635936 -0.017661101 -0.025272054 -0.019018309
19 20 21 22 23 24
0.012187519 -0.013624241 0.008778445 0.008596372 0.003447936 -0.010733949
25 26 27 28 29 30
-0.025692266 -0.029772372 -0.030574020 0.039522734 0.071848021 0.082966979
31 32 33 34 35 36
0.061947674 0.038541192 0.027946513 0.029639239 0.005267299 0.010617554
37 38 39 40
-0.026470657 -0.046613234 -0.073004219 -0.069520593
> postscript(file="/var/wessaorg/rcomp/tmp/6v1591321913905.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 40
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.038664679 NA
1 -0.019462263 -0.038664679
2 -0.029937347 -0.019462263
3 0.002783946 -0.029937347
4 0.008897182 0.002783946
5 0.011048749 0.008897182
6 0.020795524 0.011048749
7 0.037830195 0.020795524
8 -0.016273285 0.037830195
9 0.029805987 -0.016273285
10 0.012733734 0.029805987
11 0.005517233 0.012733734
12 0.008609217 0.005517233
13 -0.024398720 0.008609217
14 -0.022635936 -0.024398720
15 -0.017661101 -0.022635936
16 -0.025272054 -0.017661101
17 -0.019018309 -0.025272054
18 0.012187519 -0.019018309
19 -0.013624241 0.012187519
20 0.008778445 -0.013624241
21 0.008596372 0.008778445
22 0.003447936 0.008596372
23 -0.010733949 0.003447936
24 -0.025692266 -0.010733949
25 -0.029772372 -0.025692266
26 -0.030574020 -0.029772372
27 0.039522734 -0.030574020
28 0.071848021 0.039522734
29 0.082966979 0.071848021
30 0.061947674 0.082966979
31 0.038541192 0.061947674
32 0.027946513 0.038541192
33 0.029639239 0.027946513
34 0.005267299 0.029639239
35 0.010617554 0.005267299
36 -0.026470657 0.010617554
37 -0.046613234 -0.026470657
38 -0.073004219 -0.046613234
39 -0.069520593 -0.073004219
40 NA -0.069520593
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.019462263 -0.038664679
[2,] -0.029937347 -0.019462263
[3,] 0.002783946 -0.029937347
[4,] 0.008897182 0.002783946
[5,] 0.011048749 0.008897182
[6,] 0.020795524 0.011048749
[7,] 0.037830195 0.020795524
[8,] -0.016273285 0.037830195
[9,] 0.029805987 -0.016273285
[10,] 0.012733734 0.029805987
[11,] 0.005517233 0.012733734
[12,] 0.008609217 0.005517233
[13,] -0.024398720 0.008609217
[14,] -0.022635936 -0.024398720
[15,] -0.017661101 -0.022635936
[16,] -0.025272054 -0.017661101
[17,] -0.019018309 -0.025272054
[18,] 0.012187519 -0.019018309
[19,] -0.013624241 0.012187519
[20,] 0.008778445 -0.013624241
[21,] 0.008596372 0.008778445
[22,] 0.003447936 0.008596372
[23,] -0.010733949 0.003447936
[24,] -0.025692266 -0.010733949
[25,] -0.029772372 -0.025692266
[26,] -0.030574020 -0.029772372
[27,] 0.039522734 -0.030574020
[28,] 0.071848021 0.039522734
[29,] 0.082966979 0.071848021
[30,] 0.061947674 0.082966979
[31,] 0.038541192 0.061947674
[32,] 0.027946513 0.038541192
[33,] 0.029639239 0.027946513
[34,] 0.005267299 0.029639239
[35,] 0.010617554 0.005267299
[36,] -0.026470657 0.010617554
[37,] -0.046613234 -0.026470657
[38,] -0.073004219 -0.046613234
[39,] -0.069520593 -0.073004219
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.019462263 -0.038664679
2 -0.029937347 -0.019462263
3 0.002783946 -0.029937347
4 0.008897182 0.002783946
5 0.011048749 0.008897182
6 0.020795524 0.011048749
7 0.037830195 0.020795524
8 -0.016273285 0.037830195
9 0.029805987 -0.016273285
10 0.012733734 0.029805987
11 0.005517233 0.012733734
12 0.008609217 0.005517233
13 -0.024398720 0.008609217
14 -0.022635936 -0.024398720
15 -0.017661101 -0.022635936
16 -0.025272054 -0.017661101
17 -0.019018309 -0.025272054
18 0.012187519 -0.019018309
19 -0.013624241 0.012187519
20 0.008778445 -0.013624241
21 0.008596372 0.008778445
22 0.003447936 0.008596372
23 -0.010733949 0.003447936
24 -0.025692266 -0.010733949
25 -0.029772372 -0.025692266
26 -0.030574020 -0.029772372
27 0.039522734 -0.030574020
28 0.071848021 0.039522734
29 0.082966979 0.071848021
30 0.061947674 0.082966979
31 0.038541192 0.061947674
32 0.027946513 0.038541192
33 0.029639239 0.027946513
34 0.005267299 0.029639239
35 0.010617554 0.005267299
36 -0.026470657 0.010617554
37 -0.046613234 -0.026470657
38 -0.073004219 -0.046613234
39 -0.069520593 -0.073004219
> 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/wessaorg/rcomp/tmp/7hm9m1321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/8ipmr1321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/9ucxs1321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10osht1321913905.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11l7ms1321913905.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/wessaorg/rcomp/tmp/12y91z1321913905.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/wessaorg/rcomp/tmp/13olij1321913905.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/wessaorg/rcomp/tmp/14mos31321913905.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/wessaorg/rcomp/tmp/15a1qs1321913905.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/wessaorg/rcomp/tmp/16qcjl1321913905.tab")
+ }
>
> try(system("convert tmp/185q61321913905.ps tmp/185q61321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xcup1321913905.ps tmp/2xcup1321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/34tpt1321913905.ps tmp/34tpt1321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/46rm81321913905.ps tmp/46rm81321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/50eji1321913905.ps tmp/50eji1321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/6v1591321913905.ps tmp/6v1591321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hm9m1321913905.ps tmp/7hm9m1321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ipmr1321913905.ps tmp/8ipmr1321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ucxs1321913905.ps tmp/9ucxs1321913905.png",intern=TRUE))
character(0)
> try(system("convert tmp/10osht1321913905.ps tmp/10osht1321913905.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.981 0.485 3.478