R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(25.60,161,23.70,149,22.00,139,21.30,135,20.70,130,20.40,127,20.30,122,20.40,117,19.80,112,19.50,113,23.10,149,23.50,157,23.50,157,22.90,147,21.90,137,21.50,132,20.50,125,20.20,123,19.40,117,19.20,114,18.80,111,18.80,112,22.60,144,23.30,150,23.00,149,21.40,134,19.90,123,18.80,116,18.60,117,18.40,111,18.60,105,19.90,102,19.20,95,18.40,93,21.10,124,20.50,130,19.10,124,18.10,115,17.00,106,17.10,105,17.40,105,16.80,101,15.30,95,14.30,93,13.40,84,15.30,87,22.10,116,23.70,120,22.20,117,19.50,109,16.60,105,17.30,107,19.80,109,21.20,109,21.50,108,20.60,107,19.10,99,19.60,103,23.50,131,24.00,137),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> 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 = '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
Attaching package: 'zoo'
The following object(s) are masked from package:base :
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
Y X
1 25.6 161
2 23.7 149
3 22.0 139
4 21.3 135
5 20.7 130
6 20.4 127
7 20.3 122
8 20.4 117
9 19.8 112
10 19.5 113
11 23.1 149
12 23.5 157
13 23.5 157
14 22.9 147
15 21.9 137
16 21.5 132
17 20.5 125
18 20.2 123
19 19.4 117
20 19.2 114
21 18.8 111
22 18.8 112
23 22.6 144
24 23.3 150
25 23.0 149
26 21.4 134
27 19.9 123
28 18.8 116
29 18.6 117
30 18.4 111
31 18.6 105
32 19.9 102
33 19.2 95
34 18.4 93
35 21.1 124
36 20.5 130
37 19.1 124
38 18.1 115
39 17.0 106
40 17.1 105
41 17.4 105
42 16.8 101
43 15.3 95
44 14.3 93
45 13.4 84
46 15.3 87
47 22.1 116
48 23.7 120
49 22.2 117
50 19.5 109
51 16.6 105
52 17.3 107
53 19.8 109
54 21.2 109
55 21.5 108
56 20.6 107
57 19.1 99
58 19.6 103
59 23.5 131
60 24.0 137
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
6.1494 0.1166
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.6945 -0.8969 -0.3416 0.6487 3.5570
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.149437 1.164542 5.281 2.02e-06 ***
X 0.116613 0.009632 12.107 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.362 on 58 degrees of freedom
Multiple R-squared: 0.7165, Adjusted R-squared: 0.7116
F-statistic: 146.6 on 1 and 58 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,] 3.773230e-04 7.546460e-04 0.99962268
[2,] 1.805031e-04 3.610062e-04 0.99981950
[3,] 1.851879e-03 3.703759e-03 0.99814812
[4,] 9.877498e-03 1.975500e-02 0.99012250
[5,] 7.854356e-03 1.570871e-02 0.99214564
[6,] 2.887194e-03 5.774388e-03 0.99711281
[7,] 1.202999e-03 2.405997e-03 0.99879700
[8,] 9.354647e-04 1.870929e-03 0.99906454
[9,] 5.419077e-04 1.083815e-03 0.99945809
[10,] 1.886865e-04 3.773731e-04 0.99981131
[11,] 6.168706e-05 1.233741e-04 0.99993831
[12,] 1.933527e-05 3.867054e-05 0.99998066
[13,] 6.155810e-06 1.231162e-05 0.99999384
[14,] 2.031594e-06 4.063187e-06 0.99999797
[15,] 7.880048e-07 1.576010e-06 0.99999921
[16,] 2.413783e-07 4.827566e-07 0.99999976
[17,] 7.574897e-08 1.514979e-07 0.99999992
[18,] 2.598503e-08 5.197006e-08 0.99999997
[19,] 7.062876e-09 1.412575e-08 0.99999999
[20,] 1.987662e-09 3.975324e-09 1.00000000
[21,] 7.044974e-10 1.408995e-09 1.00000000
[22,] 2.165815e-10 4.331630e-10 1.00000000
[23,] 9.949161e-11 1.989832e-10 1.00000000
[24,] 1.111234e-10 2.222468e-10 1.00000000
[25,] 3.689718e-10 7.379435e-10 1.00000000
[26,] 1.645635e-10 3.291271e-10 1.00000000
[27,] 6.471517e-11 1.294303e-10 1.00000000
[28,] 1.537176e-08 3.074352e-08 0.99999998
[29,] 3.451723e-07 6.903446e-07 0.99999965
[30,] 6.281578e-07 1.256316e-06 0.99999937
[31,] 3.215758e-07 6.431516e-07 0.99999968
[32,] 6.157269e-07 1.231454e-06 0.99999938
[33,] 1.014122e-05 2.028244e-05 0.99998986
[34,] 7.832906e-05 1.566581e-04 0.99992167
[35,] 2.880059e-04 5.760118e-04 0.99971199
[36,] 5.271696e-04 1.054339e-03 0.99947283
[37,] 5.767500e-04 1.153500e-03 0.99942325
[38,] 5.988935e-04 1.197787e-03 0.99940111
[39,] 1.463006e-03 2.926011e-03 0.99853699
[40,] 1.073664e-02 2.147327e-02 0.98926336
[41,] 2.605647e-02 5.211295e-02 0.97394353
[42,] 1.917031e-02 3.834063e-02 0.98082969
[43,] 3.918398e-02 7.836797e-02 0.96081602
[44,] 1.616519e-01 3.233038e-01 0.83834808
[45,] 1.876725e-01 3.753450e-01 0.81232752
[46,] 1.353809e-01 2.707617e-01 0.86461914
[47,] 4.172835e-01 8.345669e-01 0.58271653
[48,] 9.557574e-01 8.848520e-02 0.04424260
[49,] 9.682592e-01 6.348155e-02 0.03174077
[50,] 9.456620e-01 1.086761e-01 0.05433804
[51,] 9.904143e-01 1.917136e-02 0.00958568
> postscript(file="/var/www/html/rcomp/tmp/1jq7x1258646339.ps",horizontal=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/www/html/rcomp/tmp/2zdtm1258646339.ps",horizontal=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/www/html/rcomp/tmp/3ii1y1258646339.ps",horizontal=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/www/html/rcomp/tmp/4pyr01258646339.ps",horizontal=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/www/html/rcomp/tmp/53pt11258646339.ps",horizontal=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 = 60
Frequency = 1
1 2 3 4 5 6
0.67582611 0.17518537 -0.35868191 -0.59222883 -0.60916247 -0.55932265
7 8 9 10 11 12
-0.07625629 0.60681007 0.58987643 0.17326315 -0.42481463 -0.95772081
13 14 15 16 17 18
-0.95772081 -0.39158809 -0.22545537 -0.04238901 -0.22609611 -0.29286956
19 20 21 22 23 24
-0.39318993 -0.24335012 -0.29351030 -0.41012357 -0.34174827 -0.34142790
25 26 27 28 29 30
-0.52481463 -0.37561555 -0.59286956 -0.87657666 -1.19318993 -0.69351030
31 32 33 34 35 36
0.20616933 1.85600915 1.97230205 1.40552859 0.49051716 -0.80916247
37 38 39 40 41 42
-1.50948284 -1.45996339 -1.51044394 -1.29383067 -0.99383067 -1.12737758
43 44 45 46 47 48
-1.92769795 -2.69447141 -2.54495196 -0.99479178 2.42342334 3.55697025
49 50 51 52 53 54
2.40681007 0.63971624 -1.79383067 -1.32705721 0.93971624 2.33971624
55 56 57 58 59 60
2.75632951 1.97294279 1.40584896 1.43939587 2.07422426 1.87454463
> postscript(file="/var/www/html/rcomp/tmp/61u6e1258646339.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 0.67582611 NA
1 0.17518537 0.67582611
2 -0.35868191 0.17518537
3 -0.59222883 -0.35868191
4 -0.60916247 -0.59222883
5 -0.55932265 -0.60916247
6 -0.07625629 -0.55932265
7 0.60681007 -0.07625629
8 0.58987643 0.60681007
9 0.17326315 0.58987643
10 -0.42481463 0.17326315
11 -0.95772081 -0.42481463
12 -0.95772081 -0.95772081
13 -0.39158809 -0.95772081
14 -0.22545537 -0.39158809
15 -0.04238901 -0.22545537
16 -0.22609611 -0.04238901
17 -0.29286956 -0.22609611
18 -0.39318993 -0.29286956
19 -0.24335012 -0.39318993
20 -0.29351030 -0.24335012
21 -0.41012357 -0.29351030
22 -0.34174827 -0.41012357
23 -0.34142790 -0.34174827
24 -0.52481463 -0.34142790
25 -0.37561555 -0.52481463
26 -0.59286956 -0.37561555
27 -0.87657666 -0.59286956
28 -1.19318993 -0.87657666
29 -0.69351030 -1.19318993
30 0.20616933 -0.69351030
31 1.85600915 0.20616933
32 1.97230205 1.85600915
33 1.40552859 1.97230205
34 0.49051716 1.40552859
35 -0.80916247 0.49051716
36 -1.50948284 -0.80916247
37 -1.45996339 -1.50948284
38 -1.51044394 -1.45996339
39 -1.29383067 -1.51044394
40 -0.99383067 -1.29383067
41 -1.12737758 -0.99383067
42 -1.92769795 -1.12737758
43 -2.69447141 -1.92769795
44 -2.54495196 -2.69447141
45 -0.99479178 -2.54495196
46 2.42342334 -0.99479178
47 3.55697025 2.42342334
48 2.40681007 3.55697025
49 0.63971624 2.40681007
50 -1.79383067 0.63971624
51 -1.32705721 -1.79383067
52 0.93971624 -1.32705721
53 2.33971624 0.93971624
54 2.75632951 2.33971624
55 1.97294279 2.75632951
56 1.40584896 1.97294279
57 1.43939587 1.40584896
58 2.07422426 1.43939587
59 1.87454463 2.07422426
60 NA 1.87454463
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.17518537 0.67582611
[2,] -0.35868191 0.17518537
[3,] -0.59222883 -0.35868191
[4,] -0.60916247 -0.59222883
[5,] -0.55932265 -0.60916247
[6,] -0.07625629 -0.55932265
[7,] 0.60681007 -0.07625629
[8,] 0.58987643 0.60681007
[9,] 0.17326315 0.58987643
[10,] -0.42481463 0.17326315
[11,] -0.95772081 -0.42481463
[12,] -0.95772081 -0.95772081
[13,] -0.39158809 -0.95772081
[14,] -0.22545537 -0.39158809
[15,] -0.04238901 -0.22545537
[16,] -0.22609611 -0.04238901
[17,] -0.29286956 -0.22609611
[18,] -0.39318993 -0.29286956
[19,] -0.24335012 -0.39318993
[20,] -0.29351030 -0.24335012
[21,] -0.41012357 -0.29351030
[22,] -0.34174827 -0.41012357
[23,] -0.34142790 -0.34174827
[24,] -0.52481463 -0.34142790
[25,] -0.37561555 -0.52481463
[26,] -0.59286956 -0.37561555
[27,] -0.87657666 -0.59286956
[28,] -1.19318993 -0.87657666
[29,] -0.69351030 -1.19318993
[30,] 0.20616933 -0.69351030
[31,] 1.85600915 0.20616933
[32,] 1.97230205 1.85600915
[33,] 1.40552859 1.97230205
[34,] 0.49051716 1.40552859
[35,] -0.80916247 0.49051716
[36,] -1.50948284 -0.80916247
[37,] -1.45996339 -1.50948284
[38,] -1.51044394 -1.45996339
[39,] -1.29383067 -1.51044394
[40,] -0.99383067 -1.29383067
[41,] -1.12737758 -0.99383067
[42,] -1.92769795 -1.12737758
[43,] -2.69447141 -1.92769795
[44,] -2.54495196 -2.69447141
[45,] -0.99479178 -2.54495196
[46,] 2.42342334 -0.99479178
[47,] 3.55697025 2.42342334
[48,] 2.40681007 3.55697025
[49,] 0.63971624 2.40681007
[50,] -1.79383067 0.63971624
[51,] -1.32705721 -1.79383067
[52,] 0.93971624 -1.32705721
[53,] 2.33971624 0.93971624
[54,] 2.75632951 2.33971624
[55,] 1.97294279 2.75632951
[56,] 1.40584896 1.97294279
[57,] 1.43939587 1.40584896
[58,] 2.07422426 1.43939587
[59,] 1.87454463 2.07422426
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.17518537 0.67582611
2 -0.35868191 0.17518537
3 -0.59222883 -0.35868191
4 -0.60916247 -0.59222883
5 -0.55932265 -0.60916247
6 -0.07625629 -0.55932265
7 0.60681007 -0.07625629
8 0.58987643 0.60681007
9 0.17326315 0.58987643
10 -0.42481463 0.17326315
11 -0.95772081 -0.42481463
12 -0.95772081 -0.95772081
13 -0.39158809 -0.95772081
14 -0.22545537 -0.39158809
15 -0.04238901 -0.22545537
16 -0.22609611 -0.04238901
17 -0.29286956 -0.22609611
18 -0.39318993 -0.29286956
19 -0.24335012 -0.39318993
20 -0.29351030 -0.24335012
21 -0.41012357 -0.29351030
22 -0.34174827 -0.41012357
23 -0.34142790 -0.34174827
24 -0.52481463 -0.34142790
25 -0.37561555 -0.52481463
26 -0.59286956 -0.37561555
27 -0.87657666 -0.59286956
28 -1.19318993 -0.87657666
29 -0.69351030 -1.19318993
30 0.20616933 -0.69351030
31 1.85600915 0.20616933
32 1.97230205 1.85600915
33 1.40552859 1.97230205
34 0.49051716 1.40552859
35 -0.80916247 0.49051716
36 -1.50948284 -0.80916247
37 -1.45996339 -1.50948284
38 -1.51044394 -1.45996339
39 -1.29383067 -1.51044394
40 -0.99383067 -1.29383067
41 -1.12737758 -0.99383067
42 -1.92769795 -1.12737758
43 -2.69447141 -1.92769795
44 -2.54495196 -2.69447141
45 -0.99479178 -2.54495196
46 2.42342334 -0.99479178
47 3.55697025 2.42342334
48 2.40681007 3.55697025
49 0.63971624 2.40681007
50 -1.79383067 0.63971624
51 -1.32705721 -1.79383067
52 0.93971624 -1.32705721
53 2.33971624 0.93971624
54 2.75632951 2.33971624
55 1.97294279 2.75632951
56 1.40584896 1.97294279
57 1.43939587 1.40584896
58 2.07422426 1.43939587
59 1.87454463 2.07422426
> 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/www/html/rcomp/tmp/7pivn1258646339.ps",horizontal=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/www/html/rcomp/tmp/8fi5f1258646339.ps",horizontal=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/www/html/rcomp/tmp/9d8m21258646339.ps",horizontal=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/www/html/rcomp/tmp/10v5cu1258646339.ps",horizontal=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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/www/html/rcomp/tmp/11sjyg1258646339.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/www/html/rcomp/tmp/12fg371258646339.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/www/html/rcomp/tmp/13l6p01258646340.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/www/html/rcomp/tmp/1456js1258646340.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/www/html/rcomp/tmp/15ud9d1258646340.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/www/html/rcomp/tmp/16w0ss1258646340.tab")
+ }
>
> system("convert tmp/1jq7x1258646339.ps tmp/1jq7x1258646339.png")
> system("convert tmp/2zdtm1258646339.ps tmp/2zdtm1258646339.png")
> system("convert tmp/3ii1y1258646339.ps tmp/3ii1y1258646339.png")
> system("convert tmp/4pyr01258646339.ps tmp/4pyr01258646339.png")
> system("convert tmp/53pt11258646339.ps tmp/53pt11258646339.png")
> system("convert tmp/61u6e1258646339.ps tmp/61u6e1258646339.png")
> system("convert tmp/7pivn1258646339.ps tmp/7pivn1258646339.png")
> system("convert tmp/8fi5f1258646339.ps tmp/8fi5f1258646339.png")
> system("convert tmp/9d8m21258646339.ps tmp/9d8m21258646339.png")
> system("convert tmp/10v5cu1258646339.ps tmp/10v5cu1258646339.png")
>
>
> proc.time()
user system elapsed
2.537 1.553 4.510