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(22,78.1,22,78.1,21.8,74.5,21.5,74.6,21.3,75.5,21.1,76.9,21.2,76.3,21,73.8,20.8,73.4,20.5,75.8,20.4,76.9,20.1,73.2,19.9,72.1,19.6,74.3,19.4,73.1,19.2,72.2,19.1,69.4,19.1,70.8,18.9,71.1,18.7,71.2,18.7,70.6,18.7,71.1,18.4,70.3,18.4,68.3,18.3,68.9,18.4,71.9,18.3,73.3,18.3,70.9,18,70,17.7,65.5,17.7,70.1,17.9,66.6,17.6,67.4,17.7,67.8,17.4,69.4,17.1,69.4,16.8,66.7,16.5,65,16.2,63.1,15.8,65,15.5,63.9,15.2,63,14.9,62.2,14.6,61.4,14.4,61,14.5,58.8),dim=c(2,46),dimnames=list(c('Mortality','Marriage'),1:46))
> y <- array(NA,dim=c(2,46),dimnames=list(c('Mortality','Marriage'),1:46))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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
Mortality Marriage t
1 22.0 78.1 1
2 22.0 78.1 2
3 21.8 74.5 3
4 21.5 74.6 4
5 21.3 75.5 5
6 21.1 76.9 6
7 21.2 76.3 7
8 21.0 73.8 8
9 20.8 73.4 9
10 20.5 75.8 10
11 20.4 76.9 11
12 20.1 73.2 12
13 19.9 72.1 13
14 19.6 74.3 14
15 19.4 73.1 15
16 19.2 72.2 16
17 19.1 69.4 17
18 19.1 70.8 18
19 18.9 71.1 19
20 18.7 71.2 20
21 18.7 70.6 21
22 18.7 71.1 22
23 18.4 70.3 23
24 18.4 68.3 24
25 18.3 68.9 25
26 18.4 71.9 26
27 18.3 73.3 27
28 18.3 70.9 28
29 18.0 70.0 29
30 17.7 65.5 30
31 17.7 70.1 31
32 17.9 66.6 32
33 17.6 67.4 33
34 17.7 67.8 34
35 17.4 69.4 35
36 17.1 69.4 36
37 16.8 66.7 37
38 16.5 65.0 38
39 16.2 63.1 39
40 15.8 65.0 40
41 15.5 63.9 41
42 15.2 63.0 42
43 14.9 62.2 43
44 14.6 61.4 44
45 14.4 61.0 45
46 14.5 58.8 46
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Marriage t
12.9683 0.1175 -0.1154
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.54551 -0.22086 -0.03703 0.22855 0.79642
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12.968278 2.110089 6.146 2.24e-07 ***
Marriage 0.117529 0.027051 4.345 8.36e-05 ***
t -0.115378 0.009733 -11.854 3.88e-15 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3233 on 43 degrees of freedom
Multiple R-squared: 0.9776, Adjusted R-squared: 0.9765
F-statistic: 937.4 on 2 and 43 DF, p-value: < 2.2e-16
> 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.794884e-02 5.589768e-02 0.97205116
[2,] 3.742354e-02 7.484708e-02 0.96257646
[3,] 1.636929e-02 3.273858e-02 0.98363071
[4,] 5.743521e-03 1.148704e-02 0.99425648
[5,] 2.241134e-03 4.482268e-03 0.99775887
[6,] 6.960879e-04 1.392176e-03 0.99930391
[7,] 4.291005e-04 8.582009e-04 0.99957090
[8,] 2.137048e-04 4.274097e-04 0.99978630
[9,] 2.952511e-04 5.905023e-04 0.99970475
[10,] 2.661990e-04 5.323979e-04 0.99973380
[11,] 2.031146e-04 4.062292e-04 0.99979689
[12,] 6.813166e-05 1.362633e-04 0.99993187
[13,] 4.388577e-05 8.777154e-05 0.99995611
[14,] 2.473755e-05 4.947510e-05 0.99997526
[15,] 1.702689e-05 3.405378e-05 0.99998297
[16,] 3.435806e-05 6.871612e-05 0.99996564
[17,] 2.335060e-04 4.670121e-04 0.99976649
[18,] 4.100898e-04 8.201796e-04 0.99958991
[19,] 1.070411e-03 2.140823e-03 0.99892959
[20,] 3.531935e-03 7.063871e-03 0.99646806
[21,] 2.423447e-02 4.846894e-02 0.97576553
[22,] 8.420364e-02 1.684073e-01 0.91579636
[23,] 1.897164e-01 3.794327e-01 0.81028363
[24,] 3.469757e-01 6.939515e-01 0.65302427
[25,] 5.551229e-01 8.897541e-01 0.44487707
[26,] 9.154382e-01 1.691236e-01 0.08456181
[27,] 9.532247e-01 9.355062e-02 0.04677531
[28,] 9.859088e-01 2.818231e-02 0.01409115
[29,] 9.808731e-01 3.825371e-02 0.01912686
[30,] 9.689977e-01 6.200458e-02 0.03100229
[31,] 9.789540e-01 4.209194e-02 0.02104597
[32,] 9.810100e-01 3.798001e-02 0.01899001
[33,] 9.658480e-01 6.830396e-02 0.03415198
[34,] 9.594709e-01 8.105813e-02 0.04052907
[35,] 9.583658e-01 8.326843e-02 0.04163422
> postscript(file="/var/wessaorg/rcomp/tmp/17eid1322123590.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/27a6z1322123590.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/3fuum1322123590.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/4k6g91322123590.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/59oh01322123590.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 = 46
Frequency = 1
1 2 3 4 5 6
-0.03188142 0.08349658 0.42197744 0.22560258 0.03520487 -0.21395712
7 8 9 10 11 12
0.07193802 0.28113745 0.24352688 -0.22316368 -0.33706711 -0.08683340
13 14 15 16 17 18
-0.04217397 -0.48535882 -0.42894653 -0.40779281 -0.06333482 -0.11249681
19 20 21 22 23 24
-0.23237738 -0.32875223 -0.14285709 -0.08624337 -0.17684251 0.17359263
25 26 27 28 29 30
0.11845349 -0.01875421 -0.16791621 0.22953036 0.15068408 0.49494065
31 32 33 34 35 36
0.06968723 0.79641522 0.51777037 0.68613695 0.31346924 0.12884724
37 38 39 40 41 42
0.26155238 0.27672895 0.31541124 -0.19251504 -0.24785561 -0.32670189
43 44 45 46
-0.41730104 -0.50790018 -0.54551075 -0.07156989
> postscript(file="/var/wessaorg/rcomp/tmp/60tdz1322123590.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 = 46
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.03188142 NA
1 0.08349658 -0.03188142
2 0.42197744 0.08349658
3 0.22560258 0.42197744
4 0.03520487 0.22560258
5 -0.21395712 0.03520487
6 0.07193802 -0.21395712
7 0.28113745 0.07193802
8 0.24352688 0.28113745
9 -0.22316368 0.24352688
10 -0.33706711 -0.22316368
11 -0.08683340 -0.33706711
12 -0.04217397 -0.08683340
13 -0.48535882 -0.04217397
14 -0.42894653 -0.48535882
15 -0.40779281 -0.42894653
16 -0.06333482 -0.40779281
17 -0.11249681 -0.06333482
18 -0.23237738 -0.11249681
19 -0.32875223 -0.23237738
20 -0.14285709 -0.32875223
21 -0.08624337 -0.14285709
22 -0.17684251 -0.08624337
23 0.17359263 -0.17684251
24 0.11845349 0.17359263
25 -0.01875421 0.11845349
26 -0.16791621 -0.01875421
27 0.22953036 -0.16791621
28 0.15068408 0.22953036
29 0.49494065 0.15068408
30 0.06968723 0.49494065
31 0.79641522 0.06968723
32 0.51777037 0.79641522
33 0.68613695 0.51777037
34 0.31346924 0.68613695
35 0.12884724 0.31346924
36 0.26155238 0.12884724
37 0.27672895 0.26155238
38 0.31541124 0.27672895
39 -0.19251504 0.31541124
40 -0.24785561 -0.19251504
41 -0.32670189 -0.24785561
42 -0.41730104 -0.32670189
43 -0.50790018 -0.41730104
44 -0.54551075 -0.50790018
45 -0.07156989 -0.54551075
46 NA -0.07156989
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.08349658 -0.03188142
[2,] 0.42197744 0.08349658
[3,] 0.22560258 0.42197744
[4,] 0.03520487 0.22560258
[5,] -0.21395712 0.03520487
[6,] 0.07193802 -0.21395712
[7,] 0.28113745 0.07193802
[8,] 0.24352688 0.28113745
[9,] -0.22316368 0.24352688
[10,] -0.33706711 -0.22316368
[11,] -0.08683340 -0.33706711
[12,] -0.04217397 -0.08683340
[13,] -0.48535882 -0.04217397
[14,] -0.42894653 -0.48535882
[15,] -0.40779281 -0.42894653
[16,] -0.06333482 -0.40779281
[17,] -0.11249681 -0.06333482
[18,] -0.23237738 -0.11249681
[19,] -0.32875223 -0.23237738
[20,] -0.14285709 -0.32875223
[21,] -0.08624337 -0.14285709
[22,] -0.17684251 -0.08624337
[23,] 0.17359263 -0.17684251
[24,] 0.11845349 0.17359263
[25,] -0.01875421 0.11845349
[26,] -0.16791621 -0.01875421
[27,] 0.22953036 -0.16791621
[28,] 0.15068408 0.22953036
[29,] 0.49494065 0.15068408
[30,] 0.06968723 0.49494065
[31,] 0.79641522 0.06968723
[32,] 0.51777037 0.79641522
[33,] 0.68613695 0.51777037
[34,] 0.31346924 0.68613695
[35,] 0.12884724 0.31346924
[36,] 0.26155238 0.12884724
[37,] 0.27672895 0.26155238
[38,] 0.31541124 0.27672895
[39,] -0.19251504 0.31541124
[40,] -0.24785561 -0.19251504
[41,] -0.32670189 -0.24785561
[42,] -0.41730104 -0.32670189
[43,] -0.50790018 -0.41730104
[44,] -0.54551075 -0.50790018
[45,] -0.07156989 -0.54551075
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.08349658 -0.03188142
2 0.42197744 0.08349658
3 0.22560258 0.42197744
4 0.03520487 0.22560258
5 -0.21395712 0.03520487
6 0.07193802 -0.21395712
7 0.28113745 0.07193802
8 0.24352688 0.28113745
9 -0.22316368 0.24352688
10 -0.33706711 -0.22316368
11 -0.08683340 -0.33706711
12 -0.04217397 -0.08683340
13 -0.48535882 -0.04217397
14 -0.42894653 -0.48535882
15 -0.40779281 -0.42894653
16 -0.06333482 -0.40779281
17 -0.11249681 -0.06333482
18 -0.23237738 -0.11249681
19 -0.32875223 -0.23237738
20 -0.14285709 -0.32875223
21 -0.08624337 -0.14285709
22 -0.17684251 -0.08624337
23 0.17359263 -0.17684251
24 0.11845349 0.17359263
25 -0.01875421 0.11845349
26 -0.16791621 -0.01875421
27 0.22953036 -0.16791621
28 0.15068408 0.22953036
29 0.49494065 0.15068408
30 0.06968723 0.49494065
31 0.79641522 0.06968723
32 0.51777037 0.79641522
33 0.68613695 0.51777037
34 0.31346924 0.68613695
35 0.12884724 0.31346924
36 0.26155238 0.12884724
37 0.27672895 0.26155238
38 0.31541124 0.27672895
39 -0.19251504 0.31541124
40 -0.24785561 -0.19251504
41 -0.32670189 -0.24785561
42 -0.41730104 -0.32670189
43 -0.50790018 -0.41730104
44 -0.54551075 -0.50790018
45 -0.07156989 -0.54551075
> 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/7txlq1322123590.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/8gu3n1322123590.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/99m1g1322123590.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/10w7gc1322123590.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/112aym1322123590.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/12hfwr1322123590.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/133dr41322123591.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/1474301322123591.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/152pri1322123591.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/16ju6t1322123591.tab")
+ }
>
> try(system("convert tmp/17eid1322123590.ps tmp/17eid1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/27a6z1322123590.ps tmp/27a6z1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/3fuum1322123590.ps tmp/3fuum1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/4k6g91322123590.ps tmp/4k6g91322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/59oh01322123590.ps tmp/59oh01322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/60tdz1322123590.ps tmp/60tdz1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/7txlq1322123590.ps tmp/7txlq1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/8gu3n1322123590.ps tmp/8gu3n1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/99m1g1322123590.ps tmp/99m1g1322123590.png",intern=TRUE))
character(0)
> try(system("convert tmp/10w7gc1322123590.ps tmp/10w7gc1322123590.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.106 0.531 3.644