R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(512927,0,502831,0,470984,0,471067,0,476049,0,474605,0,470439,0,461251,0,454724,0,455626,0,516847,0,525192,0,522975,0,518585,0,509239,0,512238,0,519164,0,517009,0,509933,0,509127,0,500857,0,506971,0,569323,0,579714,0,577992,0,565464,0,547344,0,554788,0,562325,0,560854,0,555332,0,543599,0,536662,0,542722,0,593530,0,610763,1,612613,1,611324,1,594167,1,595454,1,590865,1,589379,1,584428,1,573100,1,567456,1,569028,1,620735,1,628884,1,628232,1,612117,1,595404,1,597141,1,593408,1,590072,1,579799,1,574205,1,572775,1,572942,1,619567,1,625809,1,619916,1),dim=c(2,61),dimnames=list(c('y','d'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('y','d'),1:61))
> 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 d
1 512927 0
2 502831 0
3 470984 0
4 471067 0
5 476049 0
6 474605 0
7 470439 0
8 461251 0
9 454724 0
10 455626 0
11 516847 0
12 525192 0
13 522975 0
14 518585 0
15 509239 0
16 512238 0
17 519164 0
18 517009 0
19 509933 0
20 509127 0
21 500857 0
22 506971 0
23 569323 0
24 579714 0
25 577992 0
26 565464 0
27 547344 0
28 554788 0
29 562325 0
30 560854 0
31 555332 0
32 543599 0
33 536662 0
34 542722 0
35 593530 0
36 610763 1
37 612613 1
38 611324 1
39 594167 1
40 595454 1
41 590865 1
42 589379 1
43 584428 1
44 573100 1
45 567456 1
46 569028 1
47 620735 1
48 628884 1
49 628232 1
50 612117 1
51 595404 1
52 597141 1
53 593408 1
54 590072 1
55 579799 1
56 574205 1
57 572775 1
58 572942 1
59 619567 1
60 625809 1
61 619916 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) d
520237 77055
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-65513 -17493 -3125 22624 73293
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 520237 5350 97.240 < 2e-16 ***
d 77055 8195 9.403 2.45e-13 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 31650 on 59 degrees of freedom
Multiple R-squared: 0.5998, Adjusted R-squared: 0.593
F-statistic: 88.42 on 1 and 59 DF, p-value: 2.45e-13
> 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.3482636 0.6965272393 0.6517363804
[2,] 0.2351251 0.4702501683 0.7648749159
[3,] 0.1733912 0.3467824752 0.8266087624
[4,] 0.1784927 0.3569854778 0.8215072611
[5,] 0.2436078 0.4872156063 0.7563921968
[6,] 0.3338669 0.6677338627 0.6661330687
[7,] 0.5169249 0.9661502737 0.4830751368
[8,] 0.6855209 0.6289581618 0.3144790809
[9,] 0.7552241 0.4895517305 0.2447758653
[10,] 0.7751062 0.4497875778 0.2248937889
[11,] 0.7676167 0.4647666390 0.2323833195
[12,] 0.7653441 0.4693118488 0.2346559244
[13,] 0.7736176 0.4527648197 0.2263824099
[14,] 0.7768958 0.4462084817 0.2231042409
[15,] 0.7843816 0.4312367877 0.2156183939
[16,] 0.8050342 0.3899316853 0.1949658426
[17,] 0.8650108 0.2699783400 0.1349891700
[18,] 0.9218956 0.1562088269 0.0781044134
[19,] 0.9848565 0.0302869006 0.0151434503
[20,] 0.9979165 0.0041670934 0.0020835467
[21,] 0.9995208 0.0009583212 0.0004791606
[22,] 0.9996818 0.0006363890 0.0003181945
[23,] 0.9995973 0.0008053067 0.0004026533
[24,] 0.9995175 0.0009649535 0.0004824768
[25,] 0.9994892 0.0010216683 0.0005108341
[26,] 0.9993923 0.0012154777 0.0006077388
[27,] 0.9991391 0.0017218455 0.0008609228
[28,] 0.9986932 0.0026136623 0.0013068311
[29,] 0.9985120 0.0029759441 0.0014879721
[30,] 0.9990042 0.0019915824 0.0009957912
[31,] 0.9992083 0.0015834012 0.0007917006
[32,] 0.9986343 0.0027313741 0.0013656871
[33,] 0.9978114 0.0043772066 0.0021886033
[34,] 0.9964971 0.0070058210 0.0035029105
[35,] 0.9936860 0.0126279467 0.0063139733
[36,] 0.9888016 0.0223968477 0.0111984239
[37,] 0.9811337 0.0377326872 0.0188663436
[38,] 0.9694447 0.0611105265 0.0305552633
[39,] 0.9545515 0.0908970603 0.0454485302
[40,] 0.9478914 0.1042171287 0.0521085644
[41,] 0.9524581 0.0950838695 0.0475419348
[42,] 0.9580834 0.0838332417 0.0419166209
[43,] 0.9469211 0.1061577466 0.0530788733
[44,] 0.9517488 0.0965023706 0.0482511853
[45,] 0.9603774 0.0792451682 0.0396225841
[46,] 0.9427613 0.1144773809 0.0572386905
[47,] 0.8989793 0.2020413069 0.1010206535
[48,] 0.8319640 0.3360719451 0.1680359726
[49,] 0.7356078 0.5287843272 0.2643921636
[50,] 0.6122876 0.7754248812 0.3877124406
[51,] 0.5023263 0.9953473363 0.4976736682
[52,] 0.4328871 0.8657741303 0.5671129348
> postscript(file="/var/www/html/freestat/rcomp/tmp/1gl3j1227103992.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/freestat/rcomp/tmp/2rpt11227103992.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/freestat/rcomp/tmp/3f2621227103992.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/freestat/rcomp/tmp/4wp111227103992.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/freestat/rcomp/tmp/5gxg61227103992.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 = 61
Frequency = 1
1 2 3 4 5 6
-7309.8286 -17405.8286 -49252.8286 -49169.8286 -44187.8286 -45631.8286
7 8 9 10 11 12
-49797.8286 -58985.8286 -65512.8286 -64610.8286 -3389.8286 4955.1714
13 14 15 16 17 18
2738.1714 -1651.8286 -10997.8286 -7998.8286 -1072.8286 -3227.8286
19 20 21 22 23 24
-10303.8286 -11109.8286 -19379.8286 -13265.8286 49086.1714 59477.1714
25 26 27 28 29 30
57755.1714 45227.1714 27107.1714 34551.1714 42088.1714 40617.1714
31 32 33 34 35 36
35095.1714 23362.1714 16425.1714 22485.1714 73293.1714 13471.3462
37 38 39 40 41 42
15321.3462 14032.3462 -3124.6538 -1837.6538 -6426.6538 -7912.6538
43 44 45 46 47 48
-12863.6538 -24191.6538 -29835.6538 -28263.6538 23443.3462 31592.3462
49 50 51 52 53 54
30940.3462 14825.3462 -1887.6538 -150.6538 -3883.6538 -7219.6538
55 56 57 58 59 60
-17492.6538 -23086.6538 -24516.6538 -24349.6538 22275.3462 28517.3462
61
22624.3462
> postscript(file="/var/www/html/freestat/rcomp/tmp/68cxw1227103992.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -7309.8286 NA
1 -17405.8286 -7309.8286
2 -49252.8286 -17405.8286
3 -49169.8286 -49252.8286
4 -44187.8286 -49169.8286
5 -45631.8286 -44187.8286
6 -49797.8286 -45631.8286
7 -58985.8286 -49797.8286
8 -65512.8286 -58985.8286
9 -64610.8286 -65512.8286
10 -3389.8286 -64610.8286
11 4955.1714 -3389.8286
12 2738.1714 4955.1714
13 -1651.8286 2738.1714
14 -10997.8286 -1651.8286
15 -7998.8286 -10997.8286
16 -1072.8286 -7998.8286
17 -3227.8286 -1072.8286
18 -10303.8286 -3227.8286
19 -11109.8286 -10303.8286
20 -19379.8286 -11109.8286
21 -13265.8286 -19379.8286
22 49086.1714 -13265.8286
23 59477.1714 49086.1714
24 57755.1714 59477.1714
25 45227.1714 57755.1714
26 27107.1714 45227.1714
27 34551.1714 27107.1714
28 42088.1714 34551.1714
29 40617.1714 42088.1714
30 35095.1714 40617.1714
31 23362.1714 35095.1714
32 16425.1714 23362.1714
33 22485.1714 16425.1714
34 73293.1714 22485.1714
35 13471.3462 73293.1714
36 15321.3462 13471.3462
37 14032.3462 15321.3462
38 -3124.6538 14032.3462
39 -1837.6538 -3124.6538
40 -6426.6538 -1837.6538
41 -7912.6538 -6426.6538
42 -12863.6538 -7912.6538
43 -24191.6538 -12863.6538
44 -29835.6538 -24191.6538
45 -28263.6538 -29835.6538
46 23443.3462 -28263.6538
47 31592.3462 23443.3462
48 30940.3462 31592.3462
49 14825.3462 30940.3462
50 -1887.6538 14825.3462
51 -150.6538 -1887.6538
52 -3883.6538 -150.6538
53 -7219.6538 -3883.6538
54 -17492.6538 -7219.6538
55 -23086.6538 -17492.6538
56 -24516.6538 -23086.6538
57 -24349.6538 -24516.6538
58 22275.3462 -24349.6538
59 28517.3462 22275.3462
60 22624.3462 28517.3462
61 NA 22624.3462
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -17405.8286 -7309.8286
[2,] -49252.8286 -17405.8286
[3,] -49169.8286 -49252.8286
[4,] -44187.8286 -49169.8286
[5,] -45631.8286 -44187.8286
[6,] -49797.8286 -45631.8286
[7,] -58985.8286 -49797.8286
[8,] -65512.8286 -58985.8286
[9,] -64610.8286 -65512.8286
[10,] -3389.8286 -64610.8286
[11,] 4955.1714 -3389.8286
[12,] 2738.1714 4955.1714
[13,] -1651.8286 2738.1714
[14,] -10997.8286 -1651.8286
[15,] -7998.8286 -10997.8286
[16,] -1072.8286 -7998.8286
[17,] -3227.8286 -1072.8286
[18,] -10303.8286 -3227.8286
[19,] -11109.8286 -10303.8286
[20,] -19379.8286 -11109.8286
[21,] -13265.8286 -19379.8286
[22,] 49086.1714 -13265.8286
[23,] 59477.1714 49086.1714
[24,] 57755.1714 59477.1714
[25,] 45227.1714 57755.1714
[26,] 27107.1714 45227.1714
[27,] 34551.1714 27107.1714
[28,] 42088.1714 34551.1714
[29,] 40617.1714 42088.1714
[30,] 35095.1714 40617.1714
[31,] 23362.1714 35095.1714
[32,] 16425.1714 23362.1714
[33,] 22485.1714 16425.1714
[34,] 73293.1714 22485.1714
[35,] 13471.3462 73293.1714
[36,] 15321.3462 13471.3462
[37,] 14032.3462 15321.3462
[38,] -3124.6538 14032.3462
[39,] -1837.6538 -3124.6538
[40,] -6426.6538 -1837.6538
[41,] -7912.6538 -6426.6538
[42,] -12863.6538 -7912.6538
[43,] -24191.6538 -12863.6538
[44,] -29835.6538 -24191.6538
[45,] -28263.6538 -29835.6538
[46,] 23443.3462 -28263.6538
[47,] 31592.3462 23443.3462
[48,] 30940.3462 31592.3462
[49,] 14825.3462 30940.3462
[50,] -1887.6538 14825.3462
[51,] -150.6538 -1887.6538
[52,] -3883.6538 -150.6538
[53,] -7219.6538 -3883.6538
[54,] -17492.6538 -7219.6538
[55,] -23086.6538 -17492.6538
[56,] -24516.6538 -23086.6538
[57,] -24349.6538 -24516.6538
[58,] 22275.3462 -24349.6538
[59,] 28517.3462 22275.3462
[60,] 22624.3462 28517.3462
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -17405.8286 -7309.8286
2 -49252.8286 -17405.8286
3 -49169.8286 -49252.8286
4 -44187.8286 -49169.8286
5 -45631.8286 -44187.8286
6 -49797.8286 -45631.8286
7 -58985.8286 -49797.8286
8 -65512.8286 -58985.8286
9 -64610.8286 -65512.8286
10 -3389.8286 -64610.8286
11 4955.1714 -3389.8286
12 2738.1714 4955.1714
13 -1651.8286 2738.1714
14 -10997.8286 -1651.8286
15 -7998.8286 -10997.8286
16 -1072.8286 -7998.8286
17 -3227.8286 -1072.8286
18 -10303.8286 -3227.8286
19 -11109.8286 -10303.8286
20 -19379.8286 -11109.8286
21 -13265.8286 -19379.8286
22 49086.1714 -13265.8286
23 59477.1714 49086.1714
24 57755.1714 59477.1714
25 45227.1714 57755.1714
26 27107.1714 45227.1714
27 34551.1714 27107.1714
28 42088.1714 34551.1714
29 40617.1714 42088.1714
30 35095.1714 40617.1714
31 23362.1714 35095.1714
32 16425.1714 23362.1714
33 22485.1714 16425.1714
34 73293.1714 22485.1714
35 13471.3462 73293.1714
36 15321.3462 13471.3462
37 14032.3462 15321.3462
38 -3124.6538 14032.3462
39 -1837.6538 -3124.6538
40 -6426.6538 -1837.6538
41 -7912.6538 -6426.6538
42 -12863.6538 -7912.6538
43 -24191.6538 -12863.6538
44 -29835.6538 -24191.6538
45 -28263.6538 -29835.6538
46 23443.3462 -28263.6538
47 31592.3462 23443.3462
48 30940.3462 31592.3462
49 14825.3462 30940.3462
50 -1887.6538 14825.3462
51 -150.6538 -1887.6538
52 -3883.6538 -150.6538
53 -7219.6538 -3883.6538
54 -17492.6538 -7219.6538
55 -23086.6538 -17492.6538
56 -24516.6538 -23086.6538
57 -24349.6538 -24516.6538
58 22275.3462 -24349.6538
59 28517.3462 22275.3462
60 22624.3462 28517.3462
> 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/freestat/rcomp/tmp/7qjvy1227103992.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/freestat/rcomp/tmp/8galj1227103992.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/freestat/rcomp/tmp/9fy261227103992.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/freestat/rcomp/tmp/10ohta1227103992.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11cs2l1227103992.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/freestat/rcomp/tmp/12qrmb1227103992.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/freestat/rcomp/tmp/13gzio1227103992.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/freestat/rcomp/tmp/140gkl1227103992.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/freestat/rcomp/tmp/15m7fh1227103993.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/freestat/rcomp/tmp/16mabi1227103993.tab")
+ }
>
> system("convert tmp/1gl3j1227103992.ps tmp/1gl3j1227103992.png")
> system("convert tmp/2rpt11227103992.ps tmp/2rpt11227103992.png")
> system("convert tmp/3f2621227103992.ps tmp/3f2621227103992.png")
> system("convert tmp/4wp111227103992.ps tmp/4wp111227103992.png")
> system("convert tmp/5gxg61227103992.ps tmp/5gxg61227103992.png")
> system("convert tmp/68cxw1227103992.ps tmp/68cxw1227103992.png")
> system("convert tmp/7qjvy1227103992.ps tmp/7qjvy1227103992.png")
> system("convert tmp/8galj1227103992.ps tmp/8galj1227103992.png")
> system("convert tmp/9fy261227103992.ps tmp/9fy261227103992.png")
> system("convert tmp/10ohta1227103992.ps tmp/10ohta1227103992.png")
>
>
> proc.time()
user system elapsed
3.765 2.531 4.784