R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(2514,2550,2537,2572,2564,2597,2595,2623,2617,2647,2638,2670,2657,2690,2668,2705,2683,2721,2687,2729,2705,2747,2717,2761,2728,2773,2741,2786,2752,2796,2759,2807,2767,2817,2774,2827,2781,2838,2788,2847,2789,2853,2795,2860,2798,2864,2801,2869,2803,2873,2808,2877,2813,2883,2826,2896,2835,2905,2849,2919,2862,2933,2877,2948,2888,2959,2897,2969,2902,2978,2911,2988,2917,2996,2924,3003,2930,3011,2935,3018,2945,3028,2957,3038,2967,3049,2980,3063,2997,3081,3017,3100,3040,3122,3064,3145,3085,3167,3113,3193),dim=c(2,50),dimnames=list(c('Mannen','vrouwen'),1:50))
> y <- array(NA,dim=c(2,50),dimnames=list(c('Mannen','vrouwen'),1:50))
> 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 = '2'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '2'
> #'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, 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
vrouwen Mannen
1 2550 2514
2 2572 2537
3 2597 2564
4 2623 2595
5 2647 2617
6 2670 2638
7 2690 2657
8 2705 2668
9 2721 2683
10 2729 2687
11 2747 2705
12 2761 2717
13 2773 2728
14 2786 2741
15 2796 2752
16 2807 2759
17 2817 2767
18 2827 2774
19 2838 2781
20 2847 2788
21 2853 2789
22 2860 2795
23 2864 2798
24 2869 2801
25 2873 2803
26 2877 2808
27 2883 2813
28 2896 2826
29 2905 2835
30 2919 2849
31 2933 2862
32 2948 2877
33 2959 2888
34 2969 2897
35 2978 2902
36 2988 2911
37 2996 2917
38 3003 2924
39 3011 2930
40 3018 2935
41 3028 2945
42 3038 2957
43 3049 2967
44 3063 2980
45 3081 2997
46 3100 3017
47 3122 3040
48 3145 3064
49 3167 3085
50 3193 3113
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Mannen
-274.181 1.119
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-16.805 -6.163 1.320 5.955 10.580
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.742e+02 1.941e+01 -14.13 <2e-16 ***
Mannen 1.119e+00 6.873e-03 162.84 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.875 on 48 degrees of freedom
Multiple R-squared: 0.9982, Adjusted R-squared: 0.9982
F-statistic: 2.652e+04 on 1 and 48 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,] 0.01656474 3.312949e-02 9.834353e-01
[2,] 0.02102954 4.205907e-02 9.789705e-01
[3,] 0.01802259 3.604518e-02 9.819774e-01
[4,] 0.03761124 7.522247e-02 9.623888e-01
[5,] 0.04204794 8.409587e-02 9.579521e-01
[6,] 0.07565342 1.513068e-01 9.243466e-01
[7,] 0.07698088 1.539618e-01 9.230191e-01
[8,] 0.08319697 1.663939e-01 9.168030e-01
[9,] 0.08625822 1.725164e-01 9.137418e-01
[10,] 0.08983712 1.796742e-01 9.101629e-01
[11,] 0.12213884 2.442777e-01 8.778612e-01
[12,] 0.19847355 3.969471e-01 8.015265e-01
[13,] 0.36535357 7.307071e-01 6.346464e-01
[14,] 0.63985577 7.202885e-01 3.601442e-01
[15,] 0.87663149 2.467370e-01 1.233685e-01
[16,] 0.97213369 5.573262e-02 2.786631e-02
[17,] 0.99442563 1.114875e-02 5.574373e-03
[18,] 0.99815943 3.681134e-03 1.840567e-03
[19,] 0.99912385 1.752301e-03 8.761506e-04
[20,] 0.99943446 1.131079e-03 5.655396e-04
[21,] 0.99956359 8.728151e-04 4.364076e-04
[22,] 0.99949359 1.012812e-03 5.064058e-04
[23,] 0.99932026 1.359482e-03 6.797412e-04
[24,] 0.99894688 2.106234e-03 1.053117e-03
[25,] 0.99839776 3.204481e-03 1.602240e-03
[26,] 0.99793814 4.123715e-03 2.061858e-03
[27,] 0.99749377 5.012455e-03 2.506228e-03
[28,] 0.99807096 3.858078e-03 1.929039e-03
[29,] 0.99940438 1.191242e-03 5.956209e-04
[30,] 0.99995253 9.493742e-05 4.746871e-05
[31,] 0.99997739 4.521784e-05 2.260892e-05
[32,] 0.99999258 1.483645e-05 7.418226e-06
[33,] 0.99999267 1.466702e-05 7.333511e-06
[34,] 0.99999835 3.306868e-06 1.653434e-06
[35,] 0.99999758 4.838258e-06 2.419129e-06
[36,] 0.99998545 2.910041e-05 1.455021e-05
[37,] 0.99991698 1.660319e-04 8.301596e-05
[38,] 0.99992610 1.477907e-04 7.389537e-05
[39,] 0.99991566 1.686787e-04 8.433935e-05
[40,] 0.99966388 6.722498e-04 3.361249e-04
[41,] 0.99748756 5.024874e-03 2.512437e-03
> postscript(file="/var/fisher/rcomp/tmp/1xrz61353431757.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/fisher/rcomp/tmp/2rbzn1353431757.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/fisher/rcomp/tmp/3tijx1353431757.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/fisher/rcomp/tmp/48ag51353431757.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/fisher/rcomp/tmp/5pkk81353431757.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 = 50
Frequency = 1
1 2 3 4 5 6
10.5798580 6.8388737 1.6211965 -7.0731736 -7.6949847 -8.1976225
7 8 9 10 11 12
-9.4619139 -6.7728194 -7.5604179 -4.0371108 -6.1822289 -5.6123077
13 14 15 16 17 18
-5.9232132 -7.4724652 -9.7833707 -6.6175834 -5.5709692 -3.4051818
19 20 21 22 23 24
-0.2393944 0.9263930 5.8072197 6.0921804 6.7346607 8.3771410
25 26 27 28 29 30
10.1387945 8.5429284 8.9470622 7.3978102 6.3252512 4.6568259
31 32 33 34 35 36
4.1075739 2.3199755 1.0090700 0.9365109 4.3406447 4.2680857
37 38 39 40 41 42
5.5530463 4.7188337 6.0037943 7.4079281 6.2161958 2.7861171
43 44 45 46 47 48
2.5943848 2.0451328 1.0191879 -2.3642767 -6.1052610 -9.9654185
49 50
-11.4680564 -16.8049068
> postscript(file="/var/fisher/rcomp/tmp/6n4zh1353431757.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 = 50
Frequency = 1
lag(myerror, k = 1) myerror
0 10.5798580 NA
1 6.8388737 10.5798580
2 1.6211965 6.8388737
3 -7.0731736 1.6211965
4 -7.6949847 -7.0731736
5 -8.1976225 -7.6949847
6 -9.4619139 -8.1976225
7 -6.7728194 -9.4619139
8 -7.5604179 -6.7728194
9 -4.0371108 -7.5604179
10 -6.1822289 -4.0371108
11 -5.6123077 -6.1822289
12 -5.9232132 -5.6123077
13 -7.4724652 -5.9232132
14 -9.7833707 -7.4724652
15 -6.6175834 -9.7833707
16 -5.5709692 -6.6175834
17 -3.4051818 -5.5709692
18 -0.2393944 -3.4051818
19 0.9263930 -0.2393944
20 5.8072197 0.9263930
21 6.0921804 5.8072197
22 6.7346607 6.0921804
23 8.3771410 6.7346607
24 10.1387945 8.3771410
25 8.5429284 10.1387945
26 8.9470622 8.5429284
27 7.3978102 8.9470622
28 6.3252512 7.3978102
29 4.6568259 6.3252512
30 4.1075739 4.6568259
31 2.3199755 4.1075739
32 1.0090700 2.3199755
33 0.9365109 1.0090700
34 4.3406447 0.9365109
35 4.2680857 4.3406447
36 5.5530463 4.2680857
37 4.7188337 5.5530463
38 6.0037943 4.7188337
39 7.4079281 6.0037943
40 6.2161958 7.4079281
41 2.7861171 6.2161958
42 2.5943848 2.7861171
43 2.0451328 2.5943848
44 1.0191879 2.0451328
45 -2.3642767 1.0191879
46 -6.1052610 -2.3642767
47 -9.9654185 -6.1052610
48 -11.4680564 -9.9654185
49 -16.8049068 -11.4680564
50 NA -16.8049068
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 6.8388737 10.5798580
[2,] 1.6211965 6.8388737
[3,] -7.0731736 1.6211965
[4,] -7.6949847 -7.0731736
[5,] -8.1976225 -7.6949847
[6,] -9.4619139 -8.1976225
[7,] -6.7728194 -9.4619139
[8,] -7.5604179 -6.7728194
[9,] -4.0371108 -7.5604179
[10,] -6.1822289 -4.0371108
[11,] -5.6123077 -6.1822289
[12,] -5.9232132 -5.6123077
[13,] -7.4724652 -5.9232132
[14,] -9.7833707 -7.4724652
[15,] -6.6175834 -9.7833707
[16,] -5.5709692 -6.6175834
[17,] -3.4051818 -5.5709692
[18,] -0.2393944 -3.4051818
[19,] 0.9263930 -0.2393944
[20,] 5.8072197 0.9263930
[21,] 6.0921804 5.8072197
[22,] 6.7346607 6.0921804
[23,] 8.3771410 6.7346607
[24,] 10.1387945 8.3771410
[25,] 8.5429284 10.1387945
[26,] 8.9470622 8.5429284
[27,] 7.3978102 8.9470622
[28,] 6.3252512 7.3978102
[29,] 4.6568259 6.3252512
[30,] 4.1075739 4.6568259
[31,] 2.3199755 4.1075739
[32,] 1.0090700 2.3199755
[33,] 0.9365109 1.0090700
[34,] 4.3406447 0.9365109
[35,] 4.2680857 4.3406447
[36,] 5.5530463 4.2680857
[37,] 4.7188337 5.5530463
[38,] 6.0037943 4.7188337
[39,] 7.4079281 6.0037943
[40,] 6.2161958 7.4079281
[41,] 2.7861171 6.2161958
[42,] 2.5943848 2.7861171
[43,] 2.0451328 2.5943848
[44,] 1.0191879 2.0451328
[45,] -2.3642767 1.0191879
[46,] -6.1052610 -2.3642767
[47,] -9.9654185 -6.1052610
[48,] -11.4680564 -9.9654185
[49,] -16.8049068 -11.4680564
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 6.8388737 10.5798580
2 1.6211965 6.8388737
3 -7.0731736 1.6211965
4 -7.6949847 -7.0731736
5 -8.1976225 -7.6949847
6 -9.4619139 -8.1976225
7 -6.7728194 -9.4619139
8 -7.5604179 -6.7728194
9 -4.0371108 -7.5604179
10 -6.1822289 -4.0371108
11 -5.6123077 -6.1822289
12 -5.9232132 -5.6123077
13 -7.4724652 -5.9232132
14 -9.7833707 -7.4724652
15 -6.6175834 -9.7833707
16 -5.5709692 -6.6175834
17 -3.4051818 -5.5709692
18 -0.2393944 -3.4051818
19 0.9263930 -0.2393944
20 5.8072197 0.9263930
21 6.0921804 5.8072197
22 6.7346607 6.0921804
23 8.3771410 6.7346607
24 10.1387945 8.3771410
25 8.5429284 10.1387945
26 8.9470622 8.5429284
27 7.3978102 8.9470622
28 6.3252512 7.3978102
29 4.6568259 6.3252512
30 4.1075739 4.6568259
31 2.3199755 4.1075739
32 1.0090700 2.3199755
33 0.9365109 1.0090700
34 4.3406447 0.9365109
35 4.2680857 4.3406447
36 5.5530463 4.2680857
37 4.7188337 5.5530463
38 6.0037943 4.7188337
39 7.4079281 6.0037943
40 6.2161958 7.4079281
41 2.7861171 6.2161958
42 2.5943848 2.7861171
43 2.0451328 2.5943848
44 1.0191879 2.0451328
45 -2.3642767 1.0191879
46 -6.1052610 -2.3642767
47 -9.9654185 -6.1052610
48 -11.4680564 -9.9654185
49 -16.8049068 -11.4680564
> 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/fisher/rcomp/tmp/7hkk21353431757.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/fisher/rcomp/tmp/837m41353431757.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/fisher/rcomp/tmp/9al7l1353431757.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/fisher/rcomp/tmp/10kkeb1353431757.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11elr21353431757.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/fisher/rcomp/tmp/12agw11353431757.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/fisher/rcomp/tmp/13zuaw1353431757.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/fisher/rcomp/tmp/14j6a61353431757.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/fisher/rcomp/tmp/15n1u61353431757.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/fisher/rcomp/tmp/16g3ig1353431757.tab")
+ }
>
> try(system("convert tmp/1xrz61353431757.ps tmp/1xrz61353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/2rbzn1353431757.ps tmp/2rbzn1353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/3tijx1353431757.ps tmp/3tijx1353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/48ag51353431757.ps tmp/48ag51353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/5pkk81353431757.ps tmp/5pkk81353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/6n4zh1353431757.ps tmp/6n4zh1353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hkk21353431757.ps tmp/7hkk21353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/837m41353431757.ps tmp/837m41353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/9al7l1353431757.ps tmp/9al7l1353431757.png",intern=TRUE))
character(0)
> try(system("convert tmp/10kkeb1353431757.ps tmp/10kkeb1353431757.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.086 1.363 7.448