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(28029,0,29383,0,36438,0,32034,0,22679,0,24319,0,18004,0,17537,0,20366,0,22782,0,19169,0,13807,0,29743,0,25591,0,29096,0,26482,0,22405,0,27044,0,17970,0,18730,0,19684,0,19785,0,18479,0,10698,0,31956,0,29506,0,34506,0,27165,0,26736,0,23691,0,18157,0,17328,0,18205,0,20995,0,17382,0,9367,0,31124,0,26551,0,30651,0,25859,0,25100,0,25778,0,20418,0,18688,0,20424,0,24776,0,19814,1,12738,1,31566,1,30111,1,30019,1,31934,1,25826,1,26835,1,20205,1,17789,1,20520,1,22518,1,15572,1,11509,1,25447,1,24090,1,27786,1,26195,1,20516,1,22759,1,19028,1,16971,1,20036,1,22485,1),dim=c(2,70),dimnames=list(c('inschrijvingen','dummyvariabele'),1:70))
> y <- array(NA,dim=c(2,70),dimnames=list(c('inschrijvingen','dummyvariabele'),1:70))
> 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
inschrijvingen dummyvariabele
1 28029 0
2 29383 0
3 36438 0
4 32034 0
5 22679 0
6 24319 0
7 18004 0
8 17537 0
9 20366 0
10 22782 0
11 19169 0
12 13807 0
13 29743 0
14 25591 0
15 29096 0
16 26482 0
17 22405 0
18 27044 0
19 17970 0
20 18730 0
21 19684 0
22 19785 0
23 18479 0
24 10698 0
25 31956 0
26 29506 0
27 34506 0
28 27165 0
29 26736 0
30 23691 0
31 18157 0
32 17328 0
33 18205 0
34 20995 0
35 17382 0
36 9367 0
37 31124 0
38 26551 0
39 30651 0
40 25859 0
41 25100 0
42 25778 0
43 20418 0
44 18688 0
45 20424 0
46 24776 0
47 19814 1
48 12738 1
49 31566 1
50 30111 1
51 30019 1
52 31934 1
53 25826 1
54 26835 1
55 20205 1
56 17789 1
57 20520 1
58 22518 1
59 15572 1
60 11509 1
61 25447 1
62 24090 1
63 27786 1
64 26195 1
65 20516 1
66 22759 1
67 19028 1
68 16971 1
69 20036 1
70 22485 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummyvariabele
23361.2 -766.7
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13994.24 -4521.49 -93.04 3773.51 13076.76
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 23361.2 865.4 26.995 <2e-16 ***
dummyvariabele -766.7 1478.0 -0.519 0.606
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5869 on 68 degrees of freedom
Multiple R-squared: 0.003942, Adjusted R-squared: -0.01071
F-statistic: 0.2691 on 1 and 68 DF, p-value: 0.6056
> 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.6337130 0.73257405 0.36628702
[2,] 0.5756760 0.84864809 0.42432404
[3,] 0.7611650 0.47767005 0.23883502
[4,] 0.8317668 0.33646636 0.16823318
[5,] 0.8010315 0.39793709 0.19896855
[6,] 0.7281721 0.54365580 0.27182790
[7,] 0.7059751 0.58804982 0.29402491
[8,] 0.8222597 0.35548061 0.17774031
[9,] 0.8142423 0.37151531 0.18575766
[10,] 0.7526024 0.49479529 0.24739764
[11,] 0.7281247 0.54375052 0.27187526
[12,] 0.6643535 0.67129294 0.33564647
[13,] 0.5925079 0.81498411 0.40749205
[14,] 0.5312292 0.93754166 0.46877083
[15,] 0.5352389 0.92952227 0.46476113
[16,] 0.5138580 0.97228396 0.48614198
[17,] 0.4704911 0.94098228 0.52950886
[18,] 0.4244547 0.84890940 0.57554530
[19,] 0.4017464 0.80349277 0.59825362
[20,] 0.6513404 0.69731910 0.34865955
[21,] 0.7181988 0.56360237 0.28180118
[22,] 0.7192518 0.56149644 0.28074822
[23,] 0.8438927 0.31221457 0.15610728
[24,] 0.8183791 0.36324186 0.18162093
[25,] 0.7874975 0.42500510 0.21250255
[26,] 0.7347836 0.53043284 0.26521642
[27,] 0.7171526 0.56569489 0.28284744
[28,] 0.7134643 0.57307131 0.28653566
[29,] 0.6942522 0.61149562 0.30574781
[30,] 0.6391183 0.72176348 0.36088174
[31,] 0.6376329 0.72473429 0.36236714
[32,] 0.8867987 0.22640268 0.11320134
[33,] 0.9024085 0.19518294 0.09759147
[34,] 0.8764982 0.24700353 0.12350177
[35,] 0.8943764 0.21124724 0.10562362
[36,] 0.8672403 0.26551940 0.13275970
[37,] 0.8326766 0.33464681 0.16732340
[38,] 0.8036692 0.39266165 0.19633082
[39,] 0.7549243 0.49015134 0.24507567
[40,] 0.7192373 0.56152539 0.28076270
[41,] 0.6712226 0.65755478 0.32877739
[42,] 0.6021091 0.79578184 0.39789092
[43,] 0.5394219 0.92115622 0.46057811
[44,] 0.6387986 0.72240279 0.36120140
[45,] 0.7609500 0.47809991 0.23904996
[46,] 0.8031005 0.39379905 0.19689953
[47,] 0.8426189 0.31476229 0.15738115
[48,] 0.9295957 0.14080866 0.07040433
[49,] 0.9178489 0.16430218 0.08215109
[50,] 0.9210560 0.15788792 0.07894396
[51,] 0.8871362 0.22572765 0.11286382
[52,] 0.8641742 0.27165153 0.13582576
[53,] 0.8070894 0.38582121 0.19291060
[54,] 0.7350293 0.52994141 0.26497071
[55,] 0.7494847 0.50103068 0.25051534
[56,] 0.9457938 0.10841230 0.05420615
[57,] 0.9213023 0.15739531 0.07869766
[58,] 0.8696237 0.26075264 0.13037632
[59,] 0.9182285 0.16354305 0.08177152
[60,] 0.9572799 0.08544014 0.04272007
[61,] 0.8844171 0.23116585 0.11558292
> postscript(file="/var/www/html/rcomp/tmp/1iad01262203078.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/2zaoo1262203078.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/3guo41262203078.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/4n9811262203078.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/5jsha1262203078.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 = 70
Frequency = 1
1 2 3 4 5 6
4667.76087 6021.76087 13076.76087 8672.76087 -682.23913 957.76087
7 8 9 10 11 12
-5357.23913 -5824.23913 -2995.23913 -579.23913 -4192.23913 -9554.23913
13 14 15 16 17 18
6381.76087 2229.76087 5734.76087 3120.76087 -956.23913 3682.76087
19 20 21 22 23 24
-5391.23913 -4631.23913 -3677.23913 -3576.23913 -4882.23913 -12663.23913
25 26 27 28 29 30
8594.76087 6144.76087 11144.76087 3803.76087 3374.76087 329.76087
31 32 33 34 35 36
-5204.23913 -6033.23913 -5156.23913 -2366.23913 -5979.23913 -13994.23913
37 38 39 40 41 42
7762.76087 3189.76087 7289.76087 2497.76087 1738.76087 2416.76087
43 44 45 46 47 48
-2943.23913 -4673.23913 -2937.23913 1414.76087 -2780.54167 -9856.54167
49 50 51 52 53 54
8971.45833 7516.45833 7424.45833 9339.45833 3231.45833 4240.45833
55 56 57 58 59 60
-2389.54167 -4805.54167 -2074.54167 -76.54167 -7022.54167 -11085.54167
61 62 63 64 65 66
2852.45833 1495.45833 5191.45833 3600.45833 -2078.54167 164.45833
67 68 69 70
-3566.54167 -5623.54167 -2558.54167 -109.54167
> postscript(file="/var/www/html/rcomp/tmp/6sf7i1262203078.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 = 70
Frequency = 1
lag(myerror, k = 1) myerror
0 4667.76087 NA
1 6021.76087 4667.76087
2 13076.76087 6021.76087
3 8672.76087 13076.76087
4 -682.23913 8672.76087
5 957.76087 -682.23913
6 -5357.23913 957.76087
7 -5824.23913 -5357.23913
8 -2995.23913 -5824.23913
9 -579.23913 -2995.23913
10 -4192.23913 -579.23913
11 -9554.23913 -4192.23913
12 6381.76087 -9554.23913
13 2229.76087 6381.76087
14 5734.76087 2229.76087
15 3120.76087 5734.76087
16 -956.23913 3120.76087
17 3682.76087 -956.23913
18 -5391.23913 3682.76087
19 -4631.23913 -5391.23913
20 -3677.23913 -4631.23913
21 -3576.23913 -3677.23913
22 -4882.23913 -3576.23913
23 -12663.23913 -4882.23913
24 8594.76087 -12663.23913
25 6144.76087 8594.76087
26 11144.76087 6144.76087
27 3803.76087 11144.76087
28 3374.76087 3803.76087
29 329.76087 3374.76087
30 -5204.23913 329.76087
31 -6033.23913 -5204.23913
32 -5156.23913 -6033.23913
33 -2366.23913 -5156.23913
34 -5979.23913 -2366.23913
35 -13994.23913 -5979.23913
36 7762.76087 -13994.23913
37 3189.76087 7762.76087
38 7289.76087 3189.76087
39 2497.76087 7289.76087
40 1738.76087 2497.76087
41 2416.76087 1738.76087
42 -2943.23913 2416.76087
43 -4673.23913 -2943.23913
44 -2937.23913 -4673.23913
45 1414.76087 -2937.23913
46 -2780.54167 1414.76087
47 -9856.54167 -2780.54167
48 8971.45833 -9856.54167
49 7516.45833 8971.45833
50 7424.45833 7516.45833
51 9339.45833 7424.45833
52 3231.45833 9339.45833
53 4240.45833 3231.45833
54 -2389.54167 4240.45833
55 -4805.54167 -2389.54167
56 -2074.54167 -4805.54167
57 -76.54167 -2074.54167
58 -7022.54167 -76.54167
59 -11085.54167 -7022.54167
60 2852.45833 -11085.54167
61 1495.45833 2852.45833
62 5191.45833 1495.45833
63 3600.45833 5191.45833
64 -2078.54167 3600.45833
65 164.45833 -2078.54167
66 -3566.54167 164.45833
67 -5623.54167 -3566.54167
68 -2558.54167 -5623.54167
69 -109.54167 -2558.54167
70 NA -109.54167
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 6021.76087 4667.76087
[2,] 13076.76087 6021.76087
[3,] 8672.76087 13076.76087
[4,] -682.23913 8672.76087
[5,] 957.76087 -682.23913
[6,] -5357.23913 957.76087
[7,] -5824.23913 -5357.23913
[8,] -2995.23913 -5824.23913
[9,] -579.23913 -2995.23913
[10,] -4192.23913 -579.23913
[11,] -9554.23913 -4192.23913
[12,] 6381.76087 -9554.23913
[13,] 2229.76087 6381.76087
[14,] 5734.76087 2229.76087
[15,] 3120.76087 5734.76087
[16,] -956.23913 3120.76087
[17,] 3682.76087 -956.23913
[18,] -5391.23913 3682.76087
[19,] -4631.23913 -5391.23913
[20,] -3677.23913 -4631.23913
[21,] -3576.23913 -3677.23913
[22,] -4882.23913 -3576.23913
[23,] -12663.23913 -4882.23913
[24,] 8594.76087 -12663.23913
[25,] 6144.76087 8594.76087
[26,] 11144.76087 6144.76087
[27,] 3803.76087 11144.76087
[28,] 3374.76087 3803.76087
[29,] 329.76087 3374.76087
[30,] -5204.23913 329.76087
[31,] -6033.23913 -5204.23913
[32,] -5156.23913 -6033.23913
[33,] -2366.23913 -5156.23913
[34,] -5979.23913 -2366.23913
[35,] -13994.23913 -5979.23913
[36,] 7762.76087 -13994.23913
[37,] 3189.76087 7762.76087
[38,] 7289.76087 3189.76087
[39,] 2497.76087 7289.76087
[40,] 1738.76087 2497.76087
[41,] 2416.76087 1738.76087
[42,] -2943.23913 2416.76087
[43,] -4673.23913 -2943.23913
[44,] -2937.23913 -4673.23913
[45,] 1414.76087 -2937.23913
[46,] -2780.54167 1414.76087
[47,] -9856.54167 -2780.54167
[48,] 8971.45833 -9856.54167
[49,] 7516.45833 8971.45833
[50,] 7424.45833 7516.45833
[51,] 9339.45833 7424.45833
[52,] 3231.45833 9339.45833
[53,] 4240.45833 3231.45833
[54,] -2389.54167 4240.45833
[55,] -4805.54167 -2389.54167
[56,] -2074.54167 -4805.54167
[57,] -76.54167 -2074.54167
[58,] -7022.54167 -76.54167
[59,] -11085.54167 -7022.54167
[60,] 2852.45833 -11085.54167
[61,] 1495.45833 2852.45833
[62,] 5191.45833 1495.45833
[63,] 3600.45833 5191.45833
[64,] -2078.54167 3600.45833
[65,] 164.45833 -2078.54167
[66,] -3566.54167 164.45833
[67,] -5623.54167 -3566.54167
[68,] -2558.54167 -5623.54167
[69,] -109.54167 -2558.54167
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 6021.76087 4667.76087
2 13076.76087 6021.76087
3 8672.76087 13076.76087
4 -682.23913 8672.76087
5 957.76087 -682.23913
6 -5357.23913 957.76087
7 -5824.23913 -5357.23913
8 -2995.23913 -5824.23913
9 -579.23913 -2995.23913
10 -4192.23913 -579.23913
11 -9554.23913 -4192.23913
12 6381.76087 -9554.23913
13 2229.76087 6381.76087
14 5734.76087 2229.76087
15 3120.76087 5734.76087
16 -956.23913 3120.76087
17 3682.76087 -956.23913
18 -5391.23913 3682.76087
19 -4631.23913 -5391.23913
20 -3677.23913 -4631.23913
21 -3576.23913 -3677.23913
22 -4882.23913 -3576.23913
23 -12663.23913 -4882.23913
24 8594.76087 -12663.23913
25 6144.76087 8594.76087
26 11144.76087 6144.76087
27 3803.76087 11144.76087
28 3374.76087 3803.76087
29 329.76087 3374.76087
30 -5204.23913 329.76087
31 -6033.23913 -5204.23913
32 -5156.23913 -6033.23913
33 -2366.23913 -5156.23913
34 -5979.23913 -2366.23913
35 -13994.23913 -5979.23913
36 7762.76087 -13994.23913
37 3189.76087 7762.76087
38 7289.76087 3189.76087
39 2497.76087 7289.76087
40 1738.76087 2497.76087
41 2416.76087 1738.76087
42 -2943.23913 2416.76087
43 -4673.23913 -2943.23913
44 -2937.23913 -4673.23913
45 1414.76087 -2937.23913
46 -2780.54167 1414.76087
47 -9856.54167 -2780.54167
48 8971.45833 -9856.54167
49 7516.45833 8971.45833
50 7424.45833 7516.45833
51 9339.45833 7424.45833
52 3231.45833 9339.45833
53 4240.45833 3231.45833
54 -2389.54167 4240.45833
55 -4805.54167 -2389.54167
56 -2074.54167 -4805.54167
57 -76.54167 -2074.54167
58 -7022.54167 -76.54167
59 -11085.54167 -7022.54167
60 2852.45833 -11085.54167
61 1495.45833 2852.45833
62 5191.45833 1495.45833
63 3600.45833 5191.45833
64 -2078.54167 3600.45833
65 164.45833 -2078.54167
66 -3566.54167 164.45833
67 -5623.54167 -3566.54167
68 -2558.54167 -5623.54167
69 -109.54167 -2558.54167
> 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/7s4l61262203078.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/81lvv1262203078.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/9tann1262203078.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/10fi5c1262203078.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/11m7761262203078.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/12amsp1262203078.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/13f3c51262203078.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/14hrsy1262203078.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/15i4gh1262203078.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/16pgf51262203078.tab")
+ }
>
> try(system("convert tmp/1iad01262203078.ps tmp/1iad01262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zaoo1262203078.ps tmp/2zaoo1262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/3guo41262203078.ps tmp/3guo41262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/4n9811262203078.ps tmp/4n9811262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/5jsha1262203078.ps tmp/5jsha1262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/6sf7i1262203078.ps tmp/6sf7i1262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/7s4l61262203078.ps tmp/7s4l61262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/81lvv1262203078.ps tmp/81lvv1262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/9tann1262203078.ps tmp/9tann1262203078.png",intern=TRUE))
character(0)
> try(system("convert tmp/10fi5c1262203078.ps tmp/10fi5c1262203078.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.562 1.571 3.092