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(410.5
+ ,113.938
+ ,2.54
+ ,418.5
+ ,106.985
+ ,2.63
+ ,393.7
+ ,112.758
+ ,2.59
+ ,390.3
+ ,116.718
+ ,2.68
+ ,376.8
+ ,110.100
+ ,2.71
+ ,336.9
+ ,115.045
+ ,2.61
+ ,284.0
+ ,115.613
+ ,2.52
+ ,253.5
+ ,115.212
+ ,2.41
+ ,254.6
+ ,121.744
+ ,2.31
+ ,285.3
+ ,120.471
+ ,2.27
+ ,352.1
+ ,118.660
+ ,2.25
+ ,404.6
+ ,119.471
+ ,2.21
+ ,404.9
+ ,117.424
+ ,2.09
+ ,398.9
+ ,118.254
+ ,1.95
+ ,388.3
+ ,116.159
+ ,1.83
+ ,397.9
+ ,119.425
+ ,1.74
+ ,368.5
+ ,118.641
+ ,1.73
+ ,300.1
+ ,112.672
+ ,1.71
+ ,283.8
+ ,115.388
+ ,1.69
+ ,328.8
+ ,112.010
+ ,1.69
+ ,360.5
+ ,113.698
+ ,1.68
+ ,377.3
+ ,112.326
+ ,1.66
+ ,388.6
+ ,111.871
+ ,1.61
+ ,412.3
+ ,114.562
+ ,1.57
+ ,420.3
+ ,110.687
+ ,1.54
+ ,395.5
+ ,111.612
+ ,1.51
+ ,392.1
+ ,111.343
+ ,1.54
+ ,378.6
+ ,105.426
+ ,1.54
+ ,338.7
+ ,104.577
+ ,1.57
+ ,285.8
+ ,107.336
+ ,1.58
+ ,255.3
+ ,104.130
+ ,1.62
+ ,256.4
+ ,104.149
+ ,1.66
+ ,287.1
+ ,104.200
+ ,1.65
+ ,353.9
+ ,106.824
+ ,1.61
+ ,406.4
+ ,103.778
+ ,1.56
+ ,406.7
+ ,104.897
+ ,1.56
+ ,400.7
+ ,104.275
+ ,1.59
+ ,390.1
+ ,103.851
+ ,1.60
+ ,399.7
+ ,104.583
+ ,1.60
+ ,370.3
+ ,104.904
+ ,1.62
+ ,301.9
+ ,104.903
+ ,1.67
+ ,285.6
+ ,103.447
+ ,1.67
+ ,330.6
+ ,105.642
+ ,1.67
+ ,362.3
+ ,107.039
+ ,1.66
+ ,379.1
+ ,101.256
+ ,1.72
+ ,390.4
+ ,103.278
+ ,1.76
+ ,383.2
+ ,101.587
+ ,1.80
+ ,353.0
+ ,100.658
+ ,1.82
+ ,333.4
+ ,104.587
+ ,1.86
+ ,379.6
+ ,104.509
+ ,1.84
+ ,405.9
+ ,104.902
+ ,1.84)
+ ,dim=c(3
+ ,51)
+ ,dimnames=list(c('Unemployment'
+ ,'Deaths'
+ ,'Fertility')
+ ,1:51))
> y <- array(NA,dim=c(3,51),dimnames=list(c('Unemployment','Deaths','Fertility'),1:51))
> 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 = '3'
> #'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
Fertility Unemployment Deaths
1 2.54 410.5 113.938
2 2.63 418.5 106.985
3 2.59 393.7 112.758
4 2.68 390.3 116.718
5 2.71 376.8 110.100
6 2.61 336.9 115.045
7 2.52 284.0 115.613
8 2.41 253.5 115.212
9 2.31 254.6 121.744
10 2.27 285.3 120.471
11 2.25 352.1 118.660
12 2.21 404.6 119.471
13 2.09 404.9 117.424
14 1.95 398.9 118.254
15 1.83 388.3 116.159
16 1.74 397.9 119.425
17 1.73 368.5 118.641
18 1.71 300.1 112.672
19 1.69 283.8 115.388
20 1.69 328.8 112.010
21 1.68 360.5 113.698
22 1.66 377.3 112.326
23 1.61 388.6 111.871
24 1.57 412.3 114.562
25 1.54 420.3 110.687
26 1.51 395.5 111.612
27 1.54 392.1 111.343
28 1.54 378.6 105.426
29 1.57 338.7 104.577
30 1.58 285.8 107.336
31 1.62 255.3 104.130
32 1.66 256.4 104.149
33 1.65 287.1 104.200
34 1.61 353.9 106.824
35 1.56 406.4 103.778
36 1.56 406.7 104.897
37 1.59 400.7 104.275
38 1.60 390.1 103.851
39 1.60 399.7 104.583
40 1.62 370.3 104.904
41 1.67 301.9 104.903
42 1.67 285.6 103.447
43 1.67 330.6 105.642
44 1.66 362.3 107.039
45 1.72 379.1 101.256
46 1.76 390.4 103.278
47 1.80 383.2 101.587
48 1.82 353.0 100.658
49 1.86 333.4 104.587
50 1.84 379.6 104.509
51 1.84 405.9 104.902
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Unemployment Deaths
-1.2893920 -0.0001614 0.0292532
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.42538 -0.22019 -0.08563 0.12560 0.85727
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.2893920 0.9223189 -1.398 0.16854
Unemployment -0.0001614 0.0009227 -0.175 0.86190
Deaths 0.0292532 0.0077324 3.783 0.00043 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3287 on 48 degrees of freedom
Multiple R-squared: 0.2307, Adjusted R-squared: 0.1987
F-statistic: 7.199 on 2 and 48 DF, p-value: 0.001844
> 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.06412238 1.282448e-01 9.358776e-01
[2,] 0.05275673 1.055135e-01 9.472433e-01
[3,] 0.05124319 1.024864e-01 9.487568e-01
[4,] 0.05347142 1.069428e-01 9.465286e-01
[5,] 0.08595693 1.719139e-01 9.140431e-01
[6,] 0.27730008 5.546002e-01 7.226999e-01
[7,] 0.53972304 9.205539e-01 4.602770e-01
[8,] 0.91767638 1.646472e-01 8.232362e-02
[9,] 0.99387212 1.225576e-02 6.127881e-03
[10,] 0.99993954 1.209145e-04 6.045723e-05
[11,] 0.99998631 2.737647e-05 1.368824e-05
[12,] 0.99999817 3.661874e-06 1.830937e-06
[13,] 1.00000000 8.147404e-09 4.073702e-09
[14,] 1.00000000 1.303373e-09 6.516865e-10
[15,] 1.00000000 2.904755e-10 1.452378e-10
[16,] 1.00000000 1.134664e-10 5.673318e-11
[17,] 1.00000000 6.586235e-11 3.293117e-11
[18,] 1.00000000 7.195885e-11 3.597943e-11
[19,] 1.00000000 7.754862e-11 3.877431e-11
[20,] 1.00000000 1.683204e-10 8.416020e-11
[21,] 1.00000000 4.102574e-10 2.051287e-10
[22,] 1.00000000 1.134915e-09 5.674574e-10
[23,] 1.00000000 2.308996e-09 1.154498e-09
[24,] 1.00000000 5.649367e-09 2.824683e-09
[25,] 0.99999999 2.203618e-08 1.101809e-08
[26,] 0.99999996 7.548589e-08 3.774294e-08
[27,] 0.99999985 2.922160e-07 1.461080e-07
[28,] 0.99999951 9.744033e-07 4.872017e-07
[29,] 0.99999811 3.770770e-06 1.885385e-06
[30,] 0.99999629 7.425224e-06 3.712612e-06
[31,] 0.99999241 1.518938e-05 7.594688e-06
[32,] 0.99998518 2.964990e-05 1.482495e-05
[33,] 0.99997704 4.591751e-05 2.295875e-05
[34,] 0.99997701 4.598538e-05 2.299269e-05
[35,] 0.99997090 5.819636e-05 2.909818e-05
[36,] 0.99985332 2.933686e-04 1.466843e-04
[37,] 0.99935876 1.282478e-03 6.412391e-04
[38,] 0.99820160 3.596797e-03 1.798399e-03
[39,] 0.99956494 8.701290e-04 4.350645e-04
[40,] 0.99876447 2.471056e-03 1.235528e-03
> postscript(file="/var/wessaorg/rcomp/tmp/1qnfk1322006701.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/2t39t1322006701.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/3bcg11322006701.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/4svwx1322006701.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/5jbad1322006701.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 = 51
Frequency = 1
1 2 3 4 5 6
0.562582851 0.857271344 0.644390611 0.617999262 0.839418472 0.588322701
7 8 9 10 11 12
0.473170393 0.369979135 0.079074710 0.081268107 0.125025195 0.069772785
13 14 15 16 17 18
0.009702506 -0.155545876 -0.215970937 -0.399962748 -0.391772522 -0.248197871
19 20 21 22 23 24
-0.350279910 -0.244200922 -0.298464894 -0.275618477 -0.310484785 -0.425380683
25 26 27 28 29 30
-0.340733553 -0.401794750 -0.364474297 -0.193561584 -0.145164287 -0.224410366
31 32 33 34 35 36
-0.095546386 -0.055924689 -0.062462535 -0.168443410 -0.120866209 -0.153552134
37 38 39 40 41 42
-0.106324862 -0.085632028 -0.105496220 -0.099630784 -0.060639258 -0.020676928
43 44 45 46 47 48
-0.077626049 -0.123377338 0.108504964 0.091178469 0.179483772 0.221786617
49 50 51
0.143687918 0.133424975 0.126172504
> postscript(file="/var/wessaorg/rcomp/tmp/60ksw1322006701.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 = 51
Frequency = 1
lag(myerror, k = 1) myerror
0 0.562582851 NA
1 0.857271344 0.562582851
2 0.644390611 0.857271344
3 0.617999262 0.644390611
4 0.839418472 0.617999262
5 0.588322701 0.839418472
6 0.473170393 0.588322701
7 0.369979135 0.473170393
8 0.079074710 0.369979135
9 0.081268107 0.079074710
10 0.125025195 0.081268107
11 0.069772785 0.125025195
12 0.009702506 0.069772785
13 -0.155545876 0.009702506
14 -0.215970937 -0.155545876
15 -0.399962748 -0.215970937
16 -0.391772522 -0.399962748
17 -0.248197871 -0.391772522
18 -0.350279910 -0.248197871
19 -0.244200922 -0.350279910
20 -0.298464894 -0.244200922
21 -0.275618477 -0.298464894
22 -0.310484785 -0.275618477
23 -0.425380683 -0.310484785
24 -0.340733553 -0.425380683
25 -0.401794750 -0.340733553
26 -0.364474297 -0.401794750
27 -0.193561584 -0.364474297
28 -0.145164287 -0.193561584
29 -0.224410366 -0.145164287
30 -0.095546386 -0.224410366
31 -0.055924689 -0.095546386
32 -0.062462535 -0.055924689
33 -0.168443410 -0.062462535
34 -0.120866209 -0.168443410
35 -0.153552134 -0.120866209
36 -0.106324862 -0.153552134
37 -0.085632028 -0.106324862
38 -0.105496220 -0.085632028
39 -0.099630784 -0.105496220
40 -0.060639258 -0.099630784
41 -0.020676928 -0.060639258
42 -0.077626049 -0.020676928
43 -0.123377338 -0.077626049
44 0.108504964 -0.123377338
45 0.091178469 0.108504964
46 0.179483772 0.091178469
47 0.221786617 0.179483772
48 0.143687918 0.221786617
49 0.133424975 0.143687918
50 0.126172504 0.133424975
51 NA 0.126172504
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.857271344 0.562582851
[2,] 0.644390611 0.857271344
[3,] 0.617999262 0.644390611
[4,] 0.839418472 0.617999262
[5,] 0.588322701 0.839418472
[6,] 0.473170393 0.588322701
[7,] 0.369979135 0.473170393
[8,] 0.079074710 0.369979135
[9,] 0.081268107 0.079074710
[10,] 0.125025195 0.081268107
[11,] 0.069772785 0.125025195
[12,] 0.009702506 0.069772785
[13,] -0.155545876 0.009702506
[14,] -0.215970937 -0.155545876
[15,] -0.399962748 -0.215970937
[16,] -0.391772522 -0.399962748
[17,] -0.248197871 -0.391772522
[18,] -0.350279910 -0.248197871
[19,] -0.244200922 -0.350279910
[20,] -0.298464894 -0.244200922
[21,] -0.275618477 -0.298464894
[22,] -0.310484785 -0.275618477
[23,] -0.425380683 -0.310484785
[24,] -0.340733553 -0.425380683
[25,] -0.401794750 -0.340733553
[26,] -0.364474297 -0.401794750
[27,] -0.193561584 -0.364474297
[28,] -0.145164287 -0.193561584
[29,] -0.224410366 -0.145164287
[30,] -0.095546386 -0.224410366
[31,] -0.055924689 -0.095546386
[32,] -0.062462535 -0.055924689
[33,] -0.168443410 -0.062462535
[34,] -0.120866209 -0.168443410
[35,] -0.153552134 -0.120866209
[36,] -0.106324862 -0.153552134
[37,] -0.085632028 -0.106324862
[38,] -0.105496220 -0.085632028
[39,] -0.099630784 -0.105496220
[40,] -0.060639258 -0.099630784
[41,] -0.020676928 -0.060639258
[42,] -0.077626049 -0.020676928
[43,] -0.123377338 -0.077626049
[44,] 0.108504964 -0.123377338
[45,] 0.091178469 0.108504964
[46,] 0.179483772 0.091178469
[47,] 0.221786617 0.179483772
[48,] 0.143687918 0.221786617
[49,] 0.133424975 0.143687918
[50,] 0.126172504 0.133424975
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.857271344 0.562582851
2 0.644390611 0.857271344
3 0.617999262 0.644390611
4 0.839418472 0.617999262
5 0.588322701 0.839418472
6 0.473170393 0.588322701
7 0.369979135 0.473170393
8 0.079074710 0.369979135
9 0.081268107 0.079074710
10 0.125025195 0.081268107
11 0.069772785 0.125025195
12 0.009702506 0.069772785
13 -0.155545876 0.009702506
14 -0.215970937 -0.155545876
15 -0.399962748 -0.215970937
16 -0.391772522 -0.399962748
17 -0.248197871 -0.391772522
18 -0.350279910 -0.248197871
19 -0.244200922 -0.350279910
20 -0.298464894 -0.244200922
21 -0.275618477 -0.298464894
22 -0.310484785 -0.275618477
23 -0.425380683 -0.310484785
24 -0.340733553 -0.425380683
25 -0.401794750 -0.340733553
26 -0.364474297 -0.401794750
27 -0.193561584 -0.364474297
28 -0.145164287 -0.193561584
29 -0.224410366 -0.145164287
30 -0.095546386 -0.224410366
31 -0.055924689 -0.095546386
32 -0.062462535 -0.055924689
33 -0.168443410 -0.062462535
34 -0.120866209 -0.168443410
35 -0.153552134 -0.120866209
36 -0.106324862 -0.153552134
37 -0.085632028 -0.106324862
38 -0.105496220 -0.085632028
39 -0.099630784 -0.105496220
40 -0.060639258 -0.099630784
41 -0.020676928 -0.060639258
42 -0.077626049 -0.020676928
43 -0.123377338 -0.077626049
44 0.108504964 -0.123377338
45 0.091178469 0.108504964
46 0.179483772 0.091178469
47 0.221786617 0.179483772
48 0.143687918 0.221786617
49 0.133424975 0.143687918
50 0.126172504 0.133424975
> 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/7unf91322006701.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/8l6bc1322006701.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/9tqwm1322006701.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/10u6g51322006701.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/11iw6b1322006701.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/12s39b1322006701.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/13ejof1322006701.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/144gcy1322006701.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/154r8q1322006701.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/16xk2q1322006702.tab")
+ }
>
> try(system("convert tmp/1qnfk1322006701.ps tmp/1qnfk1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/2t39t1322006701.ps tmp/2t39t1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bcg11322006701.ps tmp/3bcg11322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/4svwx1322006701.ps tmp/4svwx1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/5jbad1322006701.ps tmp/5jbad1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/60ksw1322006701.ps tmp/60ksw1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/7unf91322006701.ps tmp/7unf91322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/8l6bc1322006701.ps tmp/8l6bc1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/9tqwm1322006701.ps tmp/9tqwm1322006701.png",intern=TRUE))
character(0)
> try(system("convert tmp/10u6g51322006701.ps tmp/10u6g51322006701.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.208 0.454 3.710