R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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(9,1167,333,70,9,669,223,44,9,1053,371,35,9,1939,873,119,9,678,186,30,9,321,111,23,10,2667,1277,46,10,345,102,39,10,1367,580,58,10,1158,420,51,11,1385,521,65,11,1155,358,40,9,1120,435,41,9,1703,690,76,9,1189,393,31,10,3083,1149,82,10,1357,486,36,10,1892,767,62,11,883,338,28,11,1627,485,38,11,1412,465,70,11,1900,816,76,9,777,265,33,9,904,307,40,9,2115,850,126,10,1858,704,56,10,1781,693,63,10,1286,387,46,10,1035,406,35,10,1557,573,108,11,1527,595,34,11,1220,394,54,11,1368,521,35,9,564,172,23,9,1990,835,46,9,1557,669,49,10,2057,749,56,10,1111,368,38,11,686,216,19,10,2011,772,29,10,2232,1084,26,9,1032,445,52,9,1166,451,54,9,1020,300,45,10,1735,836,56,10,3623,1417,596,10,918,330,57,10,1579,477,55,11,2790,1028,99,11,1496,646,51,10,1108,342,21,10,496,218,20,10,1750,591,58,10,744,255,21,10,1101,434,66,9,1612,654,47,9,1805,478,55,9,2460,753,158,9,1653,689,46,9,1234,470,45),dim=c(4,60),dimnames=list(c('Month','Pageviews','CourseCompView','CompendiumView_PR'),1:60))
> y <- array(NA,dim=c(4,60),dimnames=list(c('Month','Pageviews','CourseCompView','CompendiumView_PR'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '4'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
CompendiumView_PR Month Pageviews CourseCompView
1 70 9 1167 333
2 44 9 669 223
3 35 9 1053 371
4 119 9 1939 873
5 30 9 678 186
6 23 9 321 111
7 46 10 2667 1277
8 39 10 345 102
9 58 10 1367 580
10 51 10 1158 420
11 65 11 1385 521
12 40 11 1155 358
13 41 9 1120 435
14 76 9 1703 690
15 31 9 1189 393
16 82 10 3083 1149
17 36 10 1357 486
18 62 10 1892 767
19 28 11 883 338
20 38 11 1627 485
21 70 11 1412 465
22 76 11 1900 816
23 33 9 777 265
24 40 9 904 307
25 126 9 2115 850
26 56 10 1858 704
27 63 10 1781 693
28 46 10 1286 387
29 35 10 1035 406
30 108 10 1557 573
31 34 11 1527 595
32 54 11 1220 394
33 35 11 1368 521
34 23 9 564 172
35 46 9 1990 835
36 49 9 1557 669
37 56 10 2057 749
38 38 10 1111 368
39 19 11 686 216
40 29 10 2011 772
41 26 10 2232 1084
42 52 9 1032 445
43 54 9 1166 451
44 45 9 1020 300
45 56 10 1735 836
46 596 10 3623 1417
47 57 10 918 330
48 55 10 1579 477
49 99 11 2790 1028
50 51 11 1496 646
51 21 10 1108 342
52 20 10 496 218
53 58 10 1750 591
54 21 10 744 255
55 66 10 1101 434
56 47 9 1612 654
57 55 9 1805 478
58 158 9 2460 753
59 46 9 1653 689
60 45 9 1234 470
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month Pageviews CourseCompView
34.3769 -8.3233 0.1152 -0.1072
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-101.25 -23.75 -0.37 14.02 379.25
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 34.37695 104.30227 0.330 0.7429
Month -8.32333 10.67406 -0.780 0.4388
Pageviews 0.11522 0.04264 2.702 0.0091 **
CourseCompView -0.10716 0.09811 -1.092 0.2794
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 60.77 on 56 degrees of freedom
Multiple R-squared: 0.3776, Adjusted R-squared: 0.3443
F-statistic: 11.33 on 3 and 56 DF, p-value: 6.538e-06
> 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,] 2.032536e-02 4.065072e-02 0.9796746411
[2,] 9.387798e-02 1.877560e-01 0.9061220210
[3,] 4.271377e-02 8.542754e-02 0.9572862310
[4,] 1.676907e-02 3.353815e-02 0.9832309258
[5,] 7.030491e-03 1.406098e-02 0.9929695089
[6,] 2.665223e-03 5.330446e-03 0.9973347770
[7,] 1.003554e-03 2.007109e-03 0.9989964457
[8,] 3.248797e-04 6.497593e-04 0.9996751203
[9,] 1.978208e-04 3.956417e-04 0.9998021792
[10,] 1.080758e-04 2.161516e-04 0.9998919242
[11,] 4.221049e-05 8.442099e-05 0.9999577895
[12,] 1.310315e-05 2.620629e-05 0.9999868969
[13,] 4.113699e-06 8.227399e-06 0.9999958863
[14,] 1.366684e-06 2.733367e-06 0.9999986333
[15,] 7.722538e-07 1.544508e-06 0.9999992277
[16,] 2.842586e-07 5.685171e-07 0.9999997157
[17,] 8.813359e-08 1.762672e-07 0.9999999119
[18,] 2.413328e-08 4.826657e-08 0.9999999759
[19,] 1.088165e-07 2.176330e-07 0.9999998912
[20,] 3.721859e-08 7.443718e-08 0.9999999628
[21,] 1.054144e-08 2.108288e-08 0.9999999895
[22,] 2.757662e-09 5.515324e-09 0.9999999972
[23,] 7.735193e-10 1.547039e-09 0.9999999992
[24,] 2.702305e-09 5.404610e-09 0.9999999973
[25,] 1.001845e-09 2.003689e-09 0.9999999990
[26,] 2.919859e-10 5.839718e-10 0.9999999997
[27,] 8.327913e-11 1.665583e-10 0.9999999999
[28,] 3.232299e-11 6.464599e-11 1.0000000000
[29,] 2.668955e-11 5.337909e-11 1.0000000000
[30,] 7.592489e-12 1.518498e-11 1.0000000000
[31,] 3.769417e-12 7.538835e-12 1.0000000000
[32,] 8.998863e-13 1.799773e-12 1.0000000000
[33,] 2.947082e-13 5.894164e-13 1.0000000000
[34,] 8.458134e-13 1.691627e-12 1.0000000000
[35,] 2.220471e-11 4.440942e-11 1.0000000000
[36,] 5.799017e-12 1.159803e-11 1.0000000000
[37,] 1.359770e-12 2.719541e-12 1.0000000000
[38,] 4.155116e-13 8.310232e-13 1.0000000000
[39,] 6.767299e-13 1.353460e-12 1.0000000000
[40,] 9.990423e-01 1.915444e-03 0.0009577222
[41,] 9.984036e-01 3.192756e-03 0.0015963779
[42,] 9.958661e-01 8.267825e-03 0.0041339123
[43,] 9.916948e-01 1.661049e-02 0.0083052468
[44,] 9.796351e-01 4.072986e-02 0.0203649287
[45,] 9.625415e-01 7.491700e-02 0.0374584984
[46,] 9.191223e-01 1.617553e-01 0.0808776740
[47,] 9.332721e-01 1.334558e-01 0.0667279089
> postscript(file="/var/wessaorg/rcomp/tmp/126qq1321898712.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/28kfm1321898712.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/3freu1321898712.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/45iy41321898712.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/50jsi1321898712.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 = 60
Frequency = 1
1 2 3 4 5 6
11.7518739 31.3454461 -6.0405527 29.6661940 12.3434896 38.4411880
7 8 9 10 11 12
-75.6001779 59.0347145 11.4992230 11.4351997 18.4260548 2.4602407
13 14 15 16 17 18
-0.9022351 -5.7514939 -23.3533986 -101.2496788 -19.4216490 -24.9540067
19 20 21 22 23 24
19.6577893 -40.3157913 14.3140240 1.6984148 12.4020692 9.2694478
25 26 27 28 29 30
13.9221808 -33.7875356 -19.0941021 -11.8496976 8.1074272 38.8566536
31 32 33 34 35 36
-21.0057750 12.8285054 -9.6151475 16.9787065 -53.2823057 -18.1792533
37 38 39 40 41 42
-51.8947590 -1.7216573 20.2831920 -71.1297869 -66.1600177 21.3090304
43 44 45 46 47 48
8.5120601 0.1534094 -5.4698457 379.2487574 35.4443507 -26.9656884
49 50 51 52 53 54
-55.1323355 5.0313460 -21.1621654 35.0666237 -31.4525685 11.4561684
55 56 57 58 59 60
34.5031829 -28.1239504 -61.2223486 -4.2244776 -30.0974849 -6.2870772
> postscript(file="/var/wessaorg/rcomp/tmp/609c61321898712.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 11.7518739 NA
1 31.3454461 11.7518739
2 -6.0405527 31.3454461
3 29.6661940 -6.0405527
4 12.3434896 29.6661940
5 38.4411880 12.3434896
6 -75.6001779 38.4411880
7 59.0347145 -75.6001779
8 11.4992230 59.0347145
9 11.4351997 11.4992230
10 18.4260548 11.4351997
11 2.4602407 18.4260548
12 -0.9022351 2.4602407
13 -5.7514939 -0.9022351
14 -23.3533986 -5.7514939
15 -101.2496788 -23.3533986
16 -19.4216490 -101.2496788
17 -24.9540067 -19.4216490
18 19.6577893 -24.9540067
19 -40.3157913 19.6577893
20 14.3140240 -40.3157913
21 1.6984148 14.3140240
22 12.4020692 1.6984148
23 9.2694478 12.4020692
24 13.9221808 9.2694478
25 -33.7875356 13.9221808
26 -19.0941021 -33.7875356
27 -11.8496976 -19.0941021
28 8.1074272 -11.8496976
29 38.8566536 8.1074272
30 -21.0057750 38.8566536
31 12.8285054 -21.0057750
32 -9.6151475 12.8285054
33 16.9787065 -9.6151475
34 -53.2823057 16.9787065
35 -18.1792533 -53.2823057
36 -51.8947590 -18.1792533
37 -1.7216573 -51.8947590
38 20.2831920 -1.7216573
39 -71.1297869 20.2831920
40 -66.1600177 -71.1297869
41 21.3090304 -66.1600177
42 8.5120601 21.3090304
43 0.1534094 8.5120601
44 -5.4698457 0.1534094
45 379.2487574 -5.4698457
46 35.4443507 379.2487574
47 -26.9656884 35.4443507
48 -55.1323355 -26.9656884
49 5.0313460 -55.1323355
50 -21.1621654 5.0313460
51 35.0666237 -21.1621654
52 -31.4525685 35.0666237
53 11.4561684 -31.4525685
54 34.5031829 11.4561684
55 -28.1239504 34.5031829
56 -61.2223486 -28.1239504
57 -4.2244776 -61.2223486
58 -30.0974849 -4.2244776
59 -6.2870772 -30.0974849
60 NA -6.2870772
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 31.3454461 11.7518739
[2,] -6.0405527 31.3454461
[3,] 29.6661940 -6.0405527
[4,] 12.3434896 29.6661940
[5,] 38.4411880 12.3434896
[6,] -75.6001779 38.4411880
[7,] 59.0347145 -75.6001779
[8,] 11.4992230 59.0347145
[9,] 11.4351997 11.4992230
[10,] 18.4260548 11.4351997
[11,] 2.4602407 18.4260548
[12,] -0.9022351 2.4602407
[13,] -5.7514939 -0.9022351
[14,] -23.3533986 -5.7514939
[15,] -101.2496788 -23.3533986
[16,] -19.4216490 -101.2496788
[17,] -24.9540067 -19.4216490
[18,] 19.6577893 -24.9540067
[19,] -40.3157913 19.6577893
[20,] 14.3140240 -40.3157913
[21,] 1.6984148 14.3140240
[22,] 12.4020692 1.6984148
[23,] 9.2694478 12.4020692
[24,] 13.9221808 9.2694478
[25,] -33.7875356 13.9221808
[26,] -19.0941021 -33.7875356
[27,] -11.8496976 -19.0941021
[28,] 8.1074272 -11.8496976
[29,] 38.8566536 8.1074272
[30,] -21.0057750 38.8566536
[31,] 12.8285054 -21.0057750
[32,] -9.6151475 12.8285054
[33,] 16.9787065 -9.6151475
[34,] -53.2823057 16.9787065
[35,] -18.1792533 -53.2823057
[36,] -51.8947590 -18.1792533
[37,] -1.7216573 -51.8947590
[38,] 20.2831920 -1.7216573
[39,] -71.1297869 20.2831920
[40,] -66.1600177 -71.1297869
[41,] 21.3090304 -66.1600177
[42,] 8.5120601 21.3090304
[43,] 0.1534094 8.5120601
[44,] -5.4698457 0.1534094
[45,] 379.2487574 -5.4698457
[46,] 35.4443507 379.2487574
[47,] -26.9656884 35.4443507
[48,] -55.1323355 -26.9656884
[49,] 5.0313460 -55.1323355
[50,] -21.1621654 5.0313460
[51,] 35.0666237 -21.1621654
[52,] -31.4525685 35.0666237
[53,] 11.4561684 -31.4525685
[54,] 34.5031829 11.4561684
[55,] -28.1239504 34.5031829
[56,] -61.2223486 -28.1239504
[57,] -4.2244776 -61.2223486
[58,] -30.0974849 -4.2244776
[59,] -6.2870772 -30.0974849
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 31.3454461 11.7518739
2 -6.0405527 31.3454461
3 29.6661940 -6.0405527
4 12.3434896 29.6661940
5 38.4411880 12.3434896
6 -75.6001779 38.4411880
7 59.0347145 -75.6001779
8 11.4992230 59.0347145
9 11.4351997 11.4992230
10 18.4260548 11.4351997
11 2.4602407 18.4260548
12 -0.9022351 2.4602407
13 -5.7514939 -0.9022351
14 -23.3533986 -5.7514939
15 -101.2496788 -23.3533986
16 -19.4216490 -101.2496788
17 -24.9540067 -19.4216490
18 19.6577893 -24.9540067
19 -40.3157913 19.6577893
20 14.3140240 -40.3157913
21 1.6984148 14.3140240
22 12.4020692 1.6984148
23 9.2694478 12.4020692
24 13.9221808 9.2694478
25 -33.7875356 13.9221808
26 -19.0941021 -33.7875356
27 -11.8496976 -19.0941021
28 8.1074272 -11.8496976
29 38.8566536 8.1074272
30 -21.0057750 38.8566536
31 12.8285054 -21.0057750
32 -9.6151475 12.8285054
33 16.9787065 -9.6151475
34 -53.2823057 16.9787065
35 -18.1792533 -53.2823057
36 -51.8947590 -18.1792533
37 -1.7216573 -51.8947590
38 20.2831920 -1.7216573
39 -71.1297869 20.2831920
40 -66.1600177 -71.1297869
41 21.3090304 -66.1600177
42 8.5120601 21.3090304
43 0.1534094 8.5120601
44 -5.4698457 0.1534094
45 379.2487574 -5.4698457
46 35.4443507 379.2487574
47 -26.9656884 35.4443507
48 -55.1323355 -26.9656884
49 5.0313460 -55.1323355
50 -21.1621654 5.0313460
51 35.0666237 -21.1621654
52 -31.4525685 35.0666237
53 11.4561684 -31.4525685
54 34.5031829 11.4561684
55 -28.1239504 34.5031829
56 -61.2223486 -28.1239504
57 -4.2244776 -61.2223486
58 -30.0974849 -4.2244776
59 -6.2870772 -30.0974849
> 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/7fwwi1321898712.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/8j0dl1321898712.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/964bf1321898712.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/10or141321898712.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/11jfyo1321898712.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/12yxty1321898712.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/13hlgh1321898712.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/14vtoa1321898712.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/15pkt81321898712.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/16k7ur1321898712.tab")
+ }
>
> try(system("convert tmp/126qq1321898712.ps tmp/126qq1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/28kfm1321898712.ps tmp/28kfm1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/3freu1321898712.ps tmp/3freu1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/45iy41321898712.ps tmp/45iy41321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/50jsi1321898712.ps tmp/50jsi1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/609c61321898712.ps tmp/609c61321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/7fwwi1321898712.ps tmp/7fwwi1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/8j0dl1321898712.ps tmp/8j0dl1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/964bf1321898712.ps tmp/964bf1321898712.png",intern=TRUE))
character(0)
> try(system("convert tmp/10or141321898712.ps tmp/10or141321898712.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.252 0.483 3.757