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(122,188,0,0,159,189,0,0,956,193,1,0,-11,195,0,0,-10,198,0,0,793,202,1,0,1666,203,1,0,-51,203,0,0,-15,212,0,0,-11,216,0,0,257,219,1,0,514,228,1,0,2094,238,1,0,725,238,0,0,481,238,0,0,5698,241,1,0,4524,243,1,0,853,245,0,0,4032,249,0,1,3318,249,0,1,3528,258,1,0,1054,262,0,0,1397,266,0,0,3958,270,1,0,1002,272,0,0,2898,279,1,0,2749,279,1,0,1436,281,0,0,8958,281,1,1,12192,286,1,1,1614,286,0,0,1716,287,0,0,3286,290,1,0,1919,294,0,0,3800,299,0,1,4766,302,1,1,5698,241,1,0,4524,243,1,0,853,245,0,0,4032,249,0,1,3318,249,0,1,3528,258,1,0,1054,262,0,0,1397,266,0,0,3958,270,1,0,1002,272,0,0,2898,279,1,0,2749,279,1,0,1436,281,0,0,8958,281,1,1,12192,286,1,1,1614,286,0,0,1716,287,0,0,3286,290,1,0,1919,294,0,0,3800,299,0,1,4766,302,1,1),dim=c(4,57),dimnames=list(c('units','store','promo','window'),1:57))
> y <- array(NA,dim=c(4,57),dimnames=list(c('units','store','promo','window'),1:57))
> 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'
> 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
> 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
units store promo window
1 122 188 0 0
2 159 189 0 0
3 956 193 1 0
4 -11 195 0 0
5 -10 198 0 0
6 793 202 1 0
7 1666 203 1 0
8 -51 203 0 0
9 -15 212 0 0
10 -11 216 0 0
11 257 219 1 0
12 514 228 1 0
13 2094 238 1 0
14 725 238 0 0
15 481 238 0 0
16 5698 241 1 0
17 4524 243 1 0
18 853 245 0 0
19 4032 249 0 1
20 3318 249 0 1
21 3528 258 1 0
22 1054 262 0 0
23 1397 266 0 0
24 3958 270 1 0
25 1002 272 0 0
26 2898 279 1 0
27 2749 279 1 0
28 1436 281 0 0
29 8958 281 1 1
30 12192 286 1 1
31 1614 286 0 0
32 1716 287 0 0
33 3286 290 1 0
34 1919 294 0 0
35 3800 299 0 1
36 4766 302 1 1
37 5698 241 1 0
38 4524 243 1 0
39 853 245 0 0
40 4032 249 0 1
41 3318 249 0 1
42 3528 258 1 0
43 1054 262 0 0
44 1397 266 0 0
45 3958 270 1 0
46 1002 272 0 0
47 2898 279 1 0
48 2749 279 1 0
49 1436 281 0 0
50 8958 281 1 1
51 12192 286 1 1
52 1614 286 0 0
53 1716 287 0 0
54 3286 290 1 0
55 1919 294 0 0
56 3800 299 0 1
57 4766 302 1 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) store promo window
-4099.40 19.19 2562.97 3668.34
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3160.0 -918.4 126.7 347.2 4573.0
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4099.402 1597.654 -2.566 0.0132 *
store 19.186 6.337 3.027 0.0038 **
promo 2562.972 391.936 6.539 2.48e-08 ***
window 3668.340 507.217 7.232 1.91e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1468 on 53 degrees of freedom
Multiple R-squared: 0.7225, Adjusted R-squared: 0.7067
F-statistic: 45.99 on 3 and 53 DF, p-value: 8.929e-15
> 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.116389e-02 0.0423277879 0.9788361
[2,] 4.581583e-03 0.0091631668 0.9954184
[3,] 8.457288e-04 0.0016914576 0.9991543
[4,] 1.415951e-04 0.0002831903 0.9998584
[5,] 2.233502e-04 0.0004467004 0.9997766
[6,] 7.034398e-05 0.0001406880 0.9999297
[7,] 1.402026e-03 0.0028040515 0.9985980
[8,] 6.171108e-04 0.0012342216 0.9993829
[9,] 2.016928e-04 0.0004033857 0.9997983
[10,] 2.117816e-01 0.4235632503 0.7882184
[11,] 2.461639e-01 0.4923278348 0.7538361
[12,] 1.865248e-01 0.3730496368 0.8134752
[13,] 1.330313e-01 0.2660625318 0.8669687
[14,] 1.072585e-01 0.2145170645 0.8927415
[15,] 7.278109e-02 0.1455621870 0.9272189
[16,] 5.289114e-02 0.1057822807 0.9471089
[17,] 3.417667e-02 0.0683533382 0.9658233
[18,] 2.123467e-02 0.0424693326 0.9787653
[19,] 1.487587e-02 0.0297517492 0.9851241
[20,] 1.102568e-02 0.0220513579 0.9889743
[21,] 8.557360e-03 0.0171147204 0.9914426
[22,] 4.922304e-03 0.0098446087 0.9950777
[23,] 9.354607e-03 0.0187092139 0.9906454
[24,] 2.771343e-01 0.5542685898 0.7228657
[25,] 2.166112e-01 0.4332223825 0.7833888
[26,] 1.664373e-01 0.3328745838 0.8335627
[27,] 1.313121e-01 0.2626241305 0.8686879
[28,] 1.009581e-01 0.2019162199 0.8990419
[29,] 1.287761e-01 0.2575522513 0.8712239
[30,] 2.996351e-01 0.5992701077 0.7003649
[31,] 3.739607e-01 0.7479214520 0.6260393
[32,] 3.306164e-01 0.6612327545 0.6693836
[33,] 2.546306e-01 0.5092611925 0.7453694
[34,] 1.947958e-01 0.3895916658 0.8052042
[35,] 2.494716e-01 0.4989431905 0.7505284
[36,] 1.961318e-01 0.3922635374 0.8038682
[37,] 1.604600e-01 0.3209200479 0.8395400
[38,] 1.265224e-01 0.2530447309 0.8734776
[39,] 8.511104e-02 0.1702220824 0.9148890
[40,] 9.119742e-02 0.1823948440 0.9088026
[41,] 7.459686e-02 0.1491937163 0.9254031
[42,] 1.092201e-01 0.2184402564 0.8907799
[43,] 1.023118e-01 0.2046236219 0.8976882
[44,] 2.362590e-01 0.4725180704 0.7637410
> postscript(file="/var/wessaorg/rcomp/tmp/1kp6p1341237980.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/2o2201341237980.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/3msob1341237980.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/4julp1341237980.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/5ht7o1341237980.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 = 57
Frequency = 1
1 2 3 4 5 6
614.48139 632.29564 -1210.41985 347.18115 290.62390 -1546.09160
7 8 9 10 11 12
-692.27735 153.69515 17.02341 -55.71959 -2408.24934 -2323.92108
13 14 15 16 17 18
-935.77857 258.19392 14.19392 2610.66418 1398.29268 251.89368
19 20 21 22 23 24
-314.18894 -1028.18894 114.50644 126.73594 392.99294 314.27745
25 26 27 28 29 30
-117.12155 -918.39430 -1067.39430 144.20670 1434.89459 4572.96584
31 32 33 34 35 36
226.27796 309.09221 -741.43754 377.79196 -1505.47640 -3160.00615
37 38 39 40 41 42
2610.66418 1398.29268 251.89368 -314.18894 -1028.18894 114.50644
43 44 45 46 47 48
126.73594 392.99294 314.27745 -117.12155 -918.39430 -1067.39430
49 50 51 52 53 54
144.20670 1434.89459 4572.96584 226.27796 309.09221 -741.43754
55 56 57
377.79196 -1505.47640 -3160.00615
> postscript(file="/var/wessaorg/rcomp/tmp/694fw1341237980.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 = 57
Frequency = 1
lag(myerror, k = 1) myerror
0 614.48139 NA
1 632.29564 614.48139
2 -1210.41985 632.29564
3 347.18115 -1210.41985
4 290.62390 347.18115
5 -1546.09160 290.62390
6 -692.27735 -1546.09160
7 153.69515 -692.27735
8 17.02341 153.69515
9 -55.71959 17.02341
10 -2408.24934 -55.71959
11 -2323.92108 -2408.24934
12 -935.77857 -2323.92108
13 258.19392 -935.77857
14 14.19392 258.19392
15 2610.66418 14.19392
16 1398.29268 2610.66418
17 251.89368 1398.29268
18 -314.18894 251.89368
19 -1028.18894 -314.18894
20 114.50644 -1028.18894
21 126.73594 114.50644
22 392.99294 126.73594
23 314.27745 392.99294
24 -117.12155 314.27745
25 -918.39430 -117.12155
26 -1067.39430 -918.39430
27 144.20670 -1067.39430
28 1434.89459 144.20670
29 4572.96584 1434.89459
30 226.27796 4572.96584
31 309.09221 226.27796
32 -741.43754 309.09221
33 377.79196 -741.43754
34 -1505.47640 377.79196
35 -3160.00615 -1505.47640
36 2610.66418 -3160.00615
37 1398.29268 2610.66418
38 251.89368 1398.29268
39 -314.18894 251.89368
40 -1028.18894 -314.18894
41 114.50644 -1028.18894
42 126.73594 114.50644
43 392.99294 126.73594
44 314.27745 392.99294
45 -117.12155 314.27745
46 -918.39430 -117.12155
47 -1067.39430 -918.39430
48 144.20670 -1067.39430
49 1434.89459 144.20670
50 4572.96584 1434.89459
51 226.27796 4572.96584
52 309.09221 226.27796
53 -741.43754 309.09221
54 377.79196 -741.43754
55 -1505.47640 377.79196
56 -3160.00615 -1505.47640
57 NA -3160.00615
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 632.29564 614.48139
[2,] -1210.41985 632.29564
[3,] 347.18115 -1210.41985
[4,] 290.62390 347.18115
[5,] -1546.09160 290.62390
[6,] -692.27735 -1546.09160
[7,] 153.69515 -692.27735
[8,] 17.02341 153.69515
[9,] -55.71959 17.02341
[10,] -2408.24934 -55.71959
[11,] -2323.92108 -2408.24934
[12,] -935.77857 -2323.92108
[13,] 258.19392 -935.77857
[14,] 14.19392 258.19392
[15,] 2610.66418 14.19392
[16,] 1398.29268 2610.66418
[17,] 251.89368 1398.29268
[18,] -314.18894 251.89368
[19,] -1028.18894 -314.18894
[20,] 114.50644 -1028.18894
[21,] 126.73594 114.50644
[22,] 392.99294 126.73594
[23,] 314.27745 392.99294
[24,] -117.12155 314.27745
[25,] -918.39430 -117.12155
[26,] -1067.39430 -918.39430
[27,] 144.20670 -1067.39430
[28,] 1434.89459 144.20670
[29,] 4572.96584 1434.89459
[30,] 226.27796 4572.96584
[31,] 309.09221 226.27796
[32,] -741.43754 309.09221
[33,] 377.79196 -741.43754
[34,] -1505.47640 377.79196
[35,] -3160.00615 -1505.47640
[36,] 2610.66418 -3160.00615
[37,] 1398.29268 2610.66418
[38,] 251.89368 1398.29268
[39,] -314.18894 251.89368
[40,] -1028.18894 -314.18894
[41,] 114.50644 -1028.18894
[42,] 126.73594 114.50644
[43,] 392.99294 126.73594
[44,] 314.27745 392.99294
[45,] -117.12155 314.27745
[46,] -918.39430 -117.12155
[47,] -1067.39430 -918.39430
[48,] 144.20670 -1067.39430
[49,] 1434.89459 144.20670
[50,] 4572.96584 1434.89459
[51,] 226.27796 4572.96584
[52,] 309.09221 226.27796
[53,] -741.43754 309.09221
[54,] 377.79196 -741.43754
[55,] -1505.47640 377.79196
[56,] -3160.00615 -1505.47640
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 632.29564 614.48139
2 -1210.41985 632.29564
3 347.18115 -1210.41985
4 290.62390 347.18115
5 -1546.09160 290.62390
6 -692.27735 -1546.09160
7 153.69515 -692.27735
8 17.02341 153.69515
9 -55.71959 17.02341
10 -2408.24934 -55.71959
11 -2323.92108 -2408.24934
12 -935.77857 -2323.92108
13 258.19392 -935.77857
14 14.19392 258.19392
15 2610.66418 14.19392
16 1398.29268 2610.66418
17 251.89368 1398.29268
18 -314.18894 251.89368
19 -1028.18894 -314.18894
20 114.50644 -1028.18894
21 126.73594 114.50644
22 392.99294 126.73594
23 314.27745 392.99294
24 -117.12155 314.27745
25 -918.39430 -117.12155
26 -1067.39430 -918.39430
27 144.20670 -1067.39430
28 1434.89459 144.20670
29 4572.96584 1434.89459
30 226.27796 4572.96584
31 309.09221 226.27796
32 -741.43754 309.09221
33 377.79196 -741.43754
34 -1505.47640 377.79196
35 -3160.00615 -1505.47640
36 2610.66418 -3160.00615
37 1398.29268 2610.66418
38 251.89368 1398.29268
39 -314.18894 251.89368
40 -1028.18894 -314.18894
41 114.50644 -1028.18894
42 126.73594 114.50644
43 392.99294 126.73594
44 314.27745 392.99294
45 -117.12155 314.27745
46 -918.39430 -117.12155
47 -1067.39430 -918.39430
48 144.20670 -1067.39430
49 1434.89459 144.20670
50 4572.96584 1434.89459
51 226.27796 4572.96584
52 309.09221 226.27796
53 -741.43754 309.09221
54 377.79196 -741.43754
55 -1505.47640 377.79196
56 -3160.00615 -1505.47640
> 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/7cwfv1341237980.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/8nc971341237980.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/92fxq1341237980.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/10h0r41341237980.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/11sgfc1341237980.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/12a02s1341237980.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/13u9g31341237980.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/14ew0r1341237980.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/15sgmg1341237980.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/16tvov1341237981.tab")
+ }
>
> try(system("convert tmp/1kp6p1341237980.ps tmp/1kp6p1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/2o2201341237980.ps tmp/2o2201341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/3msob1341237980.ps tmp/3msob1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/4julp1341237980.ps tmp/4julp1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ht7o1341237980.ps tmp/5ht7o1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/694fw1341237980.ps tmp/694fw1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/7cwfv1341237980.ps tmp/7cwfv1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/8nc971341237980.ps tmp/8nc971341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/92fxq1341237980.ps tmp/92fxq1341237980.png",intern=TRUE))
character(0)
> try(system("convert tmp/10h0r41341237980.ps tmp/10h0r41341237980.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
10.626 1.923 12.727