R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(150580
+ ,77
+ ,45588
+ ,9653
+ ,62991
+ ,41
+ ,39
+ ,99611
+ ,35
+ ,45097
+ ,8914
+ ,49363
+ ,54
+ ,54
+ ,19349
+ ,11
+ ,3895
+ ,786
+ ,9604
+ ,14
+ ,14
+ ,99373
+ ,63
+ ,28394
+ ,6700
+ ,24552
+ ,25
+ ,24
+ ,86230
+ ,44
+ ,18632
+ ,5788
+ ,31493
+ ,25
+ ,24
+ ,30837
+ ,19
+ ,2325
+ ,593
+ ,3439
+ ,8
+ ,8
+ ,31706
+ ,13
+ ,25139
+ ,4506
+ ,19555
+ ,26
+ ,26
+ ,89806
+ ,42
+ ,27975
+ ,6382
+ ,21228
+ ,20
+ ,19
+ ,62088
+ ,38
+ ,14483
+ ,5621
+ ,23177
+ ,11
+ ,11
+ ,40151
+ ,29
+ ,13127
+ ,3997
+ ,22094
+ ,14
+ ,14
+ ,27634
+ ,20
+ ,5839
+ ,520
+ ,2342
+ ,3
+ ,1
+ ,76990
+ ,27
+ ,24069
+ ,8891
+ ,38798
+ ,40
+ ,39
+ ,37460
+ ,20
+ ,3738
+ ,999
+ ,3255
+ ,5
+ ,5
+ ,54157
+ ,19
+ ,18625
+ ,7067
+ ,24261
+ ,38
+ ,37
+ ,49862
+ ,37
+ ,36341
+ ,4639
+ ,18511
+ ,32
+ ,32
+ ,84337
+ ,26
+ ,24548
+ ,5654
+ ,40798
+ ,41
+ ,38
+ ,64175
+ ,42
+ ,21792
+ ,6928
+ ,28893
+ ,46
+ ,47
+ ,59382
+ ,49
+ ,26263
+ ,1514
+ ,21425
+ ,47
+ ,47
+ ,119308
+ ,30
+ ,23686
+ ,9238
+ ,50276
+ ,37
+ ,37
+ ,76702
+ ,49
+ ,49303
+ ,8204
+ ,37643
+ ,51
+ ,51
+ ,103425
+ ,67
+ ,25659
+ ,5926
+ ,30377
+ ,49
+ ,45
+ ,70344
+ ,28
+ ,28904
+ ,5785
+ ,27126
+ ,21
+ ,21
+ ,43410
+ ,19
+ ,2781
+ ,4
+ ,13
+ ,1
+ ,1
+ ,104838
+ ,49
+ ,29236
+ ,5930
+ ,42097
+ ,44
+ ,42
+ ,62215
+ ,27
+ ,19546
+ ,3710
+ ,24451
+ ,26
+ ,26
+ ,69304
+ ,30
+ ,22818
+ ,705
+ ,14335
+ ,21
+ ,21
+ ,53117
+ ,22
+ ,32689
+ ,443
+ ,5084
+ ,4
+ ,4
+ ,19764
+ ,12
+ ,5752
+ ,2416
+ ,9927
+ ,10
+ ,10
+ ,86680
+ ,31
+ ,22197
+ ,7747
+ ,43527
+ ,43
+ ,43
+ ,84105
+ ,20
+ ,20055
+ ,5432
+ ,27184
+ ,34
+ ,34
+ ,77945
+ ,20
+ ,25272
+ ,4913
+ ,21610
+ ,32
+ ,31
+ ,89113
+ ,39
+ ,82206
+ ,2650
+ ,20484
+ ,20
+ ,19
+ ,91005
+ ,29
+ ,32073
+ ,2370
+ ,20156
+ ,34
+ ,34
+ ,40248
+ ,16
+ ,5444
+ ,775
+ ,6012
+ ,6
+ ,6
+ ,64187
+ ,27
+ ,20154
+ ,5576
+ ,18475
+ ,12
+ ,11
+ ,50857
+ ,21
+ ,36944
+ ,1352
+ ,12645
+ ,24
+ ,24
+ ,56613
+ ,19
+ ,8019
+ ,3080
+ ,11017
+ ,16
+ ,16
+ ,62792
+ ,35
+ ,30884
+ ,10205
+ ,37623
+ ,72
+ ,72
+ ,72535
+ ,14
+ ,19540
+ ,6095
+ ,35873
+ ,27
+ ,21)
+ ,dim=c(7
+ ,39)
+ ,dimnames=list(c('TimeRFC'
+ ,'#Logins'
+ ,'#characters'
+ ,'#revisions'
+ ,'#seconds'
+ ,'#Hyperlinks'
+ ,'#Blogs')
+ ,1:39))
> y <- array(NA,dim=c(7,39),dimnames=list(c('TimeRFC','#Logins','#characters','#revisions','#seconds','#Hyperlinks','#Blogs'),1:39))
> 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'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
TimeRFC #Logins #characters #revisions #seconds #Hyperlinks #Blogs
1 150580 77 45588 9653 62991 41 39
2 99611 35 45097 8914 49363 54 54
3 19349 11 3895 786 9604 14 14
4 99373 63 28394 6700 24552 25 24
5 86230 44 18632 5788 31493 25 24
6 30837 19 2325 593 3439 8 8
7 31706 13 25139 4506 19555 26 26
8 89806 42 27975 6382 21228 20 19
9 62088 38 14483 5621 23177 11 11
10 40151 29 13127 3997 22094 14 14
11 27634 20 5839 520 2342 3 1
12 76990 27 24069 8891 38798 40 39
13 37460 20 3738 999 3255 5 5
14 54157 19 18625 7067 24261 38 37
15 49862 37 36341 4639 18511 32 32
16 84337 26 24548 5654 40798 41 38
17 64175 42 21792 6928 28893 46 47
18 59382 49 26263 1514 21425 47 47
19 119308 30 23686 9238 50276 37 37
20 76702 49 49303 8204 37643 51 51
21 103425 67 25659 5926 30377 49 45
22 70344 28 28904 5785 27126 21 21
23 43410 19 2781 4 13 1 1
24 104838 49 29236 5930 42097 44 42
25 62215 27 19546 3710 24451 26 26
26 69304 30 22818 705 14335 21 21
27 53117 22 32689 443 5084 4 4
28 19764 12 5752 2416 9927 10 10
29 86680 31 22197 7747 43527 43 43
30 84105 20 20055 5432 27184 34 34
31 77945 20 25272 4913 21610 32 31
32 89113 39 82206 2650 20484 20 19
33 91005 29 32073 2370 20156 34 34
34 40248 16 5444 775 6012 6 6
35 64187 27 20154 5576 18475 12 11
36 50857 21 36944 1352 12645 24 24
37 56613 19 8019 3080 11017 16 16
38 62792 35 30884 10205 37623 72 72
39 72535 14 19540 6095 35873 27 21
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `#Logins` `#characters` `#revisions` `#seconds`
18668.3207 649.9830 0.3085 -0.9853 1.5055
`#Hyperlinks` `#Blogs`
1041.5959 -1430.9095
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-25291 -7024 -1220 5577 28819
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 18668.3207 5369.0458 3.477 0.001482 **
`#Logins` 649.9830 183.4879 3.542 0.001242 **
`#characters` 0.3085 0.1777 1.736 0.092129 .
`#revisions` -0.9853 1.6586 -0.594 0.556651
`#seconds` 1.5055 0.3821 3.940 0.000414 ***
`#Hyperlinks` 1041.5959 1861.8529 0.559 0.579756
`#Blogs` -1430.9095 1819.2711 -0.787 0.437344
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 13590 on 32 degrees of freedom
Multiple R-squared: 0.8061, Adjusted R-squared: 0.7697
F-statistic: 22.17 on 6 and 32 DF, p-value: 4.093e-10
> 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.41640722 0.8328144 0.5835928
[2,] 0.31690260 0.6338052 0.6830974
[3,] 0.20369139 0.4073828 0.7963086
[4,] 0.20190591 0.4038118 0.7980941
[5,] 0.12732720 0.2546544 0.8726728
[6,] 0.20543575 0.4108715 0.7945642
[7,] 0.13461900 0.2692380 0.8653810
[8,] 0.09755567 0.1951113 0.9024443
[9,] 0.08500431 0.1700086 0.9149957
[10,] 0.32442517 0.6488503 0.6755748
[11,] 0.33339064 0.6667813 0.6666094
[12,] 0.23615145 0.4723029 0.7638485
[13,] 0.16448551 0.3289710 0.8355145
[14,] 0.18798965 0.3759793 0.8120103
[15,] 0.12311316 0.2462263 0.8768868
[16,] 0.08979219 0.1795844 0.9102078
[17,] 0.10170010 0.2034002 0.8982999
[18,] 0.06411418 0.1282284 0.9358858
[19,] 0.14009193 0.2801839 0.8599081
[20,] 0.17341318 0.3468264 0.8265868
> postscript(file="/var/wessaorg/rcomp/tmp/1oews1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/2yc1c1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/3bjbb1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/47pba1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/5iteb1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 39
Frequency = 1
1 2 3 4 5 6
-4425.2904 -231.3380 -15905.0974 8935.5405 -194.6342 -2377.0202
7 8 9 10 11 12
-18046.5069 15891.9512 -10820.7204 -25291.2508 -10542.8519 -2163.0921
13 14 15 16 17 18
2669.1875 1193.4313 -14907.3260 -2986.9314 -5849.5028 -11704.4926
19 20 21 22 23 24
21647.4532 -17760.3326 6749.8034 -2404.5533 11907.7174 2033.2690
25 26 27 28 29 30
-3067.1838 11384.9758 4403.7580 -17150.4614 -143.5221 23912.2601
31 32 33 34 35 36
21813.7005 -2139.0180 28818.5993 3548.6413 2671.6229 -1220.4015
37 38 39
15798.3621 -6710.7996 -7337.9462
> postscript(file="/var/wessaorg/rcomp/tmp/6ocdf1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 39
Frequency = 1
lag(myerror, k = 1) myerror
0 -4425.2904 NA
1 -231.3380 -4425.2904
2 -15905.0974 -231.3380
3 8935.5405 -15905.0974
4 -194.6342 8935.5405
5 -2377.0202 -194.6342
6 -18046.5069 -2377.0202
7 15891.9512 -18046.5069
8 -10820.7204 15891.9512
9 -25291.2508 -10820.7204
10 -10542.8519 -25291.2508
11 -2163.0921 -10542.8519
12 2669.1875 -2163.0921
13 1193.4313 2669.1875
14 -14907.3260 1193.4313
15 -2986.9314 -14907.3260
16 -5849.5028 -2986.9314
17 -11704.4926 -5849.5028
18 21647.4532 -11704.4926
19 -17760.3326 21647.4532
20 6749.8034 -17760.3326
21 -2404.5533 6749.8034
22 11907.7174 -2404.5533
23 2033.2690 11907.7174
24 -3067.1838 2033.2690
25 11384.9758 -3067.1838
26 4403.7580 11384.9758
27 -17150.4614 4403.7580
28 -143.5221 -17150.4614
29 23912.2601 -143.5221
30 21813.7005 23912.2601
31 -2139.0180 21813.7005
32 28818.5993 -2139.0180
33 3548.6413 28818.5993
34 2671.6229 3548.6413
35 -1220.4015 2671.6229
36 15798.3621 -1220.4015
37 -6710.7996 15798.3621
38 -7337.9462 -6710.7996
39 NA -7337.9462
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -231.3380 -4425.2904
[2,] -15905.0974 -231.3380
[3,] 8935.5405 -15905.0974
[4,] -194.6342 8935.5405
[5,] -2377.0202 -194.6342
[6,] -18046.5069 -2377.0202
[7,] 15891.9512 -18046.5069
[8,] -10820.7204 15891.9512
[9,] -25291.2508 -10820.7204
[10,] -10542.8519 -25291.2508
[11,] -2163.0921 -10542.8519
[12,] 2669.1875 -2163.0921
[13,] 1193.4313 2669.1875
[14,] -14907.3260 1193.4313
[15,] -2986.9314 -14907.3260
[16,] -5849.5028 -2986.9314
[17,] -11704.4926 -5849.5028
[18,] 21647.4532 -11704.4926
[19,] -17760.3326 21647.4532
[20,] 6749.8034 -17760.3326
[21,] -2404.5533 6749.8034
[22,] 11907.7174 -2404.5533
[23,] 2033.2690 11907.7174
[24,] -3067.1838 2033.2690
[25,] 11384.9758 -3067.1838
[26,] 4403.7580 11384.9758
[27,] -17150.4614 4403.7580
[28,] -143.5221 -17150.4614
[29,] 23912.2601 -143.5221
[30,] 21813.7005 23912.2601
[31,] -2139.0180 21813.7005
[32,] 28818.5993 -2139.0180
[33,] 3548.6413 28818.5993
[34,] 2671.6229 3548.6413
[35,] -1220.4015 2671.6229
[36,] 15798.3621 -1220.4015
[37,] -6710.7996 15798.3621
[38,] -7337.9462 -6710.7996
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -231.3380 -4425.2904
2 -15905.0974 -231.3380
3 8935.5405 -15905.0974
4 -194.6342 8935.5405
5 -2377.0202 -194.6342
6 -18046.5069 -2377.0202
7 15891.9512 -18046.5069
8 -10820.7204 15891.9512
9 -25291.2508 -10820.7204
10 -10542.8519 -25291.2508
11 -2163.0921 -10542.8519
12 2669.1875 -2163.0921
13 1193.4313 2669.1875
14 -14907.3260 1193.4313
15 -2986.9314 -14907.3260
16 -5849.5028 -2986.9314
17 -11704.4926 -5849.5028
18 21647.4532 -11704.4926
19 -17760.3326 21647.4532
20 6749.8034 -17760.3326
21 -2404.5533 6749.8034
22 11907.7174 -2404.5533
23 2033.2690 11907.7174
24 -3067.1838 2033.2690
25 11384.9758 -3067.1838
26 4403.7580 11384.9758
27 -17150.4614 4403.7580
28 -143.5221 -17150.4614
29 23912.2601 -143.5221
30 21813.7005 23912.2601
31 -2139.0180 21813.7005
32 28818.5993 -2139.0180
33 3548.6413 28818.5993
34 2671.6229 3548.6413
35 -1220.4015 2671.6229
36 15798.3621 -1220.4015
37 -6710.7996 15798.3621
38 -7337.9462 -6710.7996
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/7um7p1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/8nw7h1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/94gii1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/10nift1353334219.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/111wqk1353334219.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12htj51353334219.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/130j9b1353334219.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/149cp81353334219.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/153dj71353334219.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/162xzp1353334219.tab")
+ }
>
> try(system("convert tmp/1oews1353334219.ps tmp/1oews1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/2yc1c1353334219.ps tmp/2yc1c1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bjbb1353334219.ps tmp/3bjbb1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/47pba1353334219.ps tmp/47pba1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/5iteb1353334219.ps tmp/5iteb1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ocdf1353334219.ps tmp/6ocdf1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/7um7p1353334219.ps tmp/7um7p1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/8nw7h1353334219.ps tmp/8nw7h1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/94gii1353334219.ps tmp/94gii1353334219.png",intern=TRUE))
character(0)
> try(system("convert tmp/10nift1353334219.ps tmp/10nift1353334219.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.108 1.135 8.533