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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> 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
Pageviews Month CourseCompView CompendiumView_PR t
1 1167 9 333 70 1
2 669 9 223 44 2
3 1053 9 371 35 3
4 1939 9 873 119 4
5 678 9 186 30 5
6 321 9 111 23 6
7 2667 10 1277 46 7
8 345 10 102 39 8
9 1367 10 580 58 9
10 1158 10 420 51 10
11 1385 11 521 65 11
12 1155 11 358 40 12
13 1120 9 435 41 13
14 1703 9 690 76 14
15 1189 9 393 31 15
16 3083 10 1149 82 16
17 1357 10 486 36 17
18 1892 10 767 62 18
19 883 11 338 28 19
20 1627 11 485 38 20
21 1412 11 465 70 21
22 1900 11 816 76 22
23 777 9 265 33 23
24 904 9 307 40 24
25 2115 9 850 126 25
26 1858 10 704 56 26
27 1781 10 693 63 27
28 1286 10 387 46 28
29 1035 10 406 35 29
30 1557 10 573 108 30
31 1527 11 595 34 31
32 1220 11 394 54 32
33 1368 11 521 35 33
34 564 9 172 23 34
35 1990 9 835 46 35
36 1557 9 669 49 36
37 2057 10 749 56 37
38 1111 10 368 38 38
39 686 11 216 19 39
40 2011 10 772 29 40
41 2232 10 1084 26 41
42 1032 9 445 52 42
43 1166 9 451 54 43
44 1020 9 300 45 44
45 1735 10 836 56 45
46 3623 10 1417 596 46
47 918 10 330 57 47
48 1579 10 477 55 48
49 2790 11 1028 99 49
50 1496 11 646 51 50
51 1108 10 342 21 51
52 496 10 218 20 52
53 1750 10 591 58 53
54 744 10 255 21 54
55 1101 10 434 66 55
56 1612 9 654 47 56
57 1805 9 478 55 57
58 2460 9 753 158 58
59 1653 9 689 46 59
60 1234 9 470 45 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month CourseCompView CompendiumView_PR
8.0171 21.7926 2.0461 0.9749
t
1.6991
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-332.54 -116.32 -17.42 85.75 472.34
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.01709 307.72604 0.026 0.9793
Month 21.79262 31.32477 0.696 0.4895
CourseCompView 2.04611 0.09948 20.569 <2e-16 ***
CompendiumView_PR 0.97488 0.36905 2.642 0.0107 *
t 1.69908 1.34083 1.267 0.2104
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 178.2 on 55 degrees of freedom
Multiple R-squared: 0.9293, Adjusted R-squared: 0.9241
F-statistic: 180.6 on 4 and 55 DF, p-value: < 2.2e-16
> 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.2637779456 0.527555891 0.7362221
[2,] 0.2022183427 0.404436685 0.7977817
[3,] 0.2384814929 0.476962986 0.7615185
[4,] 0.1464660527 0.292932105 0.8535339
[5,] 0.1239484121 0.247896824 0.8760516
[6,] 0.1314251641 0.262850328 0.8685748
[7,] 0.0955230820 0.191046164 0.9044769
[8,] 0.0844145376 0.168829075 0.9155855
[9,] 0.4102466480 0.820493296 0.5897534
[10,] 0.3202963052 0.640592610 0.6797037
[11,] 0.2547465729 0.509493146 0.7452534
[12,] 0.2360161096 0.472032219 0.7639839
[13,] 0.3325945405 0.665189081 0.6674055
[14,] 0.2709440421 0.541888084 0.7290560
[15,] 0.2890650299 0.578130060 0.7109350
[16,] 0.2469873994 0.493974799 0.7530126
[17,] 0.1897351575 0.379470315 0.8102648
[18,] 0.1399915139 0.279983028 0.8600085
[19,] 0.1047775973 0.209555195 0.8952224
[20,] 0.0735072182 0.147014436 0.9264928
[21,] 0.0668641602 0.133728320 0.9331358
[22,] 0.0582251065 0.116450213 0.9417749
[23,] 0.0401256605 0.080251321 0.9598743
[24,] 0.0275166506 0.055033301 0.9724833
[25,] 0.0193821877 0.038764375 0.9806178
[26,] 0.0130770812 0.026154162 0.9869229
[27,] 0.0082227771 0.016445554 0.9917772
[28,] 0.0046605955 0.009321191 0.9953394
[29,] 0.0030758664 0.006151733 0.9969241
[30,] 0.0039327111 0.007865422 0.9960673
[31,] 0.0025306207 0.005061241 0.9974694
[32,] 0.0016945824 0.003389165 0.9983054
[33,] 0.0017794567 0.003558913 0.9982205
[34,] 0.0030977936 0.006195587 0.9969022
[35,] 0.0026104034 0.005220807 0.9973896
[36,] 0.0013958631 0.002791726 0.9986041
[37,] 0.0009623416 0.001924683 0.9990377
[38,] 0.0075609537 0.015121907 0.9924390
[39,] 0.0544983848 0.108996770 0.9455016
[40,] 0.1175674337 0.235134867 0.8824326
[41,] 0.1066664098 0.213332820 0.8933336
[42,] 0.1099687733 0.219937547 0.8900312
[43,] 0.0742498736 0.148499747 0.9257501
[44,] 0.0466097508 0.093219502 0.9533902
[45,] 0.0983889667 0.196777933 0.9016110
> postscript(file="/var/wessaorg/rcomp/tmp/1ipi51321899352.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/2a65b1321899353.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/34ah51321899353.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/4uc5c1321899353.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/526s81321899353.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
211.554521 -37.725763 50.524993 -174.210436 55.531316 -142.885468
7 8 9 10 11 12
-228.562019 -141.259341 -117.521033 5.981414 -10.815565 115.373028
13 14 15 16 17 18
-36.266046 -10.843583 125.021141 398.952508 72.667859 5.665409
19 20 21 22 23 24
-115.899824 315.874341 108.901307 -128.831168 -40.619368 -8.079163
25 26 27 28 29 30
6.345198 92.826872 29.810833 175.793925 -105.057552 2.377069
31 32 33 34 35 36
-23.987986 59.083183 -35.948991 -72.272375 -26.963675 -124.933365
37 38 39 40 41 42
181.062089 30.478205 -88.482294 109.226077 -306.934252 -204.724164
43 44 45 46 47 48
-86.649655 83.387572 -332.542012 -161.464805 -118.584101 241.888610
49 50 51 52 53 54
259.096393 -208.195015 75.161910 -283.844826 168.212186 -115.923886
55 56 57 58 59 60
-170.745958 -71.273609 472.343392 462.551917 -106.009775 -77.636194
> postscript(file="/var/wessaorg/rcomp/tmp/6h5m71321899353.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 211.554521 NA
1 -37.725763 211.554521
2 50.524993 -37.725763
3 -174.210436 50.524993
4 55.531316 -174.210436
5 -142.885468 55.531316
6 -228.562019 -142.885468
7 -141.259341 -228.562019
8 -117.521033 -141.259341
9 5.981414 -117.521033
10 -10.815565 5.981414
11 115.373028 -10.815565
12 -36.266046 115.373028
13 -10.843583 -36.266046
14 125.021141 -10.843583
15 398.952508 125.021141
16 72.667859 398.952508
17 5.665409 72.667859
18 -115.899824 5.665409
19 315.874341 -115.899824
20 108.901307 315.874341
21 -128.831168 108.901307
22 -40.619368 -128.831168
23 -8.079163 -40.619368
24 6.345198 -8.079163
25 92.826872 6.345198
26 29.810833 92.826872
27 175.793925 29.810833
28 -105.057552 175.793925
29 2.377069 -105.057552
30 -23.987986 2.377069
31 59.083183 -23.987986
32 -35.948991 59.083183
33 -72.272375 -35.948991
34 -26.963675 -72.272375
35 -124.933365 -26.963675
36 181.062089 -124.933365
37 30.478205 181.062089
38 -88.482294 30.478205
39 109.226077 -88.482294
40 -306.934252 109.226077
41 -204.724164 -306.934252
42 -86.649655 -204.724164
43 83.387572 -86.649655
44 -332.542012 83.387572
45 -161.464805 -332.542012
46 -118.584101 -161.464805
47 241.888610 -118.584101
48 259.096393 241.888610
49 -208.195015 259.096393
50 75.161910 -208.195015
51 -283.844826 75.161910
52 168.212186 -283.844826
53 -115.923886 168.212186
54 -170.745958 -115.923886
55 -71.273609 -170.745958
56 472.343392 -71.273609
57 462.551917 472.343392
58 -106.009775 462.551917
59 -77.636194 -106.009775
60 NA -77.636194
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -37.725763 211.554521
[2,] 50.524993 -37.725763
[3,] -174.210436 50.524993
[4,] 55.531316 -174.210436
[5,] -142.885468 55.531316
[6,] -228.562019 -142.885468
[7,] -141.259341 -228.562019
[8,] -117.521033 -141.259341
[9,] 5.981414 -117.521033
[10,] -10.815565 5.981414
[11,] 115.373028 -10.815565
[12,] -36.266046 115.373028
[13,] -10.843583 -36.266046
[14,] 125.021141 -10.843583
[15,] 398.952508 125.021141
[16,] 72.667859 398.952508
[17,] 5.665409 72.667859
[18,] -115.899824 5.665409
[19,] 315.874341 -115.899824
[20,] 108.901307 315.874341
[21,] -128.831168 108.901307
[22,] -40.619368 -128.831168
[23,] -8.079163 -40.619368
[24,] 6.345198 -8.079163
[25,] 92.826872 6.345198
[26,] 29.810833 92.826872
[27,] 175.793925 29.810833
[28,] -105.057552 175.793925
[29,] 2.377069 -105.057552
[30,] -23.987986 2.377069
[31,] 59.083183 -23.987986
[32,] -35.948991 59.083183
[33,] -72.272375 -35.948991
[34,] -26.963675 -72.272375
[35,] -124.933365 -26.963675
[36,] 181.062089 -124.933365
[37,] 30.478205 181.062089
[38,] -88.482294 30.478205
[39,] 109.226077 -88.482294
[40,] -306.934252 109.226077
[41,] -204.724164 -306.934252
[42,] -86.649655 -204.724164
[43,] 83.387572 -86.649655
[44,] -332.542012 83.387572
[45,] -161.464805 -332.542012
[46,] -118.584101 -161.464805
[47,] 241.888610 -118.584101
[48,] 259.096393 241.888610
[49,] -208.195015 259.096393
[50,] 75.161910 -208.195015
[51,] -283.844826 75.161910
[52,] 168.212186 -283.844826
[53,] -115.923886 168.212186
[54,] -170.745958 -115.923886
[55,] -71.273609 -170.745958
[56,] 472.343392 -71.273609
[57,] 462.551917 472.343392
[58,] -106.009775 462.551917
[59,] -77.636194 -106.009775
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -37.725763 211.554521
2 50.524993 -37.725763
3 -174.210436 50.524993
4 55.531316 -174.210436
5 -142.885468 55.531316
6 -228.562019 -142.885468
7 -141.259341 -228.562019
8 -117.521033 -141.259341
9 5.981414 -117.521033
10 -10.815565 5.981414
11 115.373028 -10.815565
12 -36.266046 115.373028
13 -10.843583 -36.266046
14 125.021141 -10.843583
15 398.952508 125.021141
16 72.667859 398.952508
17 5.665409 72.667859
18 -115.899824 5.665409
19 315.874341 -115.899824
20 108.901307 315.874341
21 -128.831168 108.901307
22 -40.619368 -128.831168
23 -8.079163 -40.619368
24 6.345198 -8.079163
25 92.826872 6.345198
26 29.810833 92.826872
27 175.793925 29.810833
28 -105.057552 175.793925
29 2.377069 -105.057552
30 -23.987986 2.377069
31 59.083183 -23.987986
32 -35.948991 59.083183
33 -72.272375 -35.948991
34 -26.963675 -72.272375
35 -124.933365 -26.963675
36 181.062089 -124.933365
37 30.478205 181.062089
38 -88.482294 30.478205
39 109.226077 -88.482294
40 -306.934252 109.226077
41 -204.724164 -306.934252
42 -86.649655 -204.724164
43 83.387572 -86.649655
44 -332.542012 83.387572
45 -161.464805 -332.542012
46 -118.584101 -161.464805
47 241.888610 -118.584101
48 259.096393 241.888610
49 -208.195015 259.096393
50 75.161910 -208.195015
51 -283.844826 75.161910
52 168.212186 -283.844826
53 -115.923886 168.212186
54 -170.745958 -115.923886
55 -71.273609 -170.745958
56 472.343392 -71.273609
57 462.551917 472.343392
58 -106.009775 462.551917
59 -77.636194 -106.009775
> 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/7dou61321899353.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/8xi4g1321899353.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/97nli1321899353.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/10tqtx1321899353.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/110a2u1321899353.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/12n87p1321899353.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/13e0yv1321899353.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/145k3j1321899353.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/158xp61321899353.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/16fumn1321899353.tab")
+ }
>
> try(system("convert tmp/1ipi51321899352.ps tmp/1ipi51321899352.png",intern=TRUE))
character(0)
> try(system("convert tmp/2a65b1321899353.ps tmp/2a65b1321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/34ah51321899353.ps tmp/34ah51321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/4uc5c1321899353.ps tmp/4uc5c1321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/526s81321899353.ps tmp/526s81321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/6h5m71321899353.ps tmp/6h5m71321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/7dou61321899353.ps tmp/7dou61321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/8xi4g1321899353.ps tmp/8xi4g1321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/97nli1321899353.ps tmp/97nli1321899353.png",intern=TRUE))
character(0)
> try(system("convert tmp/10tqtx1321899353.ps tmp/10tqtx1321899353.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.329 0.577 3.972