R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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.1
+ ,4.5
+ ,1.0
+ ,-1.0
+ ,1989.3
+ ,9.0
+ ,4.3
+ ,1.0
+ ,3.0
+ ,2097.8
+ ,9.0
+ ,4.3
+ ,1.3
+ ,2.0
+ ,2154.9
+ ,8.9
+ ,4.2
+ ,1.1
+ ,3.0
+ ,2152.2
+ ,8.8
+ ,4.0
+ ,0.8
+ ,5.0
+ ,2250.3
+ ,8.7
+ ,3.8
+ ,0.7
+ ,5.0
+ ,2346.9
+ ,8.5
+ ,4.1
+ ,0.7
+ ,3.0
+ ,2525.6
+ ,8.3
+ ,4.2
+ ,0.9
+ ,2.0
+ ,2409.4
+ ,8.1
+ ,4.0
+ ,1.3
+ ,1.0
+ ,2394.4
+ ,7.9
+ ,4.3
+ ,1.4
+ ,-4.0
+ ,2401.3
+ ,7.8
+ ,4.7
+ ,1.6
+ ,1.0
+ ,2354.3
+ ,7.6
+ ,5.0
+ ,2.1
+ ,1.0
+ ,2450.4
+ ,7.4
+ ,5.1
+ ,0.3
+ ,6.0
+ ,2504.7
+ ,7.2
+ ,5.4
+ ,2.1
+ ,3.0
+ ,2661.4
+ ,7.0
+ ,5.4
+ ,2.5
+ ,2.0
+ ,2880.4
+ ,7.0
+ ,5.4
+ ,2.3
+ ,2.0
+ ,3064.4
+ ,6.8
+ ,5.5
+ ,2.4
+ ,2.0
+ ,3141.1
+ ,6.8
+ ,5.8
+ ,3.0
+ ,-8.0
+ ,3327.7
+ ,6.7
+ ,5.7
+ ,1.7
+ ,0.0
+ ,3565.0
+ ,6.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
+ ,2197.8)
+ ,dim=c(5
+ ,142)
+ ,dimnames=list(c('Werkloosheid'
+ ,'rente'
+ ,'inflatie'
+ ,'consumer'
+ ,'Bel20')
+ ,1:142))
> y <- array(NA,dim=c(5,142),dimnames=list(c('Werkloosheid','rente','inflatie','consumer','Bel20'),1:142))
> 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'
> #'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
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Werkloosheid rente inflatie consumer Bel20
1 9.1 4.5 1.0 -1 1989.3
2 9.0 4.3 1.0 3 2097.8
3 9.0 4.3 1.3 2 2154.9
4 8.9 4.2 1.1 3 2152.2
5 8.8 4.0 0.8 5 2250.3
6 8.7 3.8 0.7 5 2346.9
7 8.5 4.1 0.7 3 2525.6
8 8.3 4.2 0.9 2 2409.4
9 8.1 4.0 1.3 1 2394.4
10 7.9 4.3 1.4 -4 2401.3
11 7.8 4.7 1.6 1 2354.3
12 7.6 5.0 2.1 1 2450.4
13 7.4 5.1 0.3 6 2504.7
14 7.2 5.4 2.1 3 2661.4
15 7.0 5.4 2.5 2 2880.4
16 7.0 5.4 2.3 2 3064.4
17 6.8 5.5 2.4 2 3141.1
18 6.8 5.8 3.0 -8 3327.7
19 6.7 5.7 1.7 0 3565.0
20 6.8 5.5 3.5 -2 3403.1
21 6.7 5.6 4.0 3 3149.9
22 6.7 5.6 3.7 5 3006.8
23 6.7 5.5 3.7 8 3230.7
24 6.5 5.5 3.0 8 3361.1
25 6.3 5.7 2.7 9 3484.7
26 6.3 5.6 2.5 11 3411.1
27 6.3 5.6 2.2 13 3288.2
28 6.5 5.4 2.9 12 3280.4
29 6.6 5.2 3.1 13 3174.0
30 6.5 5.1 3.0 15 3165.3
31 6.3 5.1 2.8 13 3092.7
32 6.3 5.0 2.5 16 3053.1
33 6.5 5.3 1.9 10 3182.0
34 7.0 5.4 1.9 14 2999.9
35 7.1 5.3 1.8 14 3249.6
36 7.3 5.1 2.0 15 3210.5
37 7.3 5.0 2.6 13 3030.3
38 7.4 5.0 2.5 8 2803.5
39 7.4 4.6 2.5 7 2767.6
40 7.3 4.8 1.6 3 2882.6
41 7.4 5.1 1.4 3 2863.4
42 7.5 5.1 0.8 4 2897.1
43 7.7 5.1 1.1 4 3012.6
44 7.7 5.4 1.3 0 3143.0
45 7.7 5.3 1.2 -4 3032.9
46 7.7 5.3 1.3 -14 3045.8
47 7.7 5.1 1.1 -18 3110.5
48 7.8 4.9 1.3 -8 3013.2
49 8.0 4.7 1.2 -1 2987.1
50 8.1 4.4 1.6 1 2995.6
51 8.1 4.6 1.7 2 2833.2
52 8.2 4.5 1.5 0 2849.0
53 8.2 4.2 0.9 1 2794.8
54 8.2 4.0 1.5 0 2845.3
55 8.1 3.9 1.4 -1 2915.0
56 8.1 4.1 1.6 -3 2892.6
57 8.2 4.1 1.7 -3 2604.4
58 8.3 3.7 1.4 -3 2641.7
59 8.3 3.8 1.8 -4 2659.8
60 8.4 4.1 1.7 -8 2638.5
61 8.5 4.1 1.4 -9 2720.3
62 8.5 4.0 1.2 -13 2745.9
63 8.4 4.3 1.0 -18 2735.7
64 8.0 4.4 1.7 -11 2811.7
65 7.9 4.2 2.4 -9 2799.4
66 8.1 4.2 2.0 -10 2555.3
67 8.5 4.0 2.1 -13 2305.0
68 8.8 4.0 2.0 -11 2215.0
69 8.8 4.3 1.8 -5 2065.8
70 8.6 4.4 2.7 -15 1940.5
71 8.3 4.4 2.3 -6 2042.0
72 8.3 4.3 1.9 -6 1995.4
73 8.3 4.1 2.0 -3 1946.8
74 8.4 4.1 2.3 -1 1765.9
75 8.4 3.9 2.8 -3 1635.3
76 8.5 3.8 2.4 -4 1833.4
77 8.6 3.7 2.3 -6 1910.4
78 8.6 3.5 2.7 0 1959.7
79 8.6 3.7 2.7 -4 1969.6
80 8.6 3.7 2.9 -2 2061.4
81 8.6 3.5 3.0 -2 2093.5
82 8.5 3.3 2.2 -6 2120.9
83 8.4 3.2 2.3 -7 2174.6
84 8.4 3.3 2.8 -6 2196.7
85 8.4 3.1 2.8 -6 2350.4
86 8.5 3.2 2.8 -3 2440.3
87 8.5 3.4 2.2 -2 2408.6
88 8.6 3.5 2.6 -5 2472.8
89 8.6 3.3 2.8 -11 2407.6
90 8.4 3.5 2.5 -11 2454.6
91 8.2 3.5 2.4 -11 2448.1
92 8.0 3.8 2.3 -10 2497.8
93 8.0 4.0 1.9 -14 2645.6
94 8.0 4.0 1.7 -8 2756.8
95 8.0 4.1 2.0 -9 2849.3
96 7.9 4.0 2.1 -5 2921.4
97 7.9 3.8 1.7 -1 2981.9
98 7.8 3.7 1.8 -2 3080.6
99 7.8 3.8 1.8 -5 3106.2
100 8.0 3.7 1.8 -4 3119.3
101 7.8 4.0 1.3 -6 3061.3
102 7.4 4.2 1.3 -2 3097.3
103 7.2 4.0 1.3 -2 3161.7
104 7.0 4.1 1.2 -2 3257.2
105 7.0 4.2 1.4 -2 3277.0
106 7.2 4.5 2.2 2 3295.3
107 7.2 4.6 2.9 1 3364.0
108 7.2 4.5 3.1 -8 3494.2
109 7.0 4.5 3.5 -1 3667.0
110 6.9 4.5 3.6 1 3813.1
111 6.8 4.4 4.4 -1 3918.0
112 6.8 4.3 4.1 2 3895.5
113 6.8 4.5 5.1 2 3801.1
114 6.9 4.1 5.8 1 3570.1
115 7.2 4.1 5.9 -1 3701.6
116 7.2 4.3 5.4 -2 3862.3
117 7.2 4.4 5.5 -2 3970.1
118 7.1 4.7 4.8 -1 4138.5
119 7.2 5.0 3.2 -8 4199.8
120 7.3 4.7 2.7 -4 4290.9
121 7.5 4.5 2.1 -6 4443.9
122 7.6 4.5 1.9 -3 4502.6
123 7.7 4.5 0.6 -3 4357.0
124 7.7 5.5 0.7 -7 4591.3
125 7.7 4.5 -0.2 -9 4697.0
126 7.8 4.4 -1.0 -11 4621.4
127 8.0 4.2 -1.7 -13 4562.8
128 8.1 3.9 -0.7 -11 4202.5
129 8.1 3.9 -1.0 -9 4296.5
130 8.0 4.2 -0.9 -17 4435.2
131 8.1 4.0 0.0 -22 4105.2
132 8.2 3.8 0.3 -25 4116.7
133 8.3 3.7 0.8 -20 3844.5
134 8.4 3.7 0.8 -24 3721.0
135 8.4 3.7 1.9 -24 3674.4
136 8.4 3.7 2.1 -22 3857.6
137 8.5 3.7 2.5 -19 3801.1
138 8.5 3.8 2.7 -18 3504.4
139 8.6 3.7 2.4 -17 3032.6
140 8.6 3.5 2.4 -11 3047.0
141 8.5 3.5 2.9 -11 2962.3
142 8.5 3.1 3.1 -12 2197.8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) rente inflatie consumer Bel20
11.3640292 -0.4607103 -0.1630704 -0.0260913 -0.0004335
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.91975 -0.16950 -0.03403 0.19636 0.81526
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.136e+01 2.214e-01 51.330 < 2e-16 ***
rente -4.607e-01 5.196e-02 -8.867 3.57e-15 ***
inflatie -1.631e-01 2.196e-02 -7.425 1.08e-11 ***
consumer -2.609e-02 4.013e-03 -6.502 1.37e-09 ***
Bel20 -4.335e-04 4.177e-05 -10.377 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3096 on 137 degrees of freedom
Multiple R-squared: 0.8172, Adjusted R-squared: 0.8119
F-statistic: 153.1 on 4 and 137 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.20629972 4.125994e-01 7.937003e-01
[2,] 0.15397083 3.079417e-01 8.460292e-01
[3,] 0.07474891 1.494978e-01 9.252511e-01
[4,] 0.15292426 3.058485e-01 8.470757e-01
[5,] 0.11169503 2.233901e-01 8.883050e-01
[6,] 0.25993349 5.198670e-01 7.400665e-01
[7,] 0.30837260 6.167452e-01 6.916274e-01
[8,] 0.40708786 8.141757e-01 5.929121e-01
[9,] 0.61171248 7.765750e-01 3.882875e-01
[10,] 0.61829190 7.634162e-01 3.817081e-01
[11,] 0.80736484 3.852703e-01 1.926352e-01
[12,] 0.84428377 3.114325e-01 1.557162e-01
[13,] 0.82179172 3.564166e-01 1.782083e-01
[14,] 0.76968970 4.606206e-01 2.303103e-01
[15,] 0.71538689 5.692262e-01 2.846131e-01
[16,] 0.65875730 6.824854e-01 3.412427e-01
[17,] 0.59799326 8.040135e-01 4.020067e-01
[18,] 0.54198292 9.160342e-01 4.580171e-01
[19,] 0.49513379 9.902676e-01 5.048662e-01
[20,] 0.46302796 9.260559e-01 5.369720e-01
[21,] 0.40644817 8.128963e-01 5.935518e-01
[22,] 0.35892560 7.178512e-01 6.410744e-01
[23,] 0.33952547 6.790509e-01 6.604745e-01
[24,] 0.49287008 9.857402e-01 5.071299e-01
[25,] 0.62562224 7.487555e-01 3.743778e-01
[26,] 0.65055549 6.988890e-01 3.494445e-01
[27,] 0.66109355 6.778129e-01 3.389064e-01
[28,] 0.76047275 4.790545e-01 2.395272e-01
[29,] 0.85362297 2.927541e-01 1.463770e-01
[30,] 0.86226661 2.754668e-01 1.377334e-01
[31,] 0.83321658 3.335668e-01 1.667834e-01
[32,] 0.80570902 3.885820e-01 1.942910e-01
[33,] 0.80316494 3.936701e-01 1.968351e-01
[34,] 0.76818068 4.636386e-01 2.318193e-01
[35,] 0.72751719 5.449656e-01 2.724828e-01
[36,] 0.73759595 5.248081e-01 2.624040e-01
[37,] 0.79302938 4.139412e-01 2.069706e-01
[38,] 0.76551642 4.689672e-01 2.344836e-01
[39,] 0.73309908 5.338018e-01 2.669009e-01
[40,] 0.74126611 5.174678e-01 2.587339e-01
[41,] 0.70184908 5.963018e-01 2.981509e-01
[42,] 0.68890767 6.221847e-01 3.110923e-01
[43,] 0.70285816 5.942837e-01 2.971418e-01
[44,] 0.72451923 5.509615e-01 2.754808e-01
[45,] 0.73793636 5.241273e-01 2.620636e-01
[46,] 0.71405457 5.718909e-01 2.859454e-01
[47,] 0.68987588 6.202482e-01 3.101241e-01
[48,] 0.66131242 6.773752e-01 3.386876e-01
[49,] 0.62200887 7.559823e-01 3.779911e-01
[50,] 0.58895647 8.220871e-01 4.110435e-01
[51,] 0.57367154 8.526569e-01 4.263285e-01
[52,] 0.53801883 9.239623e-01 4.619812e-01
[53,] 0.49802503 9.960501e-01 5.019750e-01
[54,] 0.46884368 9.376874e-01 5.311563e-01
[55,] 0.42564811 8.512962e-01 5.743519e-01
[56,] 0.39884561 7.976912e-01 6.011544e-01
[57,] 0.36870710 7.374142e-01 6.312929e-01
[58,] 0.34152608 6.830522e-01 6.584739e-01
[59,] 0.32537532 6.507506e-01 6.746247e-01
[60,] 0.29069771 5.813954e-01 7.093023e-01
[61,] 0.27318262 5.463652e-01 7.268174e-01
[62,] 0.32327860 6.465572e-01 6.767214e-01
[63,] 0.28444585 5.688917e-01 7.155542e-01
[64,] 0.25890140 5.178028e-01 7.410986e-01
[65,] 0.25276275 5.055255e-01 7.472372e-01
[66,] 0.25034287 5.006857e-01 7.496571e-01
[67,] 0.24402898 4.880580e-01 7.559710e-01
[68,] 0.23300999 4.660200e-01 7.669900e-01
[69,] 0.21895984 4.379197e-01 7.810402e-01
[70,] 0.20465362 4.093072e-01 7.953464e-01
[71,] 0.21611658 4.322332e-01 7.838834e-01
[72,] 0.22936309 4.587262e-01 7.706369e-01
[73,] 0.30178759 6.035752e-01 6.982124e-01
[74,] 0.36497393 7.299479e-01 6.350261e-01
[75,] 0.36601023 7.320205e-01 6.339898e-01
[76,] 0.37155401 7.431080e-01 6.284460e-01
[77,] 0.33986746 6.797349e-01 6.601325e-01
[78,] 0.30125760 6.025152e-01 6.987424e-01
[79,] 0.30536602 6.107320e-01 6.946340e-01
[80,] 0.35351495 7.070299e-01 6.464851e-01
[81,] 0.48926977 9.785395e-01 5.107302e-01
[82,] 0.48837797 9.767559e-01 5.116220e-01
[83,] 0.46216220 9.243244e-01 5.378378e-01
[84,] 0.44225616 8.845123e-01 5.577438e-01
[85,] 0.42761630 8.552326e-01 5.723837e-01
[86,] 0.42066244 8.413249e-01 5.793376e-01
[87,] 0.38669484 7.733897e-01 6.133052e-01
[88,] 0.34741921 6.948384e-01 6.525808e-01
[89,] 0.31868083 6.373617e-01 6.813192e-01
[90,] 0.31273815 6.254763e-01 6.872618e-01
[91,] 0.28105797 5.621159e-01 7.189420e-01
[92,] 0.24300806 4.860161e-01 7.569919e-01
[93,] 0.23611046 4.722209e-01 7.638895e-01
[94,] 0.21056876 4.211375e-01 7.894312e-01
[95,] 0.20753068 4.150614e-01 7.924693e-01
[96,] 0.29032787 5.806557e-01 7.096721e-01
[97,] 0.52442511 9.511498e-01 4.755749e-01
[98,] 0.76604571 4.679086e-01 2.339543e-01
[99,] 0.73940251 5.211950e-01 2.605975e-01
[100,] 0.71249698 5.750060e-01 2.875030e-01
[101,] 0.80228586 3.954283e-01 1.977141e-01
[102,] 0.84770255 3.045949e-01 1.522975e-01
[103,] 0.88682630 2.263474e-01 1.131737e-01
[104,] 0.93204106 1.359179e-01 6.795894e-02
[105,] 0.96289920 7.420160e-02 3.710080e-02
[106,] 0.97956487 4.087027e-02 2.043513e-02
[107,] 0.99288171 1.423658e-02 7.118288e-03
[108,] 0.99293319 1.413363e-02 7.066813e-03
[109,] 0.99314614 1.370773e-02 6.853864e-03
[110,] 0.99296404 1.407192e-02 7.035962e-03
[111,] 0.99455891 1.088219e-02 5.441093e-03
[112,] 0.99855481 2.890380e-03 1.445190e-03
[113,] 0.99972055 5.588912e-04 2.794456e-04
[114,] 0.99991548 1.690454e-04 8.452272e-05
[115,] 0.99996373 7.253293e-05 3.626646e-05
[116,] 0.99997400 5.199183e-05 2.599591e-05
[117,] 0.99995337 9.326783e-05 4.663391e-05
[118,] 0.99998264 3.471011e-05 1.735506e-05
[119,] 0.99999449 1.101652e-05 5.508259e-06
[120,] 0.99997749 4.502443e-05 2.251221e-05
[121,] 0.99990734 1.853286e-04 9.266431e-05
[122,] 0.99973647 5.270524e-04 2.635262e-04
[123,] 0.99916230 1.675397e-03 8.376986e-04
[124,] 0.99952421 9.515783e-04 4.757891e-04
[125,] 0.99892288 2.154230e-03 1.077115e-03
[126,] 0.99840363 3.192740e-03 1.596370e-03
[127,] 0.99183530 1.632939e-02 8.164696e-03
> postscript(file="/var/www/html/rcomp/tmp/1yquq1293221989.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/html/rcomp/tmp/28zbb1293221989.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/html/rcomp/tmp/38zbb1293221989.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/html/rcomp/tmp/48zbb1293221989.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/html/rcomp/tmp/5j8se1293221989.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 = 142
Frequency = 1
1 2 3 4 5 6
0.808430273 0.767683793 0.815264282 0.661500086 0.515141951 0.348565181
7 8 9 10 11 12
0.312055216 0.114280900 -0.145226162 -0.318171476 -0.091189614 -0.029785706
13 14 15 16 17 18
-0.323248210 -0.101858791 -0.167793924 -0.120651189 -0.225026658 -0.169000139
19 20 21 22 23 24
-0.215472324 -0.036447456 0.011862795 -0.046904074 0.082350609 -0.175275385
25 26 27 28 29 30
-0.252387415 -0.310792731 -0.360803688 -0.168268699 -0.147825653 -0.261792306
31 32 33 34 35 36
-0.578058193 -0.611941613 -0.472245259 0.099257584 0.245114721 0.394729691
37 38 39 40 41 42
0.316208725 0.171136402 -0.054800228 -0.263938613 -0.066662065 -0.023805428
43 44 45 46 47 48
0.275180449 0.398165875 0.183698687 -0.055315275 -0.256391555 0.002817373
49 50 51 52 53 54
0.265693796 0.348575834 0.412722135 0.388703172 0.155245501 0.156744222
55 56 57 58 59 60
-0.001512885 0.061351204 0.052734790 -0.064302362 0.028751221 0.137059484
61 62 63 64 65 66
0.197504196 0.025550620 -0.103728009 -0.127925781 -0.159067571 -0.156194840
67 68 69 70 71 72
-0.018798936 0.278065061 0.475539271 0.153148381 0.066737883 -0.064760604
73 74 75 76 77 78
-0.083388026 0.039302543 -0.080096832 -0.031618679 -0.012802786 0.138200551
79 80 81 82 83 84
0.130268811 0.254857149 0.192936233 -0.222150406 -0.354728801 -0.191451799
85 86 87 88 89 90
-0.216970903 0.046342065 0.052992411 0.213846016 -0.030491202 -0.166897610
91 92 93 94 95 96
-0.386022150 -0.416481831 -0.429867475 -0.257733109 -0.148737072 -0.142883459
97 98 99 100 101 102
-0.169664241 -0.282736892 -0.303843057 -0.118144482 -0.338789883 -0.526678168
103 104 105 106 107 108
-0.790905338 -0.919745829 -0.832478184 -0.251511349 -0.087603508 -0.279445215
109 110 111 112 113 114
-0.156676123 -0.124857898 -0.147185048 -0.173656285 0.040637494 -0.055718068
115 116 117 118 119 120
0.265406566 0.319579320 0.428684487 0.451834363 0.273067049 0.297172100
121 122 123 124 125 126
0.321324780 0.492428648 0.317325157 0.791537339 0.177697952 0.016218390
127 128 129 130 131 132
-0.067656320 -0.046792432 -0.002785700 -0.096874652 -0.215751768 -0.232261688
133 134 135 136 137 138
-0.084329253 -0.142226746 0.016951455 0.181158127 0.400169552 0.376338057
139 140 141 142
0.202930266 0.273577638 0.218398712 -0.290743509
> postscript(file="/var/www/html/rcomp/tmp/6j8se1293221989.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 = 142
Frequency = 1
lag(myerror, k = 1) myerror
0 0.808430273 NA
1 0.767683793 0.808430273
2 0.815264282 0.767683793
3 0.661500086 0.815264282
4 0.515141951 0.661500086
5 0.348565181 0.515141951
6 0.312055216 0.348565181
7 0.114280900 0.312055216
8 -0.145226162 0.114280900
9 -0.318171476 -0.145226162
10 -0.091189614 -0.318171476
11 -0.029785706 -0.091189614
12 -0.323248210 -0.029785706
13 -0.101858791 -0.323248210
14 -0.167793924 -0.101858791
15 -0.120651189 -0.167793924
16 -0.225026658 -0.120651189
17 -0.169000139 -0.225026658
18 -0.215472324 -0.169000139
19 -0.036447456 -0.215472324
20 0.011862795 -0.036447456
21 -0.046904074 0.011862795
22 0.082350609 -0.046904074
23 -0.175275385 0.082350609
24 -0.252387415 -0.175275385
25 -0.310792731 -0.252387415
26 -0.360803688 -0.310792731
27 -0.168268699 -0.360803688
28 -0.147825653 -0.168268699
29 -0.261792306 -0.147825653
30 -0.578058193 -0.261792306
31 -0.611941613 -0.578058193
32 -0.472245259 -0.611941613
33 0.099257584 -0.472245259
34 0.245114721 0.099257584
35 0.394729691 0.245114721
36 0.316208725 0.394729691
37 0.171136402 0.316208725
38 -0.054800228 0.171136402
39 -0.263938613 -0.054800228
40 -0.066662065 -0.263938613
41 -0.023805428 -0.066662065
42 0.275180449 -0.023805428
43 0.398165875 0.275180449
44 0.183698687 0.398165875
45 -0.055315275 0.183698687
46 -0.256391555 -0.055315275
47 0.002817373 -0.256391555
48 0.265693796 0.002817373
49 0.348575834 0.265693796
50 0.412722135 0.348575834
51 0.388703172 0.412722135
52 0.155245501 0.388703172
53 0.156744222 0.155245501
54 -0.001512885 0.156744222
55 0.061351204 -0.001512885
56 0.052734790 0.061351204
57 -0.064302362 0.052734790
58 0.028751221 -0.064302362
59 0.137059484 0.028751221
60 0.197504196 0.137059484
61 0.025550620 0.197504196
62 -0.103728009 0.025550620
63 -0.127925781 -0.103728009
64 -0.159067571 -0.127925781
65 -0.156194840 -0.159067571
66 -0.018798936 -0.156194840
67 0.278065061 -0.018798936
68 0.475539271 0.278065061
69 0.153148381 0.475539271
70 0.066737883 0.153148381
71 -0.064760604 0.066737883
72 -0.083388026 -0.064760604
73 0.039302543 -0.083388026
74 -0.080096832 0.039302543
75 -0.031618679 -0.080096832
76 -0.012802786 -0.031618679
77 0.138200551 -0.012802786
78 0.130268811 0.138200551
79 0.254857149 0.130268811
80 0.192936233 0.254857149
81 -0.222150406 0.192936233
82 -0.354728801 -0.222150406
83 -0.191451799 -0.354728801
84 -0.216970903 -0.191451799
85 0.046342065 -0.216970903
86 0.052992411 0.046342065
87 0.213846016 0.052992411
88 -0.030491202 0.213846016
89 -0.166897610 -0.030491202
90 -0.386022150 -0.166897610
91 -0.416481831 -0.386022150
92 -0.429867475 -0.416481831
93 -0.257733109 -0.429867475
94 -0.148737072 -0.257733109
95 -0.142883459 -0.148737072
96 -0.169664241 -0.142883459
97 -0.282736892 -0.169664241
98 -0.303843057 -0.282736892
99 -0.118144482 -0.303843057
100 -0.338789883 -0.118144482
101 -0.526678168 -0.338789883
102 -0.790905338 -0.526678168
103 -0.919745829 -0.790905338
104 -0.832478184 -0.919745829
105 -0.251511349 -0.832478184
106 -0.087603508 -0.251511349
107 -0.279445215 -0.087603508
108 -0.156676123 -0.279445215
109 -0.124857898 -0.156676123
110 -0.147185048 -0.124857898
111 -0.173656285 -0.147185048
112 0.040637494 -0.173656285
113 -0.055718068 0.040637494
114 0.265406566 -0.055718068
115 0.319579320 0.265406566
116 0.428684487 0.319579320
117 0.451834363 0.428684487
118 0.273067049 0.451834363
119 0.297172100 0.273067049
120 0.321324780 0.297172100
121 0.492428648 0.321324780
122 0.317325157 0.492428648
123 0.791537339 0.317325157
124 0.177697952 0.791537339
125 0.016218390 0.177697952
126 -0.067656320 0.016218390
127 -0.046792432 -0.067656320
128 -0.002785700 -0.046792432
129 -0.096874652 -0.002785700
130 -0.215751768 -0.096874652
131 -0.232261688 -0.215751768
132 -0.084329253 -0.232261688
133 -0.142226746 -0.084329253
134 0.016951455 -0.142226746
135 0.181158127 0.016951455
136 0.400169552 0.181158127
137 0.376338057 0.400169552
138 0.202930266 0.376338057
139 0.273577638 0.202930266
140 0.218398712 0.273577638
141 -0.290743509 0.218398712
142 NA -0.290743509
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.767683793 0.808430273
[2,] 0.815264282 0.767683793
[3,] 0.661500086 0.815264282
[4,] 0.515141951 0.661500086
[5,] 0.348565181 0.515141951
[6,] 0.312055216 0.348565181
[7,] 0.114280900 0.312055216
[8,] -0.145226162 0.114280900
[9,] -0.318171476 -0.145226162
[10,] -0.091189614 -0.318171476
[11,] -0.029785706 -0.091189614
[12,] -0.323248210 -0.029785706
[13,] -0.101858791 -0.323248210
[14,] -0.167793924 -0.101858791
[15,] -0.120651189 -0.167793924
[16,] -0.225026658 -0.120651189
[17,] -0.169000139 -0.225026658
[18,] -0.215472324 -0.169000139
[19,] -0.036447456 -0.215472324
[20,] 0.011862795 -0.036447456
[21,] -0.046904074 0.011862795
[22,] 0.082350609 -0.046904074
[23,] -0.175275385 0.082350609
[24,] -0.252387415 -0.175275385
[25,] -0.310792731 -0.252387415
[26,] -0.360803688 -0.310792731
[27,] -0.168268699 -0.360803688
[28,] -0.147825653 -0.168268699
[29,] -0.261792306 -0.147825653
[30,] -0.578058193 -0.261792306
[31,] -0.611941613 -0.578058193
[32,] -0.472245259 -0.611941613
[33,] 0.099257584 -0.472245259
[34,] 0.245114721 0.099257584
[35,] 0.394729691 0.245114721
[36,] 0.316208725 0.394729691
[37,] 0.171136402 0.316208725
[38,] -0.054800228 0.171136402
[39,] -0.263938613 -0.054800228
[40,] -0.066662065 -0.263938613
[41,] -0.023805428 -0.066662065
[42,] 0.275180449 -0.023805428
[43,] 0.398165875 0.275180449
[44,] 0.183698687 0.398165875
[45,] -0.055315275 0.183698687
[46,] -0.256391555 -0.055315275
[47,] 0.002817373 -0.256391555
[48,] 0.265693796 0.002817373
[49,] 0.348575834 0.265693796
[50,] 0.412722135 0.348575834
[51,] 0.388703172 0.412722135
[52,] 0.155245501 0.388703172
[53,] 0.156744222 0.155245501
[54,] -0.001512885 0.156744222
[55,] 0.061351204 -0.001512885
[56,] 0.052734790 0.061351204
[57,] -0.064302362 0.052734790
[58,] 0.028751221 -0.064302362
[59,] 0.137059484 0.028751221
[60,] 0.197504196 0.137059484
[61,] 0.025550620 0.197504196
[62,] -0.103728009 0.025550620
[63,] -0.127925781 -0.103728009
[64,] -0.159067571 -0.127925781
[65,] -0.156194840 -0.159067571
[66,] -0.018798936 -0.156194840
[67,] 0.278065061 -0.018798936
[68,] 0.475539271 0.278065061
[69,] 0.153148381 0.475539271
[70,] 0.066737883 0.153148381
[71,] -0.064760604 0.066737883
[72,] -0.083388026 -0.064760604
[73,] 0.039302543 -0.083388026
[74,] -0.080096832 0.039302543
[75,] -0.031618679 -0.080096832
[76,] -0.012802786 -0.031618679
[77,] 0.138200551 -0.012802786
[78,] 0.130268811 0.138200551
[79,] 0.254857149 0.130268811
[80,] 0.192936233 0.254857149
[81,] -0.222150406 0.192936233
[82,] -0.354728801 -0.222150406
[83,] -0.191451799 -0.354728801
[84,] -0.216970903 -0.191451799
[85,] 0.046342065 -0.216970903
[86,] 0.052992411 0.046342065
[87,] 0.213846016 0.052992411
[88,] -0.030491202 0.213846016
[89,] -0.166897610 -0.030491202
[90,] -0.386022150 -0.166897610
[91,] -0.416481831 -0.386022150
[92,] -0.429867475 -0.416481831
[93,] -0.257733109 -0.429867475
[94,] -0.148737072 -0.257733109
[95,] -0.142883459 -0.148737072
[96,] -0.169664241 -0.142883459
[97,] -0.282736892 -0.169664241
[98,] -0.303843057 -0.282736892
[99,] -0.118144482 -0.303843057
[100,] -0.338789883 -0.118144482
[101,] -0.526678168 -0.338789883
[102,] -0.790905338 -0.526678168
[103,] -0.919745829 -0.790905338
[104,] -0.832478184 -0.919745829
[105,] -0.251511349 -0.832478184
[106,] -0.087603508 -0.251511349
[107,] -0.279445215 -0.087603508
[108,] -0.156676123 -0.279445215
[109,] -0.124857898 -0.156676123
[110,] -0.147185048 -0.124857898
[111,] -0.173656285 -0.147185048
[112,] 0.040637494 -0.173656285
[113,] -0.055718068 0.040637494
[114,] 0.265406566 -0.055718068
[115,] 0.319579320 0.265406566
[116,] 0.428684487 0.319579320
[117,] 0.451834363 0.428684487
[118,] 0.273067049 0.451834363
[119,] 0.297172100 0.273067049
[120,] 0.321324780 0.297172100
[121,] 0.492428648 0.321324780
[122,] 0.317325157 0.492428648
[123,] 0.791537339 0.317325157
[124,] 0.177697952 0.791537339
[125,] 0.016218390 0.177697952
[126,] -0.067656320 0.016218390
[127,] -0.046792432 -0.067656320
[128,] -0.002785700 -0.046792432
[129,] -0.096874652 -0.002785700
[130,] -0.215751768 -0.096874652
[131,] -0.232261688 -0.215751768
[132,] -0.084329253 -0.232261688
[133,] -0.142226746 -0.084329253
[134,] 0.016951455 -0.142226746
[135,] 0.181158127 0.016951455
[136,] 0.400169552 0.181158127
[137,] 0.376338057 0.400169552
[138,] 0.202930266 0.376338057
[139,] 0.273577638 0.202930266
[140,] 0.218398712 0.273577638
[141,] -0.290743509 0.218398712
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.767683793 0.808430273
2 0.815264282 0.767683793
3 0.661500086 0.815264282
4 0.515141951 0.661500086
5 0.348565181 0.515141951
6 0.312055216 0.348565181
7 0.114280900 0.312055216
8 -0.145226162 0.114280900
9 -0.318171476 -0.145226162
10 -0.091189614 -0.318171476
11 -0.029785706 -0.091189614
12 -0.323248210 -0.029785706
13 -0.101858791 -0.323248210
14 -0.167793924 -0.101858791
15 -0.120651189 -0.167793924
16 -0.225026658 -0.120651189
17 -0.169000139 -0.225026658
18 -0.215472324 -0.169000139
19 -0.036447456 -0.215472324
20 0.011862795 -0.036447456
21 -0.046904074 0.011862795
22 0.082350609 -0.046904074
23 -0.175275385 0.082350609
24 -0.252387415 -0.175275385
25 -0.310792731 -0.252387415
26 -0.360803688 -0.310792731
27 -0.168268699 -0.360803688
28 -0.147825653 -0.168268699
29 -0.261792306 -0.147825653
30 -0.578058193 -0.261792306
31 -0.611941613 -0.578058193
32 -0.472245259 -0.611941613
33 0.099257584 -0.472245259
34 0.245114721 0.099257584
35 0.394729691 0.245114721
36 0.316208725 0.394729691
37 0.171136402 0.316208725
38 -0.054800228 0.171136402
39 -0.263938613 -0.054800228
40 -0.066662065 -0.263938613
41 -0.023805428 -0.066662065
42 0.275180449 -0.023805428
43 0.398165875 0.275180449
44 0.183698687 0.398165875
45 -0.055315275 0.183698687
46 -0.256391555 -0.055315275
47 0.002817373 -0.256391555
48 0.265693796 0.002817373
49 0.348575834 0.265693796
50 0.412722135 0.348575834
51 0.388703172 0.412722135
52 0.155245501 0.388703172
53 0.156744222 0.155245501
54 -0.001512885 0.156744222
55 0.061351204 -0.001512885
56 0.052734790 0.061351204
57 -0.064302362 0.052734790
58 0.028751221 -0.064302362
59 0.137059484 0.028751221
60 0.197504196 0.137059484
61 0.025550620 0.197504196
62 -0.103728009 0.025550620
63 -0.127925781 -0.103728009
64 -0.159067571 -0.127925781
65 -0.156194840 -0.159067571
66 -0.018798936 -0.156194840
67 0.278065061 -0.018798936
68 0.475539271 0.278065061
69 0.153148381 0.475539271
70 0.066737883 0.153148381
71 -0.064760604 0.066737883
72 -0.083388026 -0.064760604
73 0.039302543 -0.083388026
74 -0.080096832 0.039302543
75 -0.031618679 -0.080096832
76 -0.012802786 -0.031618679
77 0.138200551 -0.012802786
78 0.130268811 0.138200551
79 0.254857149 0.130268811
80 0.192936233 0.254857149
81 -0.222150406 0.192936233
82 -0.354728801 -0.222150406
83 -0.191451799 -0.354728801
84 -0.216970903 -0.191451799
85 0.046342065 -0.216970903
86 0.052992411 0.046342065
87 0.213846016 0.052992411
88 -0.030491202 0.213846016
89 -0.166897610 -0.030491202
90 -0.386022150 -0.166897610
91 -0.416481831 -0.386022150
92 -0.429867475 -0.416481831
93 -0.257733109 -0.429867475
94 -0.148737072 -0.257733109
95 -0.142883459 -0.148737072
96 -0.169664241 -0.142883459
97 -0.282736892 -0.169664241
98 -0.303843057 -0.282736892
99 -0.118144482 -0.303843057
100 -0.338789883 -0.118144482
101 -0.526678168 -0.338789883
102 -0.790905338 -0.526678168
103 -0.919745829 -0.790905338
104 -0.832478184 -0.919745829
105 -0.251511349 -0.832478184
106 -0.087603508 -0.251511349
107 -0.279445215 -0.087603508
108 -0.156676123 -0.279445215
109 -0.124857898 -0.156676123
110 -0.147185048 -0.124857898
111 -0.173656285 -0.147185048
112 0.040637494 -0.173656285
113 -0.055718068 0.040637494
114 0.265406566 -0.055718068
115 0.319579320 0.265406566
116 0.428684487 0.319579320
117 0.451834363 0.428684487
118 0.273067049 0.451834363
119 0.297172100 0.273067049
120 0.321324780 0.297172100
121 0.492428648 0.321324780
122 0.317325157 0.492428648
123 0.791537339 0.317325157
124 0.177697952 0.791537339
125 0.016218390 0.177697952
126 -0.067656320 0.016218390
127 -0.046792432 -0.067656320
128 -0.002785700 -0.046792432
129 -0.096874652 -0.002785700
130 -0.215751768 -0.096874652
131 -0.232261688 -0.215751768
132 -0.084329253 -0.232261688
133 -0.142226746 -0.084329253
134 0.016951455 -0.142226746
135 0.181158127 0.016951455
136 0.400169552 0.181158127
137 0.376338057 0.400169552
138 0.202930266 0.376338057
139 0.273577638 0.202930266
140 0.218398712 0.273577638
141 -0.290743509 0.218398712
> 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/html/rcomp/tmp/7uzrh1293221989.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/html/rcomp/tmp/8uzrh1293221989.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/html/rcomp/tmp/9mr8k1293221989.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/html/rcomp/tmp/10mr8k1293221989.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/html/rcomp/tmp/1189pp1293221989.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/html/rcomp/tmp/12ts6d1293221989.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/html/rcomp/tmp/13ib371293221989.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/html/rcomp/tmp/14bk2s1293221989.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/html/rcomp/tmp/15e20g1293221989.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/html/rcomp/tmp/16h3h41293221989.tab")
+ }
>
> try(system("convert tmp/1yquq1293221989.ps tmp/1yquq1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/28zbb1293221989.ps tmp/28zbb1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/38zbb1293221989.ps tmp/38zbb1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/48zbb1293221989.ps tmp/48zbb1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/5j8se1293221989.ps tmp/5j8se1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/6j8se1293221989.ps tmp/6j8se1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/7uzrh1293221989.ps tmp/7uzrh1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/8uzrh1293221989.ps tmp/8uzrh1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/9mr8k1293221989.ps tmp/9mr8k1293221989.png",intern=TRUE))
character(0)
> try(system("convert tmp/10mr8k1293221989.ps tmp/10mr8k1293221989.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.688 1.715 9.370