R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-redhat-linux-gnu (64-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(4831
+ ,0
+ ,3695
+ ,2462
+ ,2146
+ ,1579
+ ,5134
+ ,0
+ ,4831
+ ,3695
+ ,2462
+ ,2146
+ ,6250
+ ,0
+ ,5134
+ ,4831
+ ,3695
+ ,2462
+ ,5760
+ ,0
+ ,6250
+ ,5134
+ ,4831
+ ,3695
+ ,6249
+ ,0
+ ,5760
+ ,6250
+ ,5134
+ ,4831
+ ,2917
+ ,0
+ ,6249
+ ,5760
+ ,6250
+ ,5134
+ ,1741
+ ,0
+ ,2917
+ ,6249
+ ,5760
+ ,6250
+ ,2359
+ ,0
+ ,1741
+ ,2917
+ ,6249
+ ,5760
+ ,1511
+ ,1
+ ,2359
+ ,1741
+ ,2917
+ ,6249
+ ,2059
+ ,0
+ ,1511
+ ,2359
+ ,1741
+ ,2917
+ ,2635
+ ,0
+ ,2059
+ ,1511
+ ,2359
+ ,1741
+ ,2867
+ ,0
+ ,2635
+ ,2059
+ ,1511
+ ,2359
+ ,4403
+ ,0
+ ,2867
+ ,2635
+ ,2059
+ ,1511
+ ,5720
+ ,0
+ ,4403
+ ,2867
+ ,2635
+ ,2059
+ ,4502
+ ,0
+ ,5720
+ ,4403
+ ,2867
+ ,2635
+ ,5749
+ ,0
+ ,4502
+ ,5720
+ ,4403
+ ,2867
+ ,5627
+ ,0
+ ,5749
+ ,4502
+ ,5720
+ ,4403
+ ,2846
+ ,0
+ ,5627
+ ,5749
+ ,4502
+ ,5720
+ ,1762
+ ,0
+ ,2846
+ ,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dim=c(6,116),dimnames=list(c('Y','X','Y1','Y2','Y3','Y4'),1:116))
> 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 = 'Include Monthly 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
Y X Y1 Y2 Y3 Y4 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 4831 0 3695 2462 2146 1579 1 0 0 0 0 0 0 0 0 0 0
2 5134 0 4831 3695 2462 2146 0 1 0 0 0 0 0 0 0 0 0
3 6250 0 5134 4831 3695 2462 0 0 1 0 0 0 0 0 0 0 0
4 5760 0 6250 5134 4831 3695 0 0 0 1 0 0 0 0 0 0 0
5 6249 0 5760 6250 5134 4831 0 0 0 0 1 0 0 0 0 0 0
6 2917 0 6249 5760 6250 5134 0 0 0 0 0 1 0 0 0 0 0
7 1741 0 2917 6249 5760 6250 0 0 0 0 0 0 1 0 0 0 0
8 2359 0 1741 2917 6249 5760 0 0 0 0 0 0 0 1 0 0 0
9 1511 1 2359 1741 2917 6249 0 0 0 0 0 0 0 0 1 0 0
10 2059 0 1511 2359 1741 2917 0 0 0 0 0 0 0 0 0 1 0
11 2635 0 2059 1511 2359 1741 0 0 0 0 0 0 0 0 0 0 1
12 2867 0 2635 2059 1511 2359 0 0 0 0 0 0 0 0 0 0 0
13 4403 0 2867 2635 2059 1511 1 0 0 0 0 0 0 0 0 0 0
14 5720 0 4403 2867 2635 2059 0 1 0 0 0 0 0 0 0 0 0
15 4502 0 5720 4403 2867 2635 0 0 1 0 0 0 0 0 0 0 0
16 5749 0 4502 5720 4403 2867 0 0 0 1 0 0 0 0 0 0 0
17 5627 0 5749 4502 5720 4403 0 0 0 0 1 0 0 0 0 0 0
18 2846 0 5627 5749 4502 5720 0 0 0 0 0 1 0 0 0 0 0
19 1762 0 2846 5627 5749 4502 0 0 0 0 0 0 1 0 0 0 0
20 2429 0 1762 2846 5627 5749 0 0 0 0 0 0 0 1 0 0 0
21 1169 0 2429 1762 2846 5627 0 0 0 0 0 0 0 0 1 0 0
22 2154 1 1169 2429 1762 2846 0 0 0 0 0 0 0 0 0 1 0
23 2249 0 2154 1169 2429 1762 0 0 0 0 0 0 0 0 0 0 1
24 2687 0 2249 2154 1169 2429 0 0 0 0 0 0 0 0 0 0 0
25 4359 0 2687 2249 2154 1169 1 0 0 0 0 0 0 0 0 0 0
26 5382 0 4359 2687 2249 2154 0 1 0 0 0 0 0 0 0 0 0
27 4459 0 5382 4359 2687 2249 0 0 1 0 0 0 0 0 0 0 0
28 6398 0 4459 5382 4359 2687 0 0 0 1 0 0 0 0 0 0 0
29 4596 0 6398 4459 5382 4359 0 0 0 0 1 0 0 0 0 0 0
30 3024 0 4596 6398 4459 5382 0 0 0 0 0 1 0 0 0 0 0
31 1887 0 3024 4596 6398 4459 0 0 0 0 0 0 1 0 0 0 0
32 2070 0 1887 3024 4596 6398 0 0 0 0 0 0 0 1 0 0 0
33 1351 0 2070 1887 3024 4596 0 0 0 0 0 0 0 0 1 0 0
34 2218 0 1351 2070 1887 3024 0 0 0 0 0 0 0 0 0 1 0
35 2461 1 2218 1351 2070 1887 0 0 0 0 0 0 0 0 0 0 1
36 3028 0 2461 2218 1351 2070 0 0 0 0 0 0 0 0 0 0 0
37 4784 0 3028 2461 2218 1351 1 0 0 0 0 0 0 0 0 0 0
38 4975 0 4784 3028 2461 2218 0 1 0 0 0 0 0 0 0 0 0
39 4607 0 4975 4784 3028 2461 0 0 1 0 0 0 0 0 0 0 0
40 6249 0 4607 4975 4784 3028 0 0 0 1 0 0 0 0 0 0 0
41 4809 0 6249 4607 4975 4784 0 0 0 0 1 0 0 0 0 0 0
42 3157 0 4809 6249 4607 4975 0 0 0 0 0 1 0 0 0 0 0
43 1910 0 3157 4809 6249 4607 0 0 0 0 0 0 1 0 0 0 0
44 2228 0 1910 3157 4809 6249 0 0 0 0 0 0 0 1 0 0 0
45 1594 0 2228 1910 3157 4809 0 0 0 0 0 0 0 0 1 0 0
46 2467 0 1594 2228 1910 3157 0 0 0 0 0 0 0 0 0 1 0
47 2222 0 2467 1594 2228 1910 0 0 0 0 0 0 0 0 0 0 1
48 3607 1 2222 2467 1594 2228 0 0 0 0 0 0 0 0 0 0 0
49 4685 0 3607 2222 2467 1594 1 0 0 0 0 0 0 0 0 0 0
50 4962 0 4685 3607 2222 2467 0 1 0 0 0 0 0 0 0 0 0
51 5770 0 4962 4685 3607 2222 0 0 1 0 0 0 0 0 0 0 0
52 5480 0 5770 4962 4685 3607 0 0 0 1 0 0 0 0 0 0 0
53 5000 0 5480 5770 4962 4685 0 0 0 0 1 0 0 0 0 0 0
54 3228 0 5000 5480 5770 4962 0 0 0 0 0 1 0 0 0 0 0
55 1993 0 3228 5000 5480 5770 0 0 0 0 0 0 1 0 0 0 0
56 2288 0 1993 3228 5000 5480 0 0 0 0 0 0 0 1 0 0 0
57 1580 0 2288 1993 3228 5000 0 0 0 0 0 0 0 0 1 0 0
58 2111 0 1580 2288 1993 3228 0 0 0 0 0 0 0 0 0 1 0
59 2192 0 2111 1580 2288 1993 0 0 0 0 0 0 0 0 0 0 1
60 3601 0 2192 2111 1580 2288 0 0 0 0 0 0 0 0 0 0 0
61 4665 1 3601 2192 2111 1580 1 0 0 0 0 0 0 0 0 0 0
62 4876 0 4665 3601 2192 2111 0 1 0 0 0 0 0 0 0 0 0
63 5813 0 4876 4665 3601 2192 0 0 1 0 0 0 0 0 0 0 0
64 5589 0 5813 4876 4665 3601 0 0 0 1 0 0 0 0 0 0 0
65 5331 0 5589 5813 4876 4665 0 0 0 0 1 0 0 0 0 0 0
66 3075 0 5331 5589 5813 4876 0 0 0 0 0 1 0 0 0 0 0
67 2002 0 3075 5331 5589 5813 0 0 0 0 0 0 1 0 0 0 0
68 2306 0 2002 3075 5331 5589 0 0 0 0 0 0 0 1 0 0 0
69 1507 0 2306 2002 3075 5331 0 0 0 0 0 0 0 0 1 0 0
70 1992 0 1507 2306 2002 3075 0 0 0 0 0 0 0 0 0 1 0
71 2487 0 1992 1507 2306 2002 0 0 0 0 0 0 0 0 0 0 1
72 3490 0 2487 1992 1507 2306 0 0 0 0 0 0 0 0 0 0 0
73 4647 0 3490 2487 1992 1507 1 0 0 0 0 0 0 0 0 0 0
74 5594 1 4647 3490 2487 1992 0 1 0 0 0 0 0 0 0 0 0
75 5611 0 5594 4647 3490 2487 0 0 1 0 0 0 0 0 0 0 0
76 5788 0 5611 5594 4647 3490 0 0 0 1 0 0 0 0 0 0 0
77 6204 0 5788 5611 5594 4647 0 0 0 0 1 0 0 0 0 0 0
78 3013 0 6204 5788 5611 5594 0 0 0 0 0 1 0 0 0 0 0
79 1931 0 3013 6204 5788 5611 0 0 0 0 0 0 1 0 0 0 0
80 2549 0 1931 3013 6204 5788 0 0 0 0 0 0 0 1 0 0 0
81 1504 0 2549 1931 3013 6204 0 0 0 0 0 0 0 0 1 0 0
82 2090 0 1504 2549 1931 3013 0 0 0 0 0 0 0 0 0 1 0
83 2702 0 2090 1504 2549 1931 0 0 0 0 0 0 0 0 0 0 1
84 2939 0 2702 2090 1504 2549 0 0 0 0 0 0 0 0 0 0 0
85 4500 0 2939 2702 2090 1504 1 0 0 0 0 0 0 0 0 0 0
86 6208 0 4500 2939 2702 2090 0 1 0 0 0 0 0 0 0 0 0
87 6415 1 6208 4500 2939 2702 0 0 1 0 0 0 0 0 0 0 0
88 5657 0 6415 6208 4500 2939 0 0 0 1 0 0 0 0 0 0 0
89 5964 0 5657 6415 6208 4500 0 0 0 0 1 0 0 0 0 0 0
90 3163 0 5964 5657 6415 6208 0 0 0 0 0 1 0 0 0 0 0
91 1997 0 3163 5964 5657 6415 0 0 0 0 0 0 1 0 0 0 0
92 2422 0 1997 3163 5964 5657 0 0 0 0 0 0 0 1 0 0 0
93 1376 0 2422 1997 3163 5964 0 0 0 0 0 0 0 0 1 0 0
94 2202 0 1376 2422 1997 3163 0 0 0 0 0 0 0 0 0 1 0
95 2683 0 2202 1376 2422 1997 0 0 0 0 0 0 0 0 0 0 1
96 3303 0 2683 2202 1376 2422 0 0 0 0 0 0 0 0 0 0 0
97 5202 0 3303 2683 2202 1376 1 0 0 0 0 0 0 0 0 0 0
98 5231 0 5202 3303 2683 2202 0 1 0 0 0 0 0 0 0 0 0
99 4880 0 5231 5202 3303 2683 0 0 1 0 0 0 0 0 0 0 0
100 7998 1 4880 5231 5202 3303 0 0 0 1 0 0 0 0 0 0 0
101 4977 0 7998 4880 5231 5202 0 0 0 0 1 0 0 0 0 0 0
102 3531 0 4977 7998 4880 5231 0 0 0 0 0 1 0 0 0 0 0
103 2025 0 3531 4977 7998 4880 0 0 0 0 0 0 1 0 0 0 0
104 2205 0 2025 3531 4977 7998 0 0 0 0 0 0 0 1 0 0 0
105 1442 0 2205 2025 3531 4977 0 0 0 0 0 0 0 0 1 0 0
106 2238 0 1442 2205 2025 3531 0 0 0 0 0 0 0 0 0 1 0
107 2179 0 2238 1442 2205 2025 0 0 0 0 0 0 0 0 0 0 1
108 3218 0 2179 2238 1442 2205 0 0 0 0 0 0 0 0 0 0 0
109 5139 0 3218 2179 2238 1442 1 0 0 0 0 0 0 0 0 0 0
110 4990 0 5139 3218 2179 2238 0 1 0 0 0 0 0 0 0 0 0
111 4914 0 4990 5139 3218 2179 0 0 1 0 0 0 0 0 0 0 0
112 6084 0 4914 4990 5139 3218 0 0 0 1 0 0 0 0 0 0 0
113 5672 1 6084 4914 4990 5139 0 0 0 0 1 0 0 0 0 0 0
114 3548 0 5672 6084 4914 4990 0 0 0 0 0 1 0 0 0 0 0
115 1793 0 3548 5672 6084 4914 0 0 0 0 0 0 1 0 0 0 0
116 2086 0 1793 3548 5672 6084 0 0 0 0 0 0 0 1 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 Y3 Y4
2.811e+03 5.367e+02 -2.707e-01 1.470e-01 3.823e-01 4.569e-02
M1 M2 M3 M4 M5 M6
1.482e+03 2.217e+03 1.849e+03 1.918e+03 1.196e+03 -1.358e+03
M7 M8 M9 M10 M11
-3.420e+03 -2.823e+03 -2.512e+03 -1.524e+03 -1.046e+03
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-679.71 -221.98 -23.83 170.52 1144.88
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.811e+03 3.913e+02 7.184 1.28e-10 ***
X 5.367e+02 1.244e+02 4.314 3.79e-05 ***
Y1 -2.707e-01 9.177e-02 -2.950 0.003965 **
Y2 1.470e-01 8.889e-02 1.653 0.101423
Y3 3.824e-01 8.934e-02 4.280 4.33e-05 ***
Y4 4.569e-02 9.288e-02 0.492 0.623833
M1 1.482e+03 2.114e+02 7.013 2.91e-10 ***
M2 2.217e+03 3.112e+02 7.123 1.72e-10 ***
M3 1.849e+03 4.493e+02 4.115 8.01e-05 ***
M4 1.918e+03 5.471e+02 3.505 0.000687 ***
M5 1.196e+03 6.320e+02 1.892 0.061418 .
M6 -1.358e+03 6.685e+02 -2.031 0.044931 *
M7 -3.420e+03 6.540e+02 -5.230 9.47e-07 ***
M8 -2.823e+03 6.044e+02 -4.671 9.46e-06 ***
M9 -2.512e+03 3.974e+02 -6.321 7.49e-09 ***
M10 -1.524e+03 2.219e+02 -6.869 5.78e-10 ***
M11 -1.046e+03 1.901e+02 -5.505 2.91e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 350.5 on 99 degrees of freedom
Multiple R-squared: 0.9602, Adjusted R-squared: 0.9538
F-statistic: 149.3 on 16 and 99 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.98798502 0.02402995 0.01201498
[2,] 0.97229500 0.05541000 0.02770500
[3,] 0.95602706 0.08794589 0.04397294
[4,] 0.92982221 0.14035558 0.07017779
[5,] 0.89630481 0.20739037 0.10369519
[6,] 0.86902431 0.26195139 0.13097569
[7,] 0.82152754 0.35694491 0.17847246
[8,] 0.84276278 0.31447445 0.15723722
[9,] 0.86055202 0.27889595 0.13944798
[10,] 0.90251552 0.19496897 0.09748448
[11,] 0.86819971 0.26360058 0.13180029
[12,] 0.85421694 0.29156613 0.14578306
[13,] 0.82925771 0.34148458 0.17074229
[14,] 0.77658309 0.44683382 0.22341691
[15,] 0.71864065 0.56271870 0.28135935
[16,] 0.68934521 0.62130958 0.31065479
[17,] 0.64242647 0.71514706 0.35757353
[18,] 0.58182636 0.83634728 0.41817364
[19,] 0.54965832 0.90068337 0.45034168
[20,] 0.70194363 0.59611273 0.29805637
[21,] 0.64157120 0.71685760 0.35842880
[22,] 0.61929651 0.76140698 0.38070349
[23,] 0.56122885 0.87754229 0.43877115
[24,] 0.52322275 0.95355450 0.47677725
[25,] 0.47289653 0.94579306 0.52710347
[26,] 0.41479810 0.82959619 0.58520190
[27,] 0.40958752 0.81917504 0.59041248
[28,] 0.35326375 0.70652750 0.64673625
[29,] 0.35529457 0.71058913 0.64470543
[30,] 0.30440512 0.60881023 0.69559488
[31,] 0.28980348 0.57960695 0.71019652
[32,] 0.27193981 0.54387962 0.72806019
[33,] 0.25970445 0.51940890 0.74029555
[34,] 0.33781500 0.67563001 0.66218500
[35,] 0.30444478 0.60888956 0.69555522
[36,] 0.32072841 0.64145683 0.67927159
[37,] 0.28114246 0.56228491 0.71885754
[38,] 0.23265404 0.46530808 0.76734596
[39,] 0.18947843 0.37895685 0.81052157
[40,] 0.16917283 0.33834565 0.83082717
[41,] 0.16453439 0.32906878 0.83546561
[42,] 0.23075587 0.46151175 0.76924413
[43,] 0.22334465 0.44668931 0.77665535
[44,] 0.21132251 0.42264502 0.78867749
[45,] 0.19368436 0.38736871 0.80631564
[46,] 0.16263546 0.32527091 0.83736454
[47,] 0.15880810 0.31761619 0.84119190
[48,] 0.13077466 0.26154932 0.86922534
[49,] 0.10057879 0.20115759 0.89942121
[50,] 0.07551357 0.15102714 0.92448643
[51,] 0.06030783 0.12061567 0.93969217
[52,] 0.04356768 0.08713536 0.95643232
[53,] 0.04170457 0.08340914 0.95829543
[54,] 0.03184032 0.06368064 0.96815968
[55,] 0.07415233 0.14830466 0.92584767
[56,] 0.09689509 0.19379019 0.90310491
[57,] 0.07681551 0.15363102 0.92318449
[58,] 0.18582527 0.37165054 0.81417473
[59,] 0.15261511 0.30523022 0.84738489
[60,] 0.11765108 0.23530215 0.88234892
[61,] 0.09388077 0.18776155 0.90611923
[62,] 0.07257241 0.14514482 0.92742759
[63,] 0.05210565 0.10421130 0.94789435
[64,] 0.03764049 0.07528099 0.96235951
[65,] 0.02853768 0.05707537 0.97146232
[66,] 0.04906132 0.09812264 0.95093868
[67,] 0.24737715 0.49475429 0.75262285
[68,] 0.49090429 0.98180858 0.50909571
[69,] 0.69239447 0.61521106 0.30760553
[70,] 0.95216023 0.09567953 0.04783977
[71,] 0.97293176 0.05413649 0.02706824
[72,] 0.98692501 0.02614998 0.01307499
[73,] 0.97623568 0.04752864 0.02376432
[74,] 0.95263099 0.09473802 0.04736901
[75,] 0.90025287 0.19949426 0.09974713
[76,] 0.97685581 0.04628838 0.02314419
[77,] 0.95758523 0.08482953 0.04241477
> postscript(file="/var/www/wessaorg/rcomp/tmp/1pj5o1293789345.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/www/wessaorg/rcomp/tmp/2dfhy1293789345.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/www/wessaorg/rcomp/tmp/330da1293789345.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/www/wessaorg/rcomp/tmp/4c9kz1293789345.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/www/wessaorg/rcomp/tmp/565tu1293789345.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 = 116
Frequency = 1
1 2 3 4 5 6
283.2064308 -168.5612069 744.3608111 -47.3616880 699.2726766 -315.4992693
7 8 9 10 11 12
-266.5945697 -238.8895040 -342.9152950 35.1062261 224.0722528 -218.9760817
13 14 15 16 17 18
-358.0174855 361.0864893 -473.4063243 -416.2536820 126.7044826 88.2842649
19 20 21 22 23 24
-89.3195857 85.5531157 -76.8284597 -514.2113014 -113.6671929 -389.8785563
25 26 27 28 29 30
-414.7138710 180.8738470 -514.9876032 295.8296330 -591.0246028 -76.3434078
31 32 33 34 35 36
-10.7782122 98.7772268 -31.3403310 132.5515718 -316.1914873 -54.0714176
37 38 39 40 41 42
38.6622204 -245.1629691 -679.7076768 68.6370177 -303.9214248 98.2326921
43 44 45 46 47 48
67.1313156 168.8255779 190.4704488 409.2473268 -48.3013535 -213.1562511
49 50 51 52 53 54
25.2364009 -290.0599590 283.8654918 -372.1918332 -482.5515732 -110.1100295
55 56 57 58 59 60
382.1631205 202.9727976 144.6415681 5.6595994 -199.3590922 364.3079038
61 62 63 64 65 66
-391.8767194 -352.8550659 310.1865973 -230.9894878 -94.5655027 -202.0276471
67 68 69 70 71 72
257.4521054 114.3587543 118.5660608 -132.1994039 66.8588516 377.7533999
73 74 75 76 77 78
102.2027045 -267.4218421 334.1807529 -180.2498019 588.2970371 -12.4978562
79 80 81 82 83 84
-25.4968667 4.3670643 175.6036984 -40.7461889 219.1660085 -139.3985367
85 86 87 88 89 90
-262.9045370 837.7320894 990.2129142 -102.4365060 -33.3786068 -243.6842544
91 92 93 94 95 96
129.7355212 -29.0610430 -42.8650936 23.1760277 294.8429873 257.7401898
97 98 99 100 101 102
503.4618504 -0.5626393 -514.1232985 1144.8830939 180.4906258 144.5833217
103 104 105 106 107 108
-422.5035538 -22.1620061 -135.3325968 81.4161424 -127.4209743 15.6793499
109 110 111 112 113 114
474.7430058 -55.0687433 -480.5816646 -159.8667456 -89.3231118 629.0621857
115 116
-21.7892745 -384.7419834
> postscript(file="/var/www/wessaorg/rcomp/tmp/67ydo1293789345.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 = 116
Frequency = 1
lag(myerror, k = 1) myerror
0 283.2064308 NA
1 -168.5612069 283.2064308
2 744.3608111 -168.5612069
3 -47.3616880 744.3608111
4 699.2726766 -47.3616880
5 -315.4992693 699.2726766
6 -266.5945697 -315.4992693
7 -238.8895040 -266.5945697
8 -342.9152950 -238.8895040
9 35.1062261 -342.9152950
10 224.0722528 35.1062261
11 -218.9760817 224.0722528
12 -358.0174855 -218.9760817
13 361.0864893 -358.0174855
14 -473.4063243 361.0864893
15 -416.2536820 -473.4063243
16 126.7044826 -416.2536820
17 88.2842649 126.7044826
18 -89.3195857 88.2842649
19 85.5531157 -89.3195857
20 -76.8284597 85.5531157
21 -514.2113014 -76.8284597
22 -113.6671929 -514.2113014
23 -389.8785563 -113.6671929
24 -414.7138710 -389.8785563
25 180.8738470 -414.7138710
26 -514.9876032 180.8738470
27 295.8296330 -514.9876032
28 -591.0246028 295.8296330
29 -76.3434078 -591.0246028
30 -10.7782122 -76.3434078
31 98.7772268 -10.7782122
32 -31.3403310 98.7772268
33 132.5515718 -31.3403310
34 -316.1914873 132.5515718
35 -54.0714176 -316.1914873
36 38.6622204 -54.0714176
37 -245.1629691 38.6622204
38 -679.7076768 -245.1629691
39 68.6370177 -679.7076768
40 -303.9214248 68.6370177
41 98.2326921 -303.9214248
42 67.1313156 98.2326921
43 168.8255779 67.1313156
44 190.4704488 168.8255779
45 409.2473268 190.4704488
46 -48.3013535 409.2473268
47 -213.1562511 -48.3013535
48 25.2364009 -213.1562511
49 -290.0599590 25.2364009
50 283.8654918 -290.0599590
51 -372.1918332 283.8654918
52 -482.5515732 -372.1918332
53 -110.1100295 -482.5515732
54 382.1631205 -110.1100295
55 202.9727976 382.1631205
56 144.6415681 202.9727976
57 5.6595994 144.6415681
58 -199.3590922 5.6595994
59 364.3079038 -199.3590922
60 -391.8767194 364.3079038
61 -352.8550659 -391.8767194
62 310.1865973 -352.8550659
63 -230.9894878 310.1865973
64 -94.5655027 -230.9894878
65 -202.0276471 -94.5655027
66 257.4521054 -202.0276471
67 114.3587543 257.4521054
68 118.5660608 114.3587543
69 -132.1994039 118.5660608
70 66.8588516 -132.1994039
71 377.7533999 66.8588516
72 102.2027045 377.7533999
73 -267.4218421 102.2027045
74 334.1807529 -267.4218421
75 -180.2498019 334.1807529
76 588.2970371 -180.2498019
77 -12.4978562 588.2970371
78 -25.4968667 -12.4978562
79 4.3670643 -25.4968667
80 175.6036984 4.3670643
81 -40.7461889 175.6036984
82 219.1660085 -40.7461889
83 -139.3985367 219.1660085
84 -262.9045370 -139.3985367
85 837.7320894 -262.9045370
86 990.2129142 837.7320894
87 -102.4365060 990.2129142
88 -33.3786068 -102.4365060
89 -243.6842544 -33.3786068
90 129.7355212 -243.6842544
91 -29.0610430 129.7355212
92 -42.8650936 -29.0610430
93 23.1760277 -42.8650936
94 294.8429873 23.1760277
95 257.7401898 294.8429873
96 503.4618504 257.7401898
97 -0.5626393 503.4618504
98 -514.1232985 -0.5626393
99 1144.8830939 -514.1232985
100 180.4906258 1144.8830939
101 144.5833217 180.4906258
102 -422.5035538 144.5833217
103 -22.1620061 -422.5035538
104 -135.3325968 -22.1620061
105 81.4161424 -135.3325968
106 -127.4209743 81.4161424
107 15.6793499 -127.4209743
108 474.7430058 15.6793499
109 -55.0687433 474.7430058
110 -480.5816646 -55.0687433
111 -159.8667456 -480.5816646
112 -89.3231118 -159.8667456
113 629.0621857 -89.3231118
114 -21.7892745 629.0621857
115 -384.7419834 -21.7892745
116 NA -384.7419834
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -168.5612069 283.2064308
[2,] 744.3608111 -168.5612069
[3,] -47.3616880 744.3608111
[4,] 699.2726766 -47.3616880
[5,] -315.4992693 699.2726766
[6,] -266.5945697 -315.4992693
[7,] -238.8895040 -266.5945697
[8,] -342.9152950 -238.8895040
[9,] 35.1062261 -342.9152950
[10,] 224.0722528 35.1062261
[11,] -218.9760817 224.0722528
[12,] -358.0174855 -218.9760817
[13,] 361.0864893 -358.0174855
[14,] -473.4063243 361.0864893
[15,] -416.2536820 -473.4063243
[16,] 126.7044826 -416.2536820
[17,] 88.2842649 126.7044826
[18,] -89.3195857 88.2842649
[19,] 85.5531157 -89.3195857
[20,] -76.8284597 85.5531157
[21,] -514.2113014 -76.8284597
[22,] -113.6671929 -514.2113014
[23,] -389.8785563 -113.6671929
[24,] -414.7138710 -389.8785563
[25,] 180.8738470 -414.7138710
[26,] -514.9876032 180.8738470
[27,] 295.8296330 -514.9876032
[28,] -591.0246028 295.8296330
[29,] -76.3434078 -591.0246028
[30,] -10.7782122 -76.3434078
[31,] 98.7772268 -10.7782122
[32,] -31.3403310 98.7772268
[33,] 132.5515718 -31.3403310
[34,] -316.1914873 132.5515718
[35,] -54.0714176 -316.1914873
[36,] 38.6622204 -54.0714176
[37,] -245.1629691 38.6622204
[38,] -679.7076768 -245.1629691
[39,] 68.6370177 -679.7076768
[40,] -303.9214248 68.6370177
[41,] 98.2326921 -303.9214248
[42,] 67.1313156 98.2326921
[43,] 168.8255779 67.1313156
[44,] 190.4704488 168.8255779
[45,] 409.2473268 190.4704488
[46,] -48.3013535 409.2473268
[47,] -213.1562511 -48.3013535
[48,] 25.2364009 -213.1562511
[49,] -290.0599590 25.2364009
[50,] 283.8654918 -290.0599590
[51,] -372.1918332 283.8654918
[52,] -482.5515732 -372.1918332
[53,] -110.1100295 -482.5515732
[54,] 382.1631205 -110.1100295
[55,] 202.9727976 382.1631205
[56,] 144.6415681 202.9727976
[57,] 5.6595994 144.6415681
[58,] -199.3590922 5.6595994
[59,] 364.3079038 -199.3590922
[60,] -391.8767194 364.3079038
[61,] -352.8550659 -391.8767194
[62,] 310.1865973 -352.8550659
[63,] -230.9894878 310.1865973
[64,] -94.5655027 -230.9894878
[65,] -202.0276471 -94.5655027
[66,] 257.4521054 -202.0276471
[67,] 114.3587543 257.4521054
[68,] 118.5660608 114.3587543
[69,] -132.1994039 118.5660608
[70,] 66.8588516 -132.1994039
[71,] 377.7533999 66.8588516
[72,] 102.2027045 377.7533999
[73,] -267.4218421 102.2027045
[74,] 334.1807529 -267.4218421
[75,] -180.2498019 334.1807529
[76,] 588.2970371 -180.2498019
[77,] -12.4978562 588.2970371
[78,] -25.4968667 -12.4978562
[79,] 4.3670643 -25.4968667
[80,] 175.6036984 4.3670643
[81,] -40.7461889 175.6036984
[82,] 219.1660085 -40.7461889
[83,] -139.3985367 219.1660085
[84,] -262.9045370 -139.3985367
[85,] 837.7320894 -262.9045370
[86,] 990.2129142 837.7320894
[87,] -102.4365060 990.2129142
[88,] -33.3786068 -102.4365060
[89,] -243.6842544 -33.3786068
[90,] 129.7355212 -243.6842544
[91,] -29.0610430 129.7355212
[92,] -42.8650936 -29.0610430
[93,] 23.1760277 -42.8650936
[94,] 294.8429873 23.1760277
[95,] 257.7401898 294.8429873
[96,] 503.4618504 257.7401898
[97,] -0.5626393 503.4618504
[98,] -514.1232985 -0.5626393
[99,] 1144.8830939 -514.1232985
[100,] 180.4906258 1144.8830939
[101,] 144.5833217 180.4906258
[102,] -422.5035538 144.5833217
[103,] -22.1620061 -422.5035538
[104,] -135.3325968 -22.1620061
[105,] 81.4161424 -135.3325968
[106,] -127.4209743 81.4161424
[107,] 15.6793499 -127.4209743
[108,] 474.7430058 15.6793499
[109,] -55.0687433 474.7430058
[110,] -480.5816646 -55.0687433
[111,] -159.8667456 -480.5816646
[112,] -89.3231118 -159.8667456
[113,] 629.0621857 -89.3231118
[114,] -21.7892745 629.0621857
[115,] -384.7419834 -21.7892745
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -168.5612069 283.2064308
2 744.3608111 -168.5612069
3 -47.3616880 744.3608111
4 699.2726766 -47.3616880
5 -315.4992693 699.2726766
6 -266.5945697 -315.4992693
7 -238.8895040 -266.5945697
8 -342.9152950 -238.8895040
9 35.1062261 -342.9152950
10 224.0722528 35.1062261
11 -218.9760817 224.0722528
12 -358.0174855 -218.9760817
13 361.0864893 -358.0174855
14 -473.4063243 361.0864893
15 -416.2536820 -473.4063243
16 126.7044826 -416.2536820
17 88.2842649 126.7044826
18 -89.3195857 88.2842649
19 85.5531157 -89.3195857
20 -76.8284597 85.5531157
21 -514.2113014 -76.8284597
22 -113.6671929 -514.2113014
23 -389.8785563 -113.6671929
24 -414.7138710 -389.8785563
25 180.8738470 -414.7138710
26 -514.9876032 180.8738470
27 295.8296330 -514.9876032
28 -591.0246028 295.8296330
29 -76.3434078 -591.0246028
30 -10.7782122 -76.3434078
31 98.7772268 -10.7782122
32 -31.3403310 98.7772268
33 132.5515718 -31.3403310
34 -316.1914873 132.5515718
35 -54.0714176 -316.1914873
36 38.6622204 -54.0714176
37 -245.1629691 38.6622204
38 -679.7076768 -245.1629691
39 68.6370177 -679.7076768
40 -303.9214248 68.6370177
41 98.2326921 -303.9214248
42 67.1313156 98.2326921
43 168.8255779 67.1313156
44 190.4704488 168.8255779
45 409.2473268 190.4704488
46 -48.3013535 409.2473268
47 -213.1562511 -48.3013535
48 25.2364009 -213.1562511
49 -290.0599590 25.2364009
50 283.8654918 -290.0599590
51 -372.1918332 283.8654918
52 -482.5515732 -372.1918332
53 -110.1100295 -482.5515732
54 382.1631205 -110.1100295
55 202.9727976 382.1631205
56 144.6415681 202.9727976
57 5.6595994 144.6415681
58 -199.3590922 5.6595994
59 364.3079038 -199.3590922
60 -391.8767194 364.3079038
61 -352.8550659 -391.8767194
62 310.1865973 -352.8550659
63 -230.9894878 310.1865973
64 -94.5655027 -230.9894878
65 -202.0276471 -94.5655027
66 257.4521054 -202.0276471
67 114.3587543 257.4521054
68 118.5660608 114.3587543
69 -132.1994039 118.5660608
70 66.8588516 -132.1994039
71 377.7533999 66.8588516
72 102.2027045 377.7533999
73 -267.4218421 102.2027045
74 334.1807529 -267.4218421
75 -180.2498019 334.1807529
76 588.2970371 -180.2498019
77 -12.4978562 588.2970371
78 -25.4968667 -12.4978562
79 4.3670643 -25.4968667
80 175.6036984 4.3670643
81 -40.7461889 175.6036984
82 219.1660085 -40.7461889
83 -139.3985367 219.1660085
84 -262.9045370 -139.3985367
85 837.7320894 -262.9045370
86 990.2129142 837.7320894
87 -102.4365060 990.2129142
88 -33.3786068 -102.4365060
89 -243.6842544 -33.3786068
90 129.7355212 -243.6842544
91 -29.0610430 129.7355212
92 -42.8650936 -29.0610430
93 23.1760277 -42.8650936
94 294.8429873 23.1760277
95 257.7401898 294.8429873
96 503.4618504 257.7401898
97 -0.5626393 503.4618504
98 -514.1232985 -0.5626393
99 1144.8830939 -514.1232985
100 180.4906258 1144.8830939
101 144.5833217 180.4906258
102 -422.5035538 144.5833217
103 -22.1620061 -422.5035538
104 -135.3325968 -22.1620061
105 81.4161424 -135.3325968
106 -127.4209743 81.4161424
107 15.6793499 -127.4209743
108 474.7430058 15.6793499
109 -55.0687433 474.7430058
110 -480.5816646 -55.0687433
111 -159.8667456 -480.5816646
112 -89.3231118 -159.8667456
113 629.0621857 -89.3231118
114 -21.7892745 629.0621857
115 -384.7419834 -21.7892745
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/wessaorg/rcomp/tmp/7pwco1293789345.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/www/wessaorg/rcomp/tmp/8pspo1293789345.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/www/wessaorg/rcomp/tmp/9keh91293789345.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/www/wessaorg/rcomp/tmp/10igpx1293789345.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/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/www/wessaorg/rcomp/tmp/112bxm1293789345.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/wessaorg/rcomp/tmp/12vkgj1293789345.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/wessaorg/rcomp/tmp/134gid1293789345.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/wessaorg/rcomp/tmp/14zeve1293789345.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/wessaorg/rcomp/tmp/15jlvo1293789345.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/wessaorg/rcomp/tmp/161g2y1293789345.tab")
+ }
>
> try(system("convert tmp/1pj5o1293789345.ps tmp/1pj5o1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dfhy1293789345.ps tmp/2dfhy1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/330da1293789345.ps tmp/330da1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/4c9kz1293789345.ps tmp/4c9kz1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/565tu1293789345.ps tmp/565tu1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/67ydo1293789345.ps tmp/67ydo1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/7pwco1293789345.ps tmp/7pwco1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/8pspo1293789345.ps tmp/8pspo1293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/9keh91293789345.ps tmp/9keh91293789345.png",intern=TRUE))
character(0)
> try(system("convert tmp/10igpx1293789345.ps tmp/10igpx1293789345.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.320 0.330 4.857