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(2938,2909,3141,2427,3059,2918,2901,2823,2798,2892,2967,2397,3458,3024,3100,2904,3056,2771,2897,2772,2857,3020,2648,2364,3194,3013,2560,3074,2746,2846,3184,2354,3080,2963,2430,2296,2416,2647,2789,2685,2666,2882,2953,2127,2563,3061,2809,2861,2781,2555,3206,2570,2410,3195,2736,2743,2934,2668,2907,2866,2983,2878,3225,2515,3193,2663,2908,2896,2853,3028,3053,2455,3401,2969,3243,2849,3296,3121,3194,3023,2984,3525,3116,2383,3294,2882,2820,2583,2803,2767,2945,2716,2644,2956,2598,2171,2994,2645,2724,2550,2707,2679,2878,2307,2496,2637,2436,2426,2607,2533,2888,2520,2229,2804,2661,2547,2509,2465,2629,2706,2666,2432,2836,2888,2566,2802,2611,2683,2675,2434,2693,2619,2903,2550,2900,2456,2912,2883,2464,2655,2447,2592,2698,2274,2901,2397,3004,2614,2882,2671,2761,2806,2414,2673,2748,2112,2903,2633,2684,2861,2504,2708,2961,2535,2688,2699,2469,2585,2582,2480,2709,2441,2182,2585,2881,2422,2690,2659,2535,2613),dim=c(1,180),dimnames=list(c('Echtscheidingen'),1:180))
> y <- array(NA,dim=c(1,180),dimnames=list(c('Echtscheidingen'),1:180))
> 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
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
Echtscheidingen M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 2938 1 0 0 0 0 0 0 0 0 0 0
2 2909 0 1 0 0 0 0 0 0 0 0 0
3 3141 0 0 1 0 0 0 0 0 0 0 0
4 2427 0 0 0 1 0 0 0 0 0 0 0
5 3059 0 0 0 0 1 0 0 0 0 0 0
6 2918 0 0 0 0 0 1 0 0 0 0 0
7 2901 0 0 0 0 0 0 1 0 0 0 0
8 2823 0 0 0 0 0 0 0 1 0 0 0
9 2798 0 0 0 0 0 0 0 0 1 0 0
10 2892 0 0 0 0 0 0 0 0 0 1 0
11 2967 0 0 0 0 0 0 0 0 0 0 1
12 2397 0 0 0 0 0 0 0 0 0 0 0
13 3458 1 0 0 0 0 0 0 0 0 0 0
14 3024 0 1 0 0 0 0 0 0 0 0 0
15 3100 0 0 1 0 0 0 0 0 0 0 0
16 2904 0 0 0 1 0 0 0 0 0 0 0
17 3056 0 0 0 0 1 0 0 0 0 0 0
18 2771 0 0 0 0 0 1 0 0 0 0 0
19 2897 0 0 0 0 0 0 1 0 0 0 0
20 2772 0 0 0 0 0 0 0 1 0 0 0
21 2857 0 0 0 0 0 0 0 0 1 0 0
22 3020 0 0 0 0 0 0 0 0 0 1 0
23 2648 0 0 0 0 0 0 0 0 0 0 1
24 2364 0 0 0 0 0 0 0 0 0 0 0
25 3194 1 0 0 0 0 0 0 0 0 0 0
26 3013 0 1 0 0 0 0 0 0 0 0 0
27 2560 0 0 1 0 0 0 0 0 0 0 0
28 3074 0 0 0 1 0 0 0 0 0 0 0
29 2746 0 0 0 0 1 0 0 0 0 0 0
30 2846 0 0 0 0 0 1 0 0 0 0 0
31 3184 0 0 0 0 0 0 1 0 0 0 0
32 2354 0 0 0 0 0 0 0 1 0 0 0
33 3080 0 0 0 0 0 0 0 0 1 0 0
34 2963 0 0 0 0 0 0 0 0 0 1 0
35 2430 0 0 0 0 0 0 0 0 0 0 1
36 2296 0 0 0 0 0 0 0 0 0 0 0
37 2416 1 0 0 0 0 0 0 0 0 0 0
38 2647 0 1 0 0 0 0 0 0 0 0 0
39 2789 0 0 1 0 0 0 0 0 0 0 0
40 2685 0 0 0 1 0 0 0 0 0 0 0
41 2666 0 0 0 0 1 0 0 0 0 0 0
42 2882 0 0 0 0 0 1 0 0 0 0 0
43 2953 0 0 0 0 0 0 1 0 0 0 0
44 2127 0 0 0 0 0 0 0 1 0 0 0
45 2563 0 0 0 0 0 0 0 0 1 0 0
46 3061 0 0 0 0 0 0 0 0 0 1 0
47 2809 0 0 0 0 0 0 0 0 0 0 1
48 2861 0 0 0 0 0 0 0 0 0 0 0
49 2781 1 0 0 0 0 0 0 0 0 0 0
50 2555 0 1 0 0 0 0 0 0 0 0 0
51 3206 0 0 1 0 0 0 0 0 0 0 0
52 2570 0 0 0 1 0 0 0 0 0 0 0
53 2410 0 0 0 0 1 0 0 0 0 0 0
54 3195 0 0 0 0 0 1 0 0 0 0 0
55 2736 0 0 0 0 0 0 1 0 0 0 0
56 2743 0 0 0 0 0 0 0 1 0 0 0
57 2934 0 0 0 0 0 0 0 0 1 0 0
58 2668 0 0 0 0 0 0 0 0 0 1 0
59 2907 0 0 0 0 0 0 0 0 0 0 1
60 2866 0 0 0 0 0 0 0 0 0 0 0
61 2983 1 0 0 0 0 0 0 0 0 0 0
62 2878 0 1 0 0 0 0 0 0 0 0 0
63 3225 0 0 1 0 0 0 0 0 0 0 0
64 2515 0 0 0 1 0 0 0 0 0 0 0
65 3193 0 0 0 0 1 0 0 0 0 0 0
66 2663 0 0 0 0 0 1 0 0 0 0 0
67 2908 0 0 0 0 0 0 1 0 0 0 0
68 2896 0 0 0 0 0 0 0 1 0 0 0
69 2853 0 0 0 0 0 0 0 0 1 0 0
70 3028 0 0 0 0 0 0 0 0 0 1 0
71 3053 0 0 0 0 0 0 0 0 0 0 1
72 2455 0 0 0 0 0 0 0 0 0 0 0
73 3401 1 0 0 0 0 0 0 0 0 0 0
74 2969 0 1 0 0 0 0 0 0 0 0 0
75 3243 0 0 1 0 0 0 0 0 0 0 0
76 2849 0 0 0 1 0 0 0 0 0 0 0
77 3296 0 0 0 0 1 0 0 0 0 0 0
78 3121 0 0 0 0 0 1 0 0 0 0 0
79 3194 0 0 0 0 0 0 1 0 0 0 0
80 3023 0 0 0 0 0 0 0 1 0 0 0
81 2984 0 0 0 0 0 0 0 0 1 0 0
82 3525 0 0 0 0 0 0 0 0 0 1 0
83 3116 0 0 0 0 0 0 0 0 0 0 1
84 2383 0 0 0 0 0 0 0 0 0 0 0
85 3294 1 0 0 0 0 0 0 0 0 0 0
86 2882 0 1 0 0 0 0 0 0 0 0 0
87 2820 0 0 1 0 0 0 0 0 0 0 0
88 2583 0 0 0 1 0 0 0 0 0 0 0
89 2803 0 0 0 0 1 0 0 0 0 0 0
90 2767 0 0 0 0 0 1 0 0 0 0 0
91 2945 0 0 0 0 0 0 1 0 0 0 0
92 2716 0 0 0 0 0 0 0 1 0 0 0
93 2644 0 0 0 0 0 0 0 0 1 0 0
94 2956 0 0 0 0 0 0 0 0 0 1 0
95 2598 0 0 0 0 0 0 0 0 0 0 1
96 2171 0 0 0 0 0 0 0 0 0 0 0
97 2994 1 0 0 0 0 0 0 0 0 0 0
98 2645 0 1 0 0 0 0 0 0 0 0 0
99 2724 0 0 1 0 0 0 0 0 0 0 0
100 2550 0 0 0 1 0 0 0 0 0 0 0
101 2707 0 0 0 0 1 0 0 0 0 0 0
102 2679 0 0 0 0 0 1 0 0 0 0 0
103 2878 0 0 0 0 0 0 1 0 0 0 0
104 2307 0 0 0 0 0 0 0 1 0 0 0
105 2496 0 0 0 0 0 0 0 0 1 0 0
106 2637 0 0 0 0 0 0 0 0 0 1 0
107 2436 0 0 0 0 0 0 0 0 0 0 1
108 2426 0 0 0 0 0 0 0 0 0 0 0
109 2607 1 0 0 0 0 0 0 0 0 0 0
110 2533 0 1 0 0 0 0 0 0 0 0 0
111 2888 0 0 1 0 0 0 0 0 0 0 0
112 2520 0 0 0 1 0 0 0 0 0 0 0
113 2229 0 0 0 0 1 0 0 0 0 0 0
114 2804 0 0 0 0 0 1 0 0 0 0 0
115 2661 0 0 0 0 0 0 1 0 0 0 0
116 2547 0 0 0 0 0 0 0 1 0 0 0
117 2509 0 0 0 0 0 0 0 0 1 0 0
118 2465 0 0 0 0 0 0 0 0 0 1 0
119 2629 0 0 0 0 0 0 0 0 0 0 1
120 2706 0 0 0 0 0 0 0 0 0 0 0
121 2666 1 0 0 0 0 0 0 0 0 0 0
122 2432 0 1 0 0 0 0 0 0 0 0 0
123 2836 0 0 1 0 0 0 0 0 0 0 0
124 2888 0 0 0 1 0 0 0 0 0 0 0
125 2566 0 0 0 0 1 0 0 0 0 0 0
126 2802 0 0 0 0 0 1 0 0 0 0 0
127 2611 0 0 0 0 0 0 1 0 0 0 0
128 2683 0 0 0 0 0 0 0 1 0 0 0
129 2675 0 0 0 0 0 0 0 0 1 0 0
130 2434 0 0 0 0 0 0 0 0 0 1 0
131 2693 0 0 0 0 0 0 0 0 0 0 1
132 2619 0 0 0 0 0 0 0 0 0 0 0
133 2903 1 0 0 0 0 0 0 0 0 0 0
134 2550 0 1 0 0 0 0 0 0 0 0 0
135 2900 0 0 1 0 0 0 0 0 0 0 0
136 2456 0 0 0 1 0 0 0 0 0 0 0
137 2912 0 0 0 0 1 0 0 0 0 0 0
138 2883 0 0 0 0 0 1 0 0 0 0 0
139 2464 0 0 0 0 0 0 1 0 0 0 0
140 2655 0 0 0 0 0 0 0 1 0 0 0
141 2447 0 0 0 0 0 0 0 0 1 0 0
142 2592 0 0 0 0 0 0 0 0 0 1 0
143 2698 0 0 0 0 0 0 0 0 0 0 1
144 2274 0 0 0 0 0 0 0 0 0 0 0
145 2901 1 0 0 0 0 0 0 0 0 0 0
146 2397 0 1 0 0 0 0 0 0 0 0 0
147 3004 0 0 1 0 0 0 0 0 0 0 0
148 2614 0 0 0 1 0 0 0 0 0 0 0
149 2882 0 0 0 0 1 0 0 0 0 0 0
150 2671 0 0 0 0 0 1 0 0 0 0 0
151 2761 0 0 0 0 0 0 1 0 0 0 0
152 2806 0 0 0 0 0 0 0 1 0 0 0
153 2414 0 0 0 0 0 0 0 0 1 0 0
154 2673 0 0 0 0 0 0 0 0 0 1 0
155 2748 0 0 0 0 0 0 0 0 0 0 1
156 2112 0 0 0 0 0 0 0 0 0 0 0
157 2903 1 0 0 0 0 0 0 0 0 0 0
158 2633 0 1 0 0 0 0 0 0 0 0 0
159 2684 0 0 1 0 0 0 0 0 0 0 0
160 2861 0 0 0 1 0 0 0 0 0 0 0
161 2504 0 0 0 0 1 0 0 0 0 0 0
162 2708 0 0 0 0 0 1 0 0 0 0 0
163 2961 0 0 0 0 0 0 1 0 0 0 0
164 2535 0 0 0 0 0 0 0 1 0 0 0
165 2688 0 0 0 0 0 0 0 0 1 0 0
166 2699 0 0 0 0 0 0 0 0 0 1 0
167 2469 0 0 0 0 0 0 0 0 0 0 1
168 2585 0 0 0 0 0 0 0 0 0 0 0
169 2582 1 0 0 0 0 0 0 0 0 0 0
170 2480 0 1 0 0 0 0 0 0 0 0 0
171 2709 0 0 1 0 0 0 0 0 0 0 0
172 2441 0 0 0 1 0 0 0 0 0 0 0
173 2182 0 0 0 0 1 0 0 0 0 0 0
174 2585 0 0 0 0 0 1 0 0 0 0 0
175 2881 0 0 0 0 0 0 1 0 0 0 0
176 2422 0 0 0 0 0 0 0 1 0 0 0
177 2690 0 0 0 0 0 0 0 0 1 0 0
178 2659 0 0 0 0 0 0 0 0 0 1 0
179 2535 0 0 0 0 0 0 0 0 0 0 1
180 2613 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
2475.2 459.5 227.9 446.7 187.3 272.2
M6 M7 M8 M9 M10 M11
344.5 387.1 152.1 233.6 342.9 240.5
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-565.40 -157.28 -22.33 175.67 706.87
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2475.20 61.78 40.067 < 2e-16 ***
M1 459.53 87.36 5.260 4.34e-07 ***
M2 227.93 87.36 2.609 0.009900 **
M3 446.73 87.36 5.113 8.55e-07 ***
M4 187.27 87.36 2.144 0.033510 *
M5 272.20 87.36 3.116 0.002159 **
M6 344.47 87.36 3.943 0.000118 ***
M7 387.13 87.36 4.431 1.68e-05 ***
M8 152.07 87.36 1.741 0.083584 .
M9 233.60 87.36 2.674 0.008239 **
M10 342.93 87.36 3.925 0.000126 ***
M11 240.53 87.36 2.753 0.006551 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 239.3 on 168 degrees of freedom
Multiple R-squared: 0.2278, Adjusted R-squared: 0.1772
F-statistic: 4.505 on 11 and 168 DF, p-value: 5.804e-06
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.52108193 0.9578361417 0.4789180708
[2,] 0.65053074 0.6989385267 0.3494692633
[3,] 0.51843529 0.9631294165 0.4815647082
[4,] 0.41179463 0.8235892583 0.5882053709
[5,] 0.29676500 0.5935300021 0.7032349989
[6,] 0.20738161 0.4147632189 0.7926183906
[7,] 0.13985788 0.2797157639 0.8601421181
[8,] 0.09860582 0.1972116384 0.9013941808
[9,] 0.10701811 0.2140362176 0.8929818912
[10,] 0.06926296 0.1385259294 0.9307370353
[11,] 0.04486134 0.0897226835 0.9551386583
[12,] 0.02951354 0.0590270875 0.9704864562
[13,] 0.15046404 0.3009280851 0.8495359575
[14,] 0.22911034 0.4582206879 0.7708896561
[15,] 0.24159105 0.4831821076 0.7584089462
[16,] 0.18639357 0.3727871301 0.8136064349
[17,] 0.19764537 0.3952907400 0.8023546300
[18,] 0.28011419 0.5602283843 0.7198858078
[19,] 0.28504455 0.5700891088 0.7149554456
[20,] 0.23328482 0.4665696349 0.7667151826
[21,] 0.27890491 0.5578098261 0.7210950870
[22,] 0.23543971 0.4708794203 0.7645602898
[23,] 0.63867289 0.7226542222 0.3613271111
[24,] 0.64903627 0.7019274664 0.3509637332
[25,] 0.60769144 0.7846171240 0.3923085620
[26,] 0.55845241 0.8830951835 0.4415475918
[27,] 0.55127199 0.8974560163 0.4487280082
[28,] 0.49498768 0.9899753580 0.5050123210
[29,] 0.44171192 0.8834238475 0.5582880762
[30,] 0.59955697 0.8008860582 0.4004430291
[31,] 0.61356032 0.7728793662 0.3864396831
[32,] 0.58307437 0.8338512582 0.4169256291
[33,] 0.53952765 0.9209447056 0.4604723528
[34,] 0.65023431 0.6995313726 0.3497656863
[35,] 0.62900863 0.7419827370 0.3709913685
[36,] 0.63999216 0.7200156828 0.3600078414
[37,] 0.65543496 0.6891300772 0.3445650386
[38,] 0.62713107 0.7457378667 0.3728689333
[39,] 0.70110717 0.5977856528 0.2988928264
[40,] 0.73957795 0.5208441009 0.2604220504
[41,] 0.72314794 0.5537041207 0.2768520603
[42,] 0.70148362 0.5970327510 0.2985163755
[43,] 0.68017016 0.6396596879 0.3198298439
[44,] 0.67857701 0.6428459768 0.3214229884
[45,] 0.65856044 0.6828791242 0.3414395621
[46,] 0.71419906 0.5716018829 0.2858009415
[47,] 0.67253446 0.6549310734 0.3274655367
[48,] 0.64495181 0.7100963862 0.3550481931
[49,] 0.65994814 0.6801037245 0.3400518622
[50,] 0.63858370 0.7228325973 0.3614162987
[51,] 0.72378118 0.5524376349 0.2762188175
[52,] 0.71102507 0.5779498545 0.2889749272
[53,] 0.67146915 0.6570617052 0.3285308526
[54,] 0.68797641 0.6240471737 0.3120235868
[55,] 0.65975461 0.6804907792 0.3402453896
[56,] 0.64301440 0.7139712043 0.3569856022
[57,] 0.67630009 0.6473998105 0.3236999053
[58,] 0.63741223 0.7251755347 0.3625877674
[59,] 0.74528904 0.5094219135 0.2547109568
[60,] 0.75439841 0.4912031800 0.2456015900
[61,] 0.78146809 0.4370638102 0.2185319051
[62,] 0.76782995 0.4643401041 0.2321700520
[63,] 0.89280899 0.2143820218 0.1071910109
[64,] 0.90715626 0.1856874788 0.0928437394
[65,] 0.92687712 0.1462457543 0.0731228772
[66,] 0.95433556 0.0913288861 0.0456644430
[67,] 0.96216980 0.0756604047 0.0378302024
[68,] 0.99826998 0.0034600393 0.0017300196
[69,] 0.99945864 0.0010827111 0.0005413555
[70,] 0.99925911 0.0014817728 0.0007408864
[71,] 0.99977024 0.0004595190 0.0002297595
[72,] 0.99983846 0.0003230758 0.0001615379
[73,] 0.99978357 0.0004328601 0.0002164300
[74,] 0.99968784 0.0006243256 0.0003121628
[75,] 0.99967228 0.0006554378 0.0003277189
[76,] 0.99953569 0.0009286183 0.0004643092
[77,] 0.99945055 0.0010989042 0.0005494521
[78,] 0.99928533 0.0014293484 0.0007146742
[79,] 0.99910757 0.0017848638 0.0008924319
[80,] 0.99940589 0.0011882134 0.0005941067
[81,] 0.99924533 0.0015093405 0.0007546702
[82,] 0.99954408 0.0009118438 0.0004559219
[83,] 0.99952176 0.0009564807 0.0004782403
[84,] 0.99943677 0.0011264598 0.0005632299
[85,] 0.99936573 0.0012685464 0.0006342732
[86,] 0.99913676 0.0017264820 0.0008632410
[87,] 0.99900615 0.0019877077 0.0009938539
[88,] 0.99871213 0.0025757436 0.0012878718
[89,] 0.99839220 0.0032156052 0.0016078026
[90,] 0.99902854 0.0019429106 0.0009714553
[91,] 0.99892433 0.0021513432 0.0010756716
[92,] 0.99883887 0.0023222597 0.0011611298
[93,] 0.99899535 0.0020093010 0.0010046505
[94,] 0.99853919 0.0029216173 0.0014608087
[95,] 0.99881925 0.0023614901 0.0011807450
[96,] 0.99853604 0.0029279248 0.0014639624
[97,] 0.99791129 0.0041774106 0.0020887053
[98,] 0.99736902 0.0052619550 0.0026309775
[99,] 0.99929257 0.0014148513 0.0007074257
[100,] 0.99896405 0.0020718945 0.0010359473
[101,] 0.99869713 0.0026057328 0.0013028664
[102,] 0.99813145 0.0037371087 0.0018685543
[103,] 0.99765437 0.0046912658 0.0023456329
[104,] 0.99796091 0.0040781734 0.0020390867
[105,] 0.99705063 0.0058987356 0.0029493678
[106,] 0.99740635 0.0051872937 0.0025936468
[107,] 0.99718555 0.0056288902 0.0028144451
[108,] 0.99669370 0.0066125955 0.0033062977
[109,] 0.99522391 0.0095521823 0.0047760912
[110,] 0.99605333 0.0078933354 0.0039466677
[111,] 0.99470290 0.0105941923 0.0052970961
[112,] 0.99262928 0.0147414456 0.0073707228
[113,] 0.99169618 0.0166076434 0.0083038217
[114,] 0.98844206 0.0231158812 0.0115579406
[115,] 0.98478227 0.0304354624 0.0152177312
[116,] 0.98699548 0.0260090424 0.0130045212
[117,] 0.98213721 0.0357255763 0.0178627881
[118,] 0.98074451 0.0385109748 0.0192554874
[119,] 0.97445507 0.0510898568 0.0255449284
[120,] 0.96632190 0.0673562081 0.0336781041
[121,] 0.95584980 0.0883004026 0.0441502013
[122,] 0.94996421 0.1000715822 0.0500357911
[123,] 0.96545895 0.0690821008 0.0345410504
[124,] 0.96247609 0.0750478219 0.0375239109
[125,] 0.98082650 0.0383469969 0.0191734984
[126,] 0.97278480 0.0544304009 0.0272152005
[127,] 0.96795636 0.0640872722 0.0320436361
[128,] 0.95846998 0.0830600427 0.0415300214
[129,] 0.94526429 0.1094714239 0.0547357120
[130,] 0.93508483 0.1298303363 0.0649151681
[131,] 0.91940281 0.1611943854 0.0805971927
[132,] 0.90721986 0.1855602870 0.0927801435
[133,] 0.91344417 0.1731116680 0.0865558340
[134,] 0.88217672 0.2356465509 0.1178232755
[135,] 0.95950347 0.0809930677 0.0404965339
[136,] 0.94096718 0.1180656308 0.0590328154
[137,] 0.92518955 0.1496208912 0.0748104456
[138,] 0.94127214 0.1174557191 0.0587278595
[139,] 0.94787138 0.1042572304 0.0521286152
[140,] 0.92132737 0.1573452605 0.0786726302
[141,] 0.91849645 0.1630070981 0.0815035490
[142,] 0.98518211 0.0296357789 0.0148178895
[143,] 0.99044426 0.0191114813 0.0095557407
[144,] 0.98524682 0.0295063646 0.0147531823
[145,] 0.97147705 0.0570459074 0.0285229537
[146,] 0.99589804 0.0082039199 0.0041019600
[147,] 0.99981688 0.0003662379 0.0001831189
[148,] 0.99977619 0.0004476230 0.0002238115
[149,] 0.99939215 0.0012156962 0.0006078481
[150,] 0.99956846 0.0008630761 0.0004315380
[151,] 0.99620856 0.0075828881 0.0037914441
> postscript(file="/var/www/html/rcomp/tmp/1imp11291114127.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/2tdp41291114127.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/3tdp41291114127.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/4mno71291114127.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/5mno71291114127.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 = 180
Frequency = 1
1 2 3 4 5 6
3.266667 205.866667 219.066667 -235.466667 311.600000 98.333333
7 8 9 10 11 12
38.666667 195.733333 89.200000 73.866667 251.266667 -78.200000
13 14 15 16 17 18
523.266667 320.866667 178.066667 241.533333 308.600000 -48.666667
19 20 21 22 23 24
34.666667 144.733333 148.200000 201.866667 -67.733333 -111.200000
25 26 27 28 29 30
259.266667 309.866667 -361.933333 411.533333 -1.400000 26.333333
31 32 33 34 35 36
321.666667 -273.266667 371.200000 144.866667 -285.733333 -179.200000
37 38 39 40 41 42
-518.733333 -56.133333 -132.933333 22.533333 -81.400000 62.333333
43 44 45 46 47 48
90.666667 -500.266667 -145.800000 242.866667 93.266667 385.800000
49 50 51 52 53 54
-153.733333 -148.133333 284.066667 -92.466667 -337.400000 375.333333
55 56 57 58 59 60
-126.333333 115.733333 225.200000 -150.133333 191.266667 390.800000
61 62 63 64 65 66
48.266667 174.866667 303.066667 -147.466667 445.600000 -156.666667
67 68 69 70 71 72
45.666667 268.733333 144.200000 209.866667 337.266667 -20.200000
73 74 75 76 77 78
466.266667 265.866667 321.066667 186.533333 548.600000 301.333333
79 80 81 82 83 84
331.666667 395.733333 275.200000 706.866667 400.266667 -92.200000
85 86 87 88 89 90
359.266667 178.866667 -101.933333 -79.466667 55.600000 -52.666667
91 92 93 94 95 96
82.666667 88.733333 -64.800000 137.866667 -117.733333 -304.200000
97 98 99 100 101 102
59.266667 -58.133333 -197.933333 -112.466667 -40.400000 -140.666667
103 104 105 106 107 108
15.666667 -320.266667 -212.800000 -181.133333 -279.733333 -49.200000
109 110 111 112 113 114
-327.733333 -170.133333 -33.933333 -142.466667 -518.400000 -15.666667
115 116 117 118 119 120
-201.333333 -80.266667 -199.800000 -353.133333 -86.733333 230.800000
121 122 123 124 125 126
-268.733333 -271.133333 -85.933333 225.533333 -181.400000 -17.666667
127 128 129 130 131 132
-251.333333 55.733333 -33.800000 -384.133333 -22.733333 143.800000
133 134 135 136 137 138
-31.733333 -153.133333 -21.933333 -206.466667 164.600000 63.333333
139 140 141 142 143 144
-398.333333 27.733333 -261.800000 -226.133333 -17.733333 -201.200000
145 146 147 148 149 150
-33.733333 -306.133333 82.066667 -48.466667 134.600000 -148.666667
151 152 153 154 155 156
-101.333333 178.733333 -294.800000 -145.133333 32.266667 -363.200000
157 158 159 160 161 162
-31.733333 -70.133333 -237.933333 198.533333 -243.400000 -111.666667
163 164 165 166 167 168
98.666667 -92.266667 -20.800000 -119.133333 -246.733333 109.800000
169 170 171 172 173 174
-352.733333 -223.133333 -212.933333 -221.466667 -565.400000 -234.666667
175 176 177 178 179 180
18.666667 -205.266667 -18.800000 -159.133333 -180.733333 137.800000
> postscript(file="/var/www/html/rcomp/tmp/6mno71291114127.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 = 180
Frequency = 1
lag(myerror, k = 1) myerror
0 3.266667 NA
1 205.866667 3.266667
2 219.066667 205.866667
3 -235.466667 219.066667
4 311.600000 -235.466667
5 98.333333 311.600000
6 38.666667 98.333333
7 195.733333 38.666667
8 89.200000 195.733333
9 73.866667 89.200000
10 251.266667 73.866667
11 -78.200000 251.266667
12 523.266667 -78.200000
13 320.866667 523.266667
14 178.066667 320.866667
15 241.533333 178.066667
16 308.600000 241.533333
17 -48.666667 308.600000
18 34.666667 -48.666667
19 144.733333 34.666667
20 148.200000 144.733333
21 201.866667 148.200000
22 -67.733333 201.866667
23 -111.200000 -67.733333
24 259.266667 -111.200000
25 309.866667 259.266667
26 -361.933333 309.866667
27 411.533333 -361.933333
28 -1.400000 411.533333
29 26.333333 -1.400000
30 321.666667 26.333333
31 -273.266667 321.666667
32 371.200000 -273.266667
33 144.866667 371.200000
34 -285.733333 144.866667
35 -179.200000 -285.733333
36 -518.733333 -179.200000
37 -56.133333 -518.733333
38 -132.933333 -56.133333
39 22.533333 -132.933333
40 -81.400000 22.533333
41 62.333333 -81.400000
42 90.666667 62.333333
43 -500.266667 90.666667
44 -145.800000 -500.266667
45 242.866667 -145.800000
46 93.266667 242.866667
47 385.800000 93.266667
48 -153.733333 385.800000
49 -148.133333 -153.733333
50 284.066667 -148.133333
51 -92.466667 284.066667
52 -337.400000 -92.466667
53 375.333333 -337.400000
54 -126.333333 375.333333
55 115.733333 -126.333333
56 225.200000 115.733333
57 -150.133333 225.200000
58 191.266667 -150.133333
59 390.800000 191.266667
60 48.266667 390.800000
61 174.866667 48.266667
62 303.066667 174.866667
63 -147.466667 303.066667
64 445.600000 -147.466667
65 -156.666667 445.600000
66 45.666667 -156.666667
67 268.733333 45.666667
68 144.200000 268.733333
69 209.866667 144.200000
70 337.266667 209.866667
71 -20.200000 337.266667
72 466.266667 -20.200000
73 265.866667 466.266667
74 321.066667 265.866667
75 186.533333 321.066667
76 548.600000 186.533333
77 301.333333 548.600000
78 331.666667 301.333333
79 395.733333 331.666667
80 275.200000 395.733333
81 706.866667 275.200000
82 400.266667 706.866667
83 -92.200000 400.266667
84 359.266667 -92.200000
85 178.866667 359.266667
86 -101.933333 178.866667
87 -79.466667 -101.933333
88 55.600000 -79.466667
89 -52.666667 55.600000
90 82.666667 -52.666667
91 88.733333 82.666667
92 -64.800000 88.733333
93 137.866667 -64.800000
94 -117.733333 137.866667
95 -304.200000 -117.733333
96 59.266667 -304.200000
97 -58.133333 59.266667
98 -197.933333 -58.133333
99 -112.466667 -197.933333
100 -40.400000 -112.466667
101 -140.666667 -40.400000
102 15.666667 -140.666667
103 -320.266667 15.666667
104 -212.800000 -320.266667
105 -181.133333 -212.800000
106 -279.733333 -181.133333
107 -49.200000 -279.733333
108 -327.733333 -49.200000
109 -170.133333 -327.733333
110 -33.933333 -170.133333
111 -142.466667 -33.933333
112 -518.400000 -142.466667
113 -15.666667 -518.400000
114 -201.333333 -15.666667
115 -80.266667 -201.333333
116 -199.800000 -80.266667
117 -353.133333 -199.800000
118 -86.733333 -353.133333
119 230.800000 -86.733333
120 -268.733333 230.800000
121 -271.133333 -268.733333
122 -85.933333 -271.133333
123 225.533333 -85.933333
124 -181.400000 225.533333
125 -17.666667 -181.400000
126 -251.333333 -17.666667
127 55.733333 -251.333333
128 -33.800000 55.733333
129 -384.133333 -33.800000
130 -22.733333 -384.133333
131 143.800000 -22.733333
132 -31.733333 143.800000
133 -153.133333 -31.733333
134 -21.933333 -153.133333
135 -206.466667 -21.933333
136 164.600000 -206.466667
137 63.333333 164.600000
138 -398.333333 63.333333
139 27.733333 -398.333333
140 -261.800000 27.733333
141 -226.133333 -261.800000
142 -17.733333 -226.133333
143 -201.200000 -17.733333
144 -33.733333 -201.200000
145 -306.133333 -33.733333
146 82.066667 -306.133333
147 -48.466667 82.066667
148 134.600000 -48.466667
149 -148.666667 134.600000
150 -101.333333 -148.666667
151 178.733333 -101.333333
152 -294.800000 178.733333
153 -145.133333 -294.800000
154 32.266667 -145.133333
155 -363.200000 32.266667
156 -31.733333 -363.200000
157 -70.133333 -31.733333
158 -237.933333 -70.133333
159 198.533333 -237.933333
160 -243.400000 198.533333
161 -111.666667 -243.400000
162 98.666667 -111.666667
163 -92.266667 98.666667
164 -20.800000 -92.266667
165 -119.133333 -20.800000
166 -246.733333 -119.133333
167 109.800000 -246.733333
168 -352.733333 109.800000
169 -223.133333 -352.733333
170 -212.933333 -223.133333
171 -221.466667 -212.933333
172 -565.400000 -221.466667
173 -234.666667 -565.400000
174 18.666667 -234.666667
175 -205.266667 18.666667
176 -18.800000 -205.266667
177 -159.133333 -18.800000
178 -180.733333 -159.133333
179 137.800000 -180.733333
180 NA 137.800000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 205.86667 3.266667
[2,] 219.06667 205.866667
[3,] -235.46667 219.066667
[4,] 311.60000 -235.466667
[5,] 98.33333 311.600000
[6,] 38.66667 98.333333
[7,] 195.73333 38.666667
[8,] 89.20000 195.733333
[9,] 73.86667 89.200000
[10,] 251.26667 73.866667
[11,] -78.20000 251.266667
[12,] 523.26667 -78.200000
[13,] 320.86667 523.266667
[14,] 178.06667 320.866667
[15,] 241.53333 178.066667
[16,] 308.60000 241.533333
[17,] -48.66667 308.600000
[18,] 34.66667 -48.666667
[19,] 144.73333 34.666667
[20,] 148.20000 144.733333
[21,] 201.86667 148.200000
[22,] -67.73333 201.866667
[23,] -111.20000 -67.733333
[24,] 259.26667 -111.200000
[25,] 309.86667 259.266667
[26,] -361.93333 309.866667
[27,] 411.53333 -361.933333
[28,] -1.40000 411.533333
[29,] 26.33333 -1.400000
[30,] 321.66667 26.333333
[31,] -273.26667 321.666667
[32,] 371.20000 -273.266667
[33,] 144.86667 371.200000
[34,] -285.73333 144.866667
[35,] -179.20000 -285.733333
[36,] -518.73333 -179.200000
[37,] -56.13333 -518.733333
[38,] -132.93333 -56.133333
[39,] 22.53333 -132.933333
[40,] -81.40000 22.533333
[41,] 62.33333 -81.400000
[42,] 90.66667 62.333333
[43,] -500.26667 90.666667
[44,] -145.80000 -500.266667
[45,] 242.86667 -145.800000
[46,] 93.26667 242.866667
[47,] 385.80000 93.266667
[48,] -153.73333 385.800000
[49,] -148.13333 -153.733333
[50,] 284.06667 -148.133333
[51,] -92.46667 284.066667
[52,] -337.40000 -92.466667
[53,] 375.33333 -337.400000
[54,] -126.33333 375.333333
[55,] 115.73333 -126.333333
[56,] 225.20000 115.733333
[57,] -150.13333 225.200000
[58,] 191.26667 -150.133333
[59,] 390.80000 191.266667
[60,] 48.26667 390.800000
[61,] 174.86667 48.266667
[62,] 303.06667 174.866667
[63,] -147.46667 303.066667
[64,] 445.60000 -147.466667
[65,] -156.66667 445.600000
[66,] 45.66667 -156.666667
[67,] 268.73333 45.666667
[68,] 144.20000 268.733333
[69,] 209.86667 144.200000
[70,] 337.26667 209.866667
[71,] -20.20000 337.266667
[72,] 466.26667 -20.200000
[73,] 265.86667 466.266667
[74,] 321.06667 265.866667
[75,] 186.53333 321.066667
[76,] 548.60000 186.533333
[77,] 301.33333 548.600000
[78,] 331.66667 301.333333
[79,] 395.73333 331.666667
[80,] 275.20000 395.733333
[81,] 706.86667 275.200000
[82,] 400.26667 706.866667
[83,] -92.20000 400.266667
[84,] 359.26667 -92.200000
[85,] 178.86667 359.266667
[86,] -101.93333 178.866667
[87,] -79.46667 -101.933333
[88,] 55.60000 -79.466667
[89,] -52.66667 55.600000
[90,] 82.66667 -52.666667
[91,] 88.73333 82.666667
[92,] -64.80000 88.733333
[93,] 137.86667 -64.800000
[94,] -117.73333 137.866667
[95,] -304.20000 -117.733333
[96,] 59.26667 -304.200000
[97,] -58.13333 59.266667
[98,] -197.93333 -58.133333
[99,] -112.46667 -197.933333
[100,] -40.40000 -112.466667
[101,] -140.66667 -40.400000
[102,] 15.66667 -140.666667
[103,] -320.26667 15.666667
[104,] -212.80000 -320.266667
[105,] -181.13333 -212.800000
[106,] -279.73333 -181.133333
[107,] -49.20000 -279.733333
[108,] -327.73333 -49.200000
[109,] -170.13333 -327.733333
[110,] -33.93333 -170.133333
[111,] -142.46667 -33.933333
[112,] -518.40000 -142.466667
[113,] -15.66667 -518.400000
[114,] -201.33333 -15.666667
[115,] -80.26667 -201.333333
[116,] -199.80000 -80.266667
[117,] -353.13333 -199.800000
[118,] -86.73333 -353.133333
[119,] 230.80000 -86.733333
[120,] -268.73333 230.800000
[121,] -271.13333 -268.733333
[122,] -85.93333 -271.133333
[123,] 225.53333 -85.933333
[124,] -181.40000 225.533333
[125,] -17.66667 -181.400000
[126,] -251.33333 -17.666667
[127,] 55.73333 -251.333333
[128,] -33.80000 55.733333
[129,] -384.13333 -33.800000
[130,] -22.73333 -384.133333
[131,] 143.80000 -22.733333
[132,] -31.73333 143.800000
[133,] -153.13333 -31.733333
[134,] -21.93333 -153.133333
[135,] -206.46667 -21.933333
[136,] 164.60000 -206.466667
[137,] 63.33333 164.600000
[138,] -398.33333 63.333333
[139,] 27.73333 -398.333333
[140,] -261.80000 27.733333
[141,] -226.13333 -261.800000
[142,] -17.73333 -226.133333
[143,] -201.20000 -17.733333
[144,] -33.73333 -201.200000
[145,] -306.13333 -33.733333
[146,] 82.06667 -306.133333
[147,] -48.46667 82.066667
[148,] 134.60000 -48.466667
[149,] -148.66667 134.600000
[150,] -101.33333 -148.666667
[151,] 178.73333 -101.333333
[152,] -294.80000 178.733333
[153,] -145.13333 -294.800000
[154,] 32.26667 -145.133333
[155,] -363.20000 32.266667
[156,] -31.73333 -363.200000
[157,] -70.13333 -31.733333
[158,] -237.93333 -70.133333
[159,] 198.53333 -237.933333
[160,] -243.40000 198.533333
[161,] -111.66667 -243.400000
[162,] 98.66667 -111.666667
[163,] -92.26667 98.666667
[164,] -20.80000 -92.266667
[165,] -119.13333 -20.800000
[166,] -246.73333 -119.133333
[167,] 109.80000 -246.733333
[168,] -352.73333 109.800000
[169,] -223.13333 -352.733333
[170,] -212.93333 -223.133333
[171,] -221.46667 -212.933333
[172,] -565.40000 -221.466667
[173,] -234.66667 -565.400000
[174,] 18.66667 -234.666667
[175,] -205.26667 18.666667
[176,] -18.80000 -205.266667
[177,] -159.13333 -18.800000
[178,] -180.73333 -159.133333
[179,] 137.80000 -180.733333
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 205.86667 3.266667
2 219.06667 205.866667
3 -235.46667 219.066667
4 311.60000 -235.466667
5 98.33333 311.600000
6 38.66667 98.333333
7 195.73333 38.666667
8 89.20000 195.733333
9 73.86667 89.200000
10 251.26667 73.866667
11 -78.20000 251.266667
12 523.26667 -78.200000
13 320.86667 523.266667
14 178.06667 320.866667
15 241.53333 178.066667
16 308.60000 241.533333
17 -48.66667 308.600000
18 34.66667 -48.666667
19 144.73333 34.666667
20 148.20000 144.733333
21 201.86667 148.200000
22 -67.73333 201.866667
23 -111.20000 -67.733333
24 259.26667 -111.200000
25 309.86667 259.266667
26 -361.93333 309.866667
27 411.53333 -361.933333
28 -1.40000 411.533333
29 26.33333 -1.400000
30 321.66667 26.333333
31 -273.26667 321.666667
32 371.20000 -273.266667
33 144.86667 371.200000
34 -285.73333 144.866667
35 -179.20000 -285.733333
36 -518.73333 -179.200000
37 -56.13333 -518.733333
38 -132.93333 -56.133333
39 22.53333 -132.933333
40 -81.40000 22.533333
41 62.33333 -81.400000
42 90.66667 62.333333
43 -500.26667 90.666667
44 -145.80000 -500.266667
45 242.86667 -145.800000
46 93.26667 242.866667
47 385.80000 93.266667
48 -153.73333 385.800000
49 -148.13333 -153.733333
50 284.06667 -148.133333
51 -92.46667 284.066667
52 -337.40000 -92.466667
53 375.33333 -337.400000
54 -126.33333 375.333333
55 115.73333 -126.333333
56 225.20000 115.733333
57 -150.13333 225.200000
58 191.26667 -150.133333
59 390.80000 191.266667
60 48.26667 390.800000
61 174.86667 48.266667
62 303.06667 174.866667
63 -147.46667 303.066667
64 445.60000 -147.466667
65 -156.66667 445.600000
66 45.66667 -156.666667
67 268.73333 45.666667
68 144.20000 268.733333
69 209.86667 144.200000
70 337.26667 209.866667
71 -20.20000 337.266667
72 466.26667 -20.200000
73 265.86667 466.266667
74 321.06667 265.866667
75 186.53333 321.066667
76 548.60000 186.533333
77 301.33333 548.600000
78 331.66667 301.333333
79 395.73333 331.666667
80 275.20000 395.733333
81 706.86667 275.200000
82 400.26667 706.866667
83 -92.20000 400.266667
84 359.26667 -92.200000
85 178.86667 359.266667
86 -101.93333 178.866667
87 -79.46667 -101.933333
88 55.60000 -79.466667
89 -52.66667 55.600000
90 82.66667 -52.666667
91 88.73333 82.666667
92 -64.80000 88.733333
93 137.86667 -64.800000
94 -117.73333 137.866667
95 -304.20000 -117.733333
96 59.26667 -304.200000
97 -58.13333 59.266667
98 -197.93333 -58.133333
99 -112.46667 -197.933333
100 -40.40000 -112.466667
101 -140.66667 -40.400000
102 15.66667 -140.666667
103 -320.26667 15.666667
104 -212.80000 -320.266667
105 -181.13333 -212.800000
106 -279.73333 -181.133333
107 -49.20000 -279.733333
108 -327.73333 -49.200000
109 -170.13333 -327.733333
110 -33.93333 -170.133333
111 -142.46667 -33.933333
112 -518.40000 -142.466667
113 -15.66667 -518.400000
114 -201.33333 -15.666667
115 -80.26667 -201.333333
116 -199.80000 -80.266667
117 -353.13333 -199.800000
118 -86.73333 -353.133333
119 230.80000 -86.733333
120 -268.73333 230.800000
121 -271.13333 -268.733333
122 -85.93333 -271.133333
123 225.53333 -85.933333
124 -181.40000 225.533333
125 -17.66667 -181.400000
126 -251.33333 -17.666667
127 55.73333 -251.333333
128 -33.80000 55.733333
129 -384.13333 -33.800000
130 -22.73333 -384.133333
131 143.80000 -22.733333
132 -31.73333 143.800000
133 -153.13333 -31.733333
134 -21.93333 -153.133333
135 -206.46667 -21.933333
136 164.60000 -206.466667
137 63.33333 164.600000
138 -398.33333 63.333333
139 27.73333 -398.333333
140 -261.80000 27.733333
141 -226.13333 -261.800000
142 -17.73333 -226.133333
143 -201.20000 -17.733333
144 -33.73333 -201.200000
145 -306.13333 -33.733333
146 82.06667 -306.133333
147 -48.46667 82.066667
148 134.60000 -48.466667
149 -148.66667 134.600000
150 -101.33333 -148.666667
151 178.73333 -101.333333
152 -294.80000 178.733333
153 -145.13333 -294.800000
154 32.26667 -145.133333
155 -363.20000 32.266667
156 -31.73333 -363.200000
157 -70.13333 -31.733333
158 -237.93333 -70.133333
159 198.53333 -237.933333
160 -243.40000 198.533333
161 -111.66667 -243.400000
162 98.66667 -111.666667
163 -92.26667 98.666667
164 -20.80000 -92.266667
165 -119.13333 -20.800000
166 -246.73333 -119.133333
167 109.80000 -246.733333
168 -352.73333 109.800000
169 -223.13333 -352.733333
170 -212.93333 -223.133333
171 -221.46667 -212.933333
172 -565.40000 -221.466667
173 -234.66667 -565.400000
174 18.66667 -234.666667
175 -205.26667 18.666667
176 -18.80000 -205.266667
177 -159.13333 -18.800000
178 -180.73333 -159.133333
179 137.80000 -180.733333
> 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/7ew5a1291114127.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/87nmd1291114127.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/97nmd1291114127.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')
hat values (leverages) are all = 0.06666667
and there are no factor predictors; no plot no. 5
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/107nmd1291114127.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/113f2l1291114127.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/12of1r1291114127.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/13dzjd1291114128.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/14y0ij1291114128.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/15k0g71291114128.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/165jwc1291114128.tab")
+ }
>
> try(system("convert tmp/1imp11291114127.ps tmp/1imp11291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/2tdp41291114127.ps tmp/2tdp41291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/3tdp41291114127.ps tmp/3tdp41291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/4mno71291114127.ps tmp/4mno71291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/5mno71291114127.ps tmp/5mno71291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/6mno71291114127.ps tmp/6mno71291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ew5a1291114127.ps tmp/7ew5a1291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/87nmd1291114127.ps tmp/87nmd1291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/97nmd1291114127.ps tmp/97nmd1291114127.png",intern=TRUE))
character(0)
> try(system("convert tmp/107nmd1291114127.ps tmp/107nmd1291114127.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.374 1.761 12.262