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,1.8,21.8,74.5,1.8,21.5,74.6,1.8,21.3,75.5,1.8,21.1,76.9,1.8,21.2,76.3,1.8,21,73.8,1.8,20.8,73.4,1.8,20.5,75.8,1.8,20.4,76.9,1.8,20.1,73.2,1.8,19.9,72.1,1.8,19.6,74.3,1.8,19.4,73.1,1.8,19.2,72.2,1.8,19.1,69.4,1.8,19.1,70.8,1.8,18.9,71.1,1.8,18.7,71.2,1.8,18.7,70.6,1.8,18.7,71.1,1.8,18.4,70.3,1.8,18.4,68.3,1.8,18.3,68.9,412.3,18.4,71.9,420.3,18.3,73.3,395.5,18.3,70.9,392.1,18,70,378.6,17.7,65.5,338.7,17.7,70.1,285.8,17.9,66.6,255.3,17.6,67.4,256.4,17.7,67.8,287.1,17.4,69.4,353.9,17.1,69.4,406.4,16.8,66.7,406.7,16.5,65,400.7,16.2,63.1,390.1,15.8,65,399.7,15.5,63.9,370.3,15.2,63,301.9,14.9,62.2,285.6,14.6,61.4,330.6,14.4,61,362.3,14.5,58.8,379.1,14.2,61,390.4),dim=c(3,46),dimnames=list(c('sterfte','huwelijk','Unemployment'),1:46))
> y <- array(NA,dim=c(3,46),dimnames=list(c('sterfte','huwelijk','Unemployment'),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 = '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
> 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
huwelijk sterfte Unemployment
1 78.1 22.0 1.8
2 74.5 21.8 1.8
3 74.6 21.5 1.8
4 75.5 21.3 1.8
5 76.9 21.1 1.8
6 76.3 21.2 1.8
7 73.8 21.0 1.8
8 73.4 20.8 1.8
9 75.8 20.5 1.8
10 76.9 20.4 1.8
11 73.2 20.1 1.8
12 72.1 19.9 1.8
13 74.3 19.6 1.8
14 73.1 19.4 1.8
15 72.2 19.2 1.8
16 69.4 19.1 1.8
17 70.8 19.1 1.8
18 71.1 18.9 1.8
19 71.2 18.7 1.8
20 70.6 18.7 1.8
21 71.1 18.7 1.8
22 70.3 18.4 1.8
23 68.3 18.4 1.8
24 68.9 18.3 412.3
25 71.9 18.4 420.3
26 73.3 18.3 395.5
27 70.9 18.3 392.1
28 70.0 18.0 378.6
29 65.5 17.7 338.7
30 70.1 17.7 285.8
31 66.6 17.9 255.3
32 67.4 17.6 256.4
33 67.8 17.7 287.1
34 69.4 17.4 353.9
35 69.4 17.1 406.4
36 66.7 16.8 406.7
37 65.0 16.5 400.7
38 63.1 16.2 390.1
39 65.0 15.8 399.7
40 63.9 15.5 370.3
41 63.0 15.2 301.9
42 62.2 14.9 285.6
43 61.4 14.6 330.6
44 61.0 14.4 362.3
45 58.8 14.5 379.1
46 61.0 14.2 390.4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) sterfte Unemployment
26.730851 2.321428 0.002388
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.1290 -0.9514 0.2779 0.9390 3.1425
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 26.730851 3.301468 8.097 3.46e-10 ***
sterfte 2.321428 0.164870 14.080 < 2e-16 ***
Unemployment 0.002388 0.001923 1.242 0.221
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.501 on 43 degrees of freedom
Multiple R-squared: 0.9087, Adjusted R-squared: 0.9045
F-statistic: 214 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,] 0.7651133 0.4697735 0.2348867
[2,] 0.7664144 0.4671712 0.2335856
[3,] 0.7360831 0.5278338 0.2639169
[4,] 0.7253094 0.5493811 0.2746906
[5,] 0.7887978 0.4224044 0.2112022
[6,] 0.7706821 0.4586358 0.2293179
[7,] 0.7806066 0.4387868 0.2193934
[8,] 0.7475140 0.5049721 0.2524860
[9,] 0.6741769 0.6516463 0.3258231
[10,] 0.6008359 0.7983282 0.3991641
[11,] 0.7521551 0.4956899 0.2478449
[12,] 0.6967649 0.6064703 0.3032351
[13,] 0.6113820 0.7772360 0.3886180
[14,] 0.5339148 0.9321705 0.4660852
[15,] 0.4476380 0.8952759 0.5523620
[16,] 0.3819877 0.7639755 0.6180123
[17,] 0.3491898 0.6983796 0.6508102
[18,] 0.3509949 0.7019897 0.6490051
[19,] 0.3413237 0.6826474 0.6586763
[20,] 0.3370673 0.6741346 0.6629327
[21,] 0.5193786 0.9612427 0.4806214
[22,] 0.4406971 0.8813942 0.5593029
[23,] 0.3681601 0.7363201 0.6318399
[24,] 0.7171776 0.5656449 0.2828224
[25,] 0.7533189 0.4933622 0.2466811
[26,] 0.8290303 0.3419394 0.1709697
[27,] 0.7893329 0.4213342 0.2106671
[28,] 0.8000147 0.3999705 0.1999853
[29,] 0.7344181 0.5311638 0.2655819
[30,] 0.8361035 0.3277930 0.1638965
[31,] 0.7770265 0.4459471 0.2229735
[32,] 0.6802666 0.6394668 0.3197334
[33,] 0.8170902 0.3658197 0.1829098
[34,] 0.7038909 0.5922181 0.2961091
[35,] 0.6439284 0.7121432 0.3560716
> postscript(file="/var/wessaorg/rcomp/tmp/1stiw1322009159.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/2l83d1322009159.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/36mps1322009159.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/4ktqb1322009159.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/5endd1322009159.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.293442976 -2.842271505 -2.045843227 -0.681557708 1.182727811 0.350585052
7 8 9 10 11 12
-1.685129430 -1.620843911 1.475584367 2.807727127 -0.195844595 -0.831559076
13 14 15 16 17 18
2.064869202 1.329154721 0.893440240 -1.674417001 -0.274417001 0.489868518
19 20 21 22 23 24
1.054154037 0.454154037 0.954154037 0.850582315 -1.149417685 -1.297632784
25 26 27 28 29 30
1.451118822 3.142489048 0.750608942 0.579277978 -3.129004393 1.597331614
31 32 33 34 35 36
-2.294113674 -0.800312420 -0.705773051 1.431123181 2.002170734 -0.002117449
37 38 39 40 41 42
-0.991359945 -2.169616702 0.636027575 0.302669059 0.262450511 0.197806519
43 44 45 46
-0.013234396 -0.024654953 -2.496919544 0.372522026
> postscript(file="/var/wessaorg/rcomp/tmp/6o8gu1322009159.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.293442976 NA
1 -2.842271505 0.293442976
2 -2.045843227 -2.842271505
3 -0.681557708 -2.045843227
4 1.182727811 -0.681557708
5 0.350585052 1.182727811
6 -1.685129430 0.350585052
7 -1.620843911 -1.685129430
8 1.475584367 -1.620843911
9 2.807727127 1.475584367
10 -0.195844595 2.807727127
11 -0.831559076 -0.195844595
12 2.064869202 -0.831559076
13 1.329154721 2.064869202
14 0.893440240 1.329154721
15 -1.674417001 0.893440240
16 -0.274417001 -1.674417001
17 0.489868518 -0.274417001
18 1.054154037 0.489868518
19 0.454154037 1.054154037
20 0.954154037 0.454154037
21 0.850582315 0.954154037
22 -1.149417685 0.850582315
23 -1.297632784 -1.149417685
24 1.451118822 -1.297632784
25 3.142489048 1.451118822
26 0.750608942 3.142489048
27 0.579277978 0.750608942
28 -3.129004393 0.579277978
29 1.597331614 -3.129004393
30 -2.294113674 1.597331614
31 -0.800312420 -2.294113674
32 -0.705773051 -0.800312420
33 1.431123181 -0.705773051
34 2.002170734 1.431123181
35 -0.002117449 2.002170734
36 -0.991359945 -0.002117449
37 -2.169616702 -0.991359945
38 0.636027575 -2.169616702
39 0.302669059 0.636027575
40 0.262450511 0.302669059
41 0.197806519 0.262450511
42 -0.013234396 0.197806519
43 -0.024654953 -0.013234396
44 -2.496919544 -0.024654953
45 0.372522026 -2.496919544
46 NA 0.372522026
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.842271505 0.293442976
[2,] -2.045843227 -2.842271505
[3,] -0.681557708 -2.045843227
[4,] 1.182727811 -0.681557708
[5,] 0.350585052 1.182727811
[6,] -1.685129430 0.350585052
[7,] -1.620843911 -1.685129430
[8,] 1.475584367 -1.620843911
[9,] 2.807727127 1.475584367
[10,] -0.195844595 2.807727127
[11,] -0.831559076 -0.195844595
[12,] 2.064869202 -0.831559076
[13,] 1.329154721 2.064869202
[14,] 0.893440240 1.329154721
[15,] -1.674417001 0.893440240
[16,] -0.274417001 -1.674417001
[17,] 0.489868518 -0.274417001
[18,] 1.054154037 0.489868518
[19,] 0.454154037 1.054154037
[20,] 0.954154037 0.454154037
[21,] 0.850582315 0.954154037
[22,] -1.149417685 0.850582315
[23,] -1.297632784 -1.149417685
[24,] 1.451118822 -1.297632784
[25,] 3.142489048 1.451118822
[26,] 0.750608942 3.142489048
[27,] 0.579277978 0.750608942
[28,] -3.129004393 0.579277978
[29,] 1.597331614 -3.129004393
[30,] -2.294113674 1.597331614
[31,] -0.800312420 -2.294113674
[32,] -0.705773051 -0.800312420
[33,] 1.431123181 -0.705773051
[34,] 2.002170734 1.431123181
[35,] -0.002117449 2.002170734
[36,] -0.991359945 -0.002117449
[37,] -2.169616702 -0.991359945
[38,] 0.636027575 -2.169616702
[39,] 0.302669059 0.636027575
[40,] 0.262450511 0.302669059
[41,] 0.197806519 0.262450511
[42,] -0.013234396 0.197806519
[43,] -0.024654953 -0.013234396
[44,] -2.496919544 -0.024654953
[45,] 0.372522026 -2.496919544
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.842271505 0.293442976
2 -2.045843227 -2.842271505
3 -0.681557708 -2.045843227
4 1.182727811 -0.681557708
5 0.350585052 1.182727811
6 -1.685129430 0.350585052
7 -1.620843911 -1.685129430
8 1.475584367 -1.620843911
9 2.807727127 1.475584367
10 -0.195844595 2.807727127
11 -0.831559076 -0.195844595
12 2.064869202 -0.831559076
13 1.329154721 2.064869202
14 0.893440240 1.329154721
15 -1.674417001 0.893440240
16 -0.274417001 -1.674417001
17 0.489868518 -0.274417001
18 1.054154037 0.489868518
19 0.454154037 1.054154037
20 0.954154037 0.454154037
21 0.850582315 0.954154037
22 -1.149417685 0.850582315
23 -1.297632784 -1.149417685
24 1.451118822 -1.297632784
25 3.142489048 1.451118822
26 0.750608942 3.142489048
27 0.579277978 0.750608942
28 -3.129004393 0.579277978
29 1.597331614 -3.129004393
30 -2.294113674 1.597331614
31 -0.800312420 -2.294113674
32 -0.705773051 -0.800312420
33 1.431123181 -0.705773051
34 2.002170734 1.431123181
35 -0.002117449 2.002170734
36 -0.991359945 -0.002117449
37 -2.169616702 -0.991359945
38 0.636027575 -2.169616702
39 0.302669059 0.636027575
40 0.262450511 0.302669059
41 0.197806519 0.262450511
42 -0.013234396 0.197806519
43 -0.024654953 -0.013234396
44 -2.496919544 -0.024654953
45 0.372522026 -2.496919544
> 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/7g7nn1322009159.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/8umqn1322009159.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/9f8j11322009159.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/10hmen1322009159.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/1194gt1322009159.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/12x65c1322009159.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/13uiqj1322009159.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/14r6d71322009159.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/15e0u81322009159.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/16nlw31322009159.tab")
+ }
>
> try(system("convert tmp/1stiw1322009159.ps tmp/1stiw1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/2l83d1322009159.ps tmp/2l83d1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/36mps1322009159.ps tmp/36mps1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ktqb1322009159.ps tmp/4ktqb1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/5endd1322009159.ps tmp/5endd1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/6o8gu1322009159.ps tmp/6o8gu1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/7g7nn1322009159.ps tmp/7g7nn1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/8umqn1322009159.ps tmp/8umqn1322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/9f8j11322009159.ps tmp/9f8j11322009159.png",intern=TRUE))
character(0)
> try(system("convert tmp/10hmen1322009159.ps tmp/10hmen1322009159.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.032 0.571 3.676