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(161,0,149,0,139,0,135,0,130,0,127,0,122,0,117,0,112,0,113,0,149,0,157,0,157,0,147,0,137,0,132,0,125,0,123,0,117,0,114,0,111,0,112,0,144,0,150,0,149,0,134,0,123,0,116,0,117,0,111,0,105,0,102,0,95,0,93,0,124,0,130,0,124,0,115,0,106,0,105,0,105,1,101,1,95,1,93,1,84,1,87,1,116,1,120,1,117,1,109,1,105,1,107,1,109,1,109,1,108,1,107,1,99,1,103,1,131,1,137,1),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 = 'Include Monthly 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 161 0 1 0 0 0 0 0 0 0 0 0 0
2 149 0 0 1 0 0 0 0 0 0 0 0 0
3 139 0 0 0 1 0 0 0 0 0 0 0 0
4 135 0 0 0 0 1 0 0 0 0 0 0 0
5 130 0 0 0 0 0 1 0 0 0 0 0 0
6 127 0 0 0 0 0 0 1 0 0 0 0 0
7 122 0 0 0 0 0 0 0 1 0 0 0 0
8 117 0 0 0 0 0 0 0 0 1 0 0 0
9 112 0 0 0 0 0 0 0 0 0 1 0 0
10 113 0 0 0 0 0 0 0 0 0 0 1 0
11 149 0 0 0 0 0 0 0 0 0 0 0 1
12 157 0 0 0 0 0 0 0 0 0 0 0 0
13 157 0 1 0 0 0 0 0 0 0 0 0 0
14 147 0 0 1 0 0 0 0 0 0 0 0 0
15 137 0 0 0 1 0 0 0 0 0 0 0 0
16 132 0 0 0 0 1 0 0 0 0 0 0 0
17 125 0 0 0 0 0 1 0 0 0 0 0 0
18 123 0 0 0 0 0 0 1 0 0 0 0 0
19 117 0 0 0 0 0 0 0 1 0 0 0 0
20 114 0 0 0 0 0 0 0 0 1 0 0 0
21 111 0 0 0 0 0 0 0 0 0 1 0 0
22 112 0 0 0 0 0 0 0 0 0 0 1 0
23 144 0 0 0 0 0 0 0 0 0 0 0 1
24 150 0 0 0 0 0 0 0 0 0 0 0 0
25 149 0 1 0 0 0 0 0 0 0 0 0 0
26 134 0 0 1 0 0 0 0 0 0 0 0 0
27 123 0 0 0 1 0 0 0 0 0 0 0 0
28 116 0 0 0 0 1 0 0 0 0 0 0 0
29 117 0 0 0 0 0 1 0 0 0 0 0 0
30 111 0 0 0 0 0 0 1 0 0 0 0 0
31 105 0 0 0 0 0 0 0 1 0 0 0 0
32 102 0 0 0 0 0 0 0 0 1 0 0 0
33 95 0 0 0 0 0 0 0 0 0 1 0 0
34 93 0 0 0 0 0 0 0 0 0 0 1 0
35 124 0 0 0 0 0 0 0 0 0 0 0 1
36 130 0 0 0 0 0 0 0 0 0 0 0 0
37 124 0 1 0 0 0 0 0 0 0 0 0 0
38 115 0 0 1 0 0 0 0 0 0 0 0 0
39 106 0 0 0 1 0 0 0 0 0 0 0 0
40 105 0 0 0 0 1 0 0 0 0 0 0 0
41 105 1 0 0 0 0 1 0 0 0 0 0 0
42 101 1 0 0 0 0 0 1 0 0 0 0 0
43 95 1 0 0 0 0 0 0 1 0 0 0 0
44 93 1 0 0 0 0 0 0 0 1 0 0 0
45 84 1 0 0 0 0 0 0 0 0 1 0 0
46 87 1 0 0 0 0 0 0 0 0 0 1 0
47 116 1 0 0 0 0 0 0 0 0 0 0 1
48 120 1 0 0 0 0 0 0 0 0 0 0 0
49 117 1 1 0 0 0 0 0 0 0 0 0 0
50 109 1 0 1 0 0 0 0 0 0 0 0 0
51 105 1 0 0 1 0 0 0 0 0 0 0 0
52 107 1 0 0 0 1 0 0 0 0 0 0 0
53 109 1 0 0 0 0 1 0 0 0 0 0 0
54 109 1 0 0 0 0 0 1 0 0 0 0 0
55 108 1 0 0 0 0 0 0 1 0 0 0 0
56 107 1 0 0 0 0 0 0 0 1 0 0 0
57 99 1 0 0 0 0 0 0 0 0 1 0 0
58 103 1 0 0 0 0 0 0 0 0 0 1 0
59 131 1 0 0 0 0 0 0 0 0 0 0 1
60 137 1 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X M1 M2 M3 M4
145.4563 -16.6406 -0.5281 -11.3281 -20.1281 -23.1281
M5 M6 M7 M8 M9 M10
-21.6000 -24.6000 -29.4000 -32.2000 -38.6000 -37.2000
M11
-6.0000
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-20.928 -6.826 1.548 8.184 16.072
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 145.4563 5.0431 28.843 < 2e-16 ***
X -16.6406 3.0578 -5.442 1.86e-06 ***
M1 -0.5281 6.9460 -0.076 0.939716
M2 -11.3281 6.9460 -1.631 0.109601
M3 -20.1281 6.9460 -2.898 0.005692 **
M4 -23.1281 6.9460 -3.330 0.001698 **
M5 -21.6000 6.9191 -3.122 0.003072 **
M6 -24.6000 6.9191 -3.555 0.000873 ***
M7 -29.4000 6.9191 -4.249 0.000101 ***
M8 -32.2000 6.9191 -4.654 2.68e-05 ***
M9 -38.6000 6.9191 -5.579 1.16e-06 ***
M10 -37.2000 6.9191 -5.376 2.33e-06 ***
M11 -6.0000 6.9191 -0.867 0.390256
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 10.94 on 47 degrees of freedom
Multiple R-squared: 0.7188, Adjusted R-squared: 0.647
F-statistic: 10.01 on 12 and 47 DF, p-value: 2.540e-09
> 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.0234507772 0.0469015544 0.9765492
[2,] 0.0145369043 0.0290738086 0.9854631
[3,] 0.0066578430 0.0133156861 0.9933422
[4,] 0.0039717577 0.0079435155 0.9960282
[5,] 0.0014872569 0.0029745139 0.9985127
[6,] 0.0004840577 0.0009681154 0.9995159
[7,] 0.0001554295 0.0003108590 0.9998446
[8,] 0.0001425379 0.0002850757 0.9998575
[9,] 0.0002952307 0.0005904614 0.9997048
[10,] 0.0054586926 0.0109173852 0.9945413
[11,] 0.0755665681 0.1511331363 0.9244334
[12,] 0.2798075413 0.5596150827 0.7201925
[13,] 0.5138083198 0.9723833604 0.4861917
[14,] 0.5372617719 0.9254764561 0.4627382
[15,] 0.5832355970 0.8335288059 0.4167644
[16,] 0.6086090853 0.7827818293 0.3913909
[17,] 0.6021602523 0.7956794954 0.3978397
[18,] 0.6232099467 0.7535801065 0.3767901
[19,] 0.6675530675 0.6648938650 0.3324469
[20,] 0.7099350509 0.5801298982 0.2900649
[21,] 0.7309476728 0.5381046545 0.2690523
[22,] 0.8072710904 0.3854578193 0.1927289
[23,] 0.8187836853 0.3624326293 0.1812163
[24,] 0.7974733813 0.4050532374 0.2025266
[25,] 0.7408470253 0.5183059494 0.2591530
[26,] 0.6275722982 0.7448554035 0.3724277
[27,] 0.5134974608 0.9730050784 0.4865025
[28,] 0.4308660301 0.8617320603 0.5691340
[29,] 0.3509837632 0.7019675265 0.6490162
> postscript(file="/var/www/html/rcomp/tmp/177061258706563.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/2emn61258706563.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/37u9k1258706563.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/4yagz1258706563.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/5umf81258706563.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 7
16.071875 14.871875 13.671875 12.671875 6.143750 6.143750 5.943750
8 9 10 11 12 13 14
3.743750 5.143750 4.743750 9.543750 11.543750 12.071875 12.871875
15 16 17 18 19 20 21
11.671875 9.671875 1.143750 2.143750 0.943750 0.743750 4.143750
22 23 24 25 26 27 28
3.743750 4.543750 4.543750 4.071875 -0.128125 -2.328125 -6.328125
29 30 31 32 33 34 35
-6.856250 -9.856250 -11.056250 -11.256250 -11.856250 -15.256250 -15.456250
36 37 38 39 40 41 42
-15.456250 -20.928125 -19.128125 -19.328125 -17.328125 -2.215625 -3.215625
43 44 45 46 47 48 49
-4.415625 -3.615625 -6.215625 -4.615625 -6.815625 -8.815625 -11.287500
50 51 52 53 54 55 56
-8.487500 -3.687500 1.312500 1.784375 4.784375 8.584375 10.384375
57 58 59 60
8.784375 11.384375 8.184375 8.184375
> postscript(file="/var/www/html/rcomp/tmp/6lqum1258706563.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 16.071875 NA
1 14.871875 16.071875
2 13.671875 14.871875
3 12.671875 13.671875
4 6.143750 12.671875
5 6.143750 6.143750
6 5.943750 6.143750
7 3.743750 5.943750
8 5.143750 3.743750
9 4.743750 5.143750
10 9.543750 4.743750
11 11.543750 9.543750
12 12.071875 11.543750
13 12.871875 12.071875
14 11.671875 12.871875
15 9.671875 11.671875
16 1.143750 9.671875
17 2.143750 1.143750
18 0.943750 2.143750
19 0.743750 0.943750
20 4.143750 0.743750
21 3.743750 4.143750
22 4.543750 3.743750
23 4.543750 4.543750
24 4.071875 4.543750
25 -0.128125 4.071875
26 -2.328125 -0.128125
27 -6.328125 -2.328125
28 -6.856250 -6.328125
29 -9.856250 -6.856250
30 -11.056250 -9.856250
31 -11.256250 -11.056250
32 -11.856250 -11.256250
33 -15.256250 -11.856250
34 -15.456250 -15.256250
35 -15.456250 -15.456250
36 -20.928125 -15.456250
37 -19.128125 -20.928125
38 -19.328125 -19.128125
39 -17.328125 -19.328125
40 -2.215625 -17.328125
41 -3.215625 -2.215625
42 -4.415625 -3.215625
43 -3.615625 -4.415625
44 -6.215625 -3.615625
45 -4.615625 -6.215625
46 -6.815625 -4.615625
47 -8.815625 -6.815625
48 -11.287500 -8.815625
49 -8.487500 -11.287500
50 -3.687500 -8.487500
51 1.312500 -3.687500
52 1.784375 1.312500
53 4.784375 1.784375
54 8.584375 4.784375
55 10.384375 8.584375
56 8.784375 10.384375
57 11.384375 8.784375
58 8.184375 11.384375
59 8.184375 8.184375
60 NA 8.184375
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 14.871875 16.071875
[2,] 13.671875 14.871875
[3,] 12.671875 13.671875
[4,] 6.143750 12.671875
[5,] 6.143750 6.143750
[6,] 5.943750 6.143750
[7,] 3.743750 5.943750
[8,] 5.143750 3.743750
[9,] 4.743750 5.143750
[10,] 9.543750 4.743750
[11,] 11.543750 9.543750
[12,] 12.071875 11.543750
[13,] 12.871875 12.071875
[14,] 11.671875 12.871875
[15,] 9.671875 11.671875
[16,] 1.143750 9.671875
[17,] 2.143750 1.143750
[18,] 0.943750 2.143750
[19,] 0.743750 0.943750
[20,] 4.143750 0.743750
[21,] 3.743750 4.143750
[22,] 4.543750 3.743750
[23,] 4.543750 4.543750
[24,] 4.071875 4.543750
[25,] -0.128125 4.071875
[26,] -2.328125 -0.128125
[27,] -6.328125 -2.328125
[28,] -6.856250 -6.328125
[29,] -9.856250 -6.856250
[30,] -11.056250 -9.856250
[31,] -11.256250 -11.056250
[32,] -11.856250 -11.256250
[33,] -15.256250 -11.856250
[34,] -15.456250 -15.256250
[35,] -15.456250 -15.456250
[36,] -20.928125 -15.456250
[37,] -19.128125 -20.928125
[38,] -19.328125 -19.128125
[39,] -17.328125 -19.328125
[40,] -2.215625 -17.328125
[41,] -3.215625 -2.215625
[42,] -4.415625 -3.215625
[43,] -3.615625 -4.415625
[44,] -6.215625 -3.615625
[45,] -4.615625 -6.215625
[46,] -6.815625 -4.615625
[47,] -8.815625 -6.815625
[48,] -11.287500 -8.815625
[49,] -8.487500 -11.287500
[50,] -3.687500 -8.487500
[51,] 1.312500 -3.687500
[52,] 1.784375 1.312500
[53,] 4.784375 1.784375
[54,] 8.584375 4.784375
[55,] 10.384375 8.584375
[56,] 8.784375 10.384375
[57,] 11.384375 8.784375
[58,] 8.184375 11.384375
[59,] 8.184375 8.184375
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 14.871875 16.071875
2 13.671875 14.871875
3 12.671875 13.671875
4 6.143750 12.671875
5 6.143750 6.143750
6 5.943750 6.143750
7 3.743750 5.943750
8 5.143750 3.743750
9 4.743750 5.143750
10 9.543750 4.743750
11 11.543750 9.543750
12 12.071875 11.543750
13 12.871875 12.071875
14 11.671875 12.871875
15 9.671875 11.671875
16 1.143750 9.671875
17 2.143750 1.143750
18 0.943750 2.143750
19 0.743750 0.943750
20 4.143750 0.743750
21 3.743750 4.143750
22 4.543750 3.743750
23 4.543750 4.543750
24 4.071875 4.543750
25 -0.128125 4.071875
26 -2.328125 -0.128125
27 -6.328125 -2.328125
28 -6.856250 -6.328125
29 -9.856250 -6.856250
30 -11.056250 -9.856250
31 -11.256250 -11.056250
32 -11.856250 -11.256250
33 -15.256250 -11.856250
34 -15.456250 -15.256250
35 -15.456250 -15.456250
36 -20.928125 -15.456250
37 -19.128125 -20.928125
38 -19.328125 -19.128125
39 -17.328125 -19.328125
40 -2.215625 -17.328125
41 -3.215625 -2.215625
42 -4.415625 -3.215625
43 -3.615625 -4.415625
44 -6.215625 -3.615625
45 -4.615625 -6.215625
46 -6.815625 -4.615625
47 -8.815625 -6.815625
48 -11.287500 -8.815625
49 -8.487500 -11.287500
50 -3.687500 -8.487500
51 1.312500 -3.687500
52 1.784375 1.312500
53 4.784375 1.784375
54 8.584375 4.784375
55 10.384375 8.584375
56 8.784375 10.384375
57 11.384375 8.784375
58 8.184375 11.384375
59 8.184375 8.184375
> 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/76mej1258706563.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/8i3qe1258706563.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/9ji2o1258706563.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/104uvb1258706563.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/11m4lk1258706563.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/12w54s1258706563.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/13clla1258706563.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/14imv01258706563.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/15iur81258706563.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/16foet1258706563.tab")
+ }
>
> system("convert tmp/177061258706563.ps tmp/177061258706563.png")
> system("convert tmp/2emn61258706563.ps tmp/2emn61258706563.png")
> system("convert tmp/37u9k1258706563.ps tmp/37u9k1258706563.png")
> system("convert tmp/4yagz1258706563.ps tmp/4yagz1258706563.png")
> system("convert tmp/5umf81258706563.ps tmp/5umf81258706563.png")
> system("convert tmp/6lqum1258706563.ps tmp/6lqum1258706563.png")
> system("convert tmp/76mej1258706563.ps tmp/76mej1258706563.png")
> system("convert tmp/8i3qe1258706563.ps tmp/8i3qe1258706563.png")
> system("convert tmp/9ji2o1258706563.ps tmp/9ji2o1258706563.png")
> system("convert tmp/104uvb1258706563.ps tmp/104uvb1258706563.png")
>
>
> proc.time()
user system elapsed
2.344 1.509 7.864