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
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ ,20
+ ,8
+ ,17
+ ,7
+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9
+ ,23
+ ,14
+ ,10
+ ,30
+ ,12
+ ,15
+ ,10
+ ,29
+ ,22
+ ,10
+ ,24
+ ,14
+ ,24
+ ,20
+ ,21
+ ,10
+ ,10
+ ,21
+ ,15
+ ,7
+ ,5
+ ,21
+ ,24
+ ,10
+ ,21
+ ,13
+ ,17
+ ,11
+ ,23
+ ,22
+ ,10
+ ,29
+ ,16
+ ,11
+ ,6
+ ,27
+ ,24
+ ,10
+ ,31
+ ,9
+ ,17
+ ,9
+ ,25
+ ,19
+ ,10
+ ,20
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,10
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,10
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,10
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,10
+ ,28
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,10
+ ,38
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,10
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,10
+ ,20
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,10
+ ,17
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,10
+ ,28
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,10
+ ,22
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,10
+ ,31
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20)
+ ,dim=c(7
+ ,159)
+ ,dimnames=list(c('Month'
+ ,'ConcernoverMistakes'
+ ,'Doubtsaboutactions'
+ ,'ParentalExpectations'
+ ,'ParentalCriticism'
+ ,'PersonalStandards'
+ ,'Organization')
+ ,1:159))
> y <- array(NA,dim=c(7,159),dimnames=list(c('Month','ConcernoverMistakes','Doubtsaboutactions','ParentalExpectations','ParentalCriticism','PersonalStandards','Organization'),1:159))
> 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 = '2'
> #'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
ConcernoverMistakes Month Doubtsaboutactions ParentalExpectations
1 24 9 14 11
2 25 9 11 7
3 17 9 6 17
4 18 9 12 10
5 18 9 8 12
6 16 9 10 12
7 20 10 10 11
8 16 10 11 11
9 18 10 16 12
10 17 10 11 13
11 23 10 13 14
12 30 10 12 16
13 23 10 8 11
14 18 10 12 10
15 15 10 11 11
16 12 10 4 15
17 21 10 9 9
18 15 10 8 11
19 20 10 8 17
20 31 10 14 17
21 27 10 15 11
22 34 10 16 18
23 21 10 9 14
24 31 10 14 10
25 19 10 11 11
26 16 10 8 15
27 20 10 9 15
28 21 10 9 13
29 22 10 9 16
30 17 10 9 13
31 24 10 10 9
32 25 10 16 18
33 26 10 11 18
34 25 10 8 12
35 17 10 9 17
36 32 10 16 9
37 33 10 11 9
38 13 10 16 12
39 32 10 12 18
40 25 10 12 12
41 29 10 14 18
42 22 10 9 14
43 18 10 10 15
44 17 10 9 16
45 20 10 10 10
46 15 10 12 11
47 20 10 14 14
48 33 10 14 9
49 29 10 10 12
50 23 10 14 17
51 26 10 16 5
52 18 10 9 12
53 20 10 10 12
54 11 10 6 6
55 28 10 8 24
56 26 10 13 12
57 22 10 10 12
58 17 10 8 14
59 12 10 7 7
60 14 10 15 13
61 17 10 9 12
62 21 10 10 13
63 19 10 12 14
64 18 10 13 8
65 10 10 10 11
66 29 10 11 9
67 31 10 8 11
68 19 10 9 13
69 9 10 13 10
70 20 10 11 11
71 28 10 8 12
72 19 10 9 9
73 30 10 9 15
74 29 10 15 18
75 26 10 9 15
76 23 10 10 12
77 13 10 14 13
78 21 10 12 14
79 19 10 12 10
80 28 10 11 13
81 23 10 14 13
82 18 10 6 11
83 21 10 12 13
84 20 10 8 16
85 23 10 14 8
86 21 10 11 16
87 21 10 10 11
88 15 10 14 9
89 28 10 12 16
90 19 10 10 12
91 26 10 14 14
92 10 10 5 8
93 16 10 11 9
94 22 10 10 15
95 19 10 9 11
96 31 10 10 21
97 31 10 16 14
98 29 10 13 18
99 19 10 9 12
100 22 10 10 13
101 23 10 10 15
102 15 10 7 12
103 20 10 9 19
104 18 10 8 15
105 23 10 14 11
106 25 10 14 11
107 21 10 8 10
108 24 10 9 13
109 25 10 14 15
110 17 10 14 12
111 13 10 8 12
112 28 10 8 16
113 21 10 8 9
114 25 10 7 18
115 9 10 6 8
116 16 10 8 13
117 19 10 6 17
118 17 10 11 9
119 25 10 14 15
120 20 10 11 8
121 29 10 11 7
122 14 10 11 12
123 22 10 14 14
124 15 10 8 6
125 19 10 20 8
126 20 10 11 17
127 15 10 8 10
128 20 10 11 11
129 18 10 10 14
130 33 10 14 11
131 22 10 11 13
132 16 10 9 12
133 17 10 9 11
134 16 10 8 9
135 21 10 10 12
136 26 10 13 20
137 18 10 13 12
138 18 10 12 13
139 17 10 8 12
140 22 10 13 12
141 30 10 14 9
142 30 10 12 15
143 24 10 14 24
144 21 10 15 7
145 21 10 13 17
146 29 10 16 11
147 31 10 9 17
148 20 10 9 11
149 16 10 9 12
150 22 10 8 14
151 20 10 7 11
152 28 10 16 16
153 38 10 11 21
154 22 10 9 14
155 20 10 11 20
156 17 10 9 13
157 28 10 14 11
158 22 10 13 15
159 31 10 16 19
ParentalCriticism PersonalStandards Organization
1 12 24 26
2 8 25 23
3 8 30 25
4 8 19 23
5 9 22 19
6 7 22 29
7 4 25 25
8 11 23 21
9 7 17 22
10 7 21 25
11 12 19 24
12 10 19 18
13 10 15 22
14 8 16 15
15 8 23 22
16 4 27 28
17 9 22 20
18 8 14 12
19 7 22 24
20 11 23 20
21 9 23 21
22 11 21 20
23 13 19 21
24 8 18 23
25 8 20 28
26 9 23 24
27 6 25 24
28 9 19 24
29 9 24 23
30 6 22 23
31 6 25 29
32 16 26 24
33 5 29 18
34 7 32 25
35 9 25 21
36 6 29 26
37 6 28 22
38 5 17 22
39 12 28 22
40 7 29 23
41 10 26 30
42 9 25 23
43 8 14 17
44 5 25 23
45 8 26 23
46 8 20 25
47 10 18 24
48 6 32 24
49 8 25 23
50 7 25 21
51 4 23 24
52 8 21 24
53 8 20 28
54 4 15 16
55 20 30 20
56 8 24 29
57 8 26 27
58 6 24 22
59 4 22 28
60 8 14 16
61 9 24 25
62 6 24 24
63 7 24 28
64 9 24 24
65 5 19 23
66 5 31 30
67 8 22 24
68 8 27 21
69 6 19 25
70 8 25 25
71 7 20 22
72 7 21 23
73 9 27 26
74 11 23 23
75 6 25 25
76 8 20 21
77 6 21 25
78 9 22 24
79 8 23 29
80 6 25 22
81 10 25 27
82 8 17 26
83 8 19 22
84 10 25 24
85 5 19 27
86 7 20 24
87 5 26 24
88 8 23 29
89 14 27 22
90 7 17 21
91 8 17 24
92 6 19 24
93 5 17 23
94 6 22 20
95 10 21 27
96 12 32 26
97 9 21 25
98 12 21 21
99 7 18 21
100 8 18 19
101 10 23 21
102 6 19 21
103 10 20 16
104 10 21 22
105 10 20 29
106 5 17 15
107 7 18 17
108 10 19 15
109 11 22 21
110 6 15 21
111 7 14 19
112 12 18 24
113 11 24 20
114 11 35 17
115 11 29 23
116 5 21 24
117 8 25 14
118 6 20 19
119 9 22 24
120 4 13 13
121 4 26 22
122 7 17 16
123 11 25 19
124 6 20 25
125 7 19 25
126 8 21 23
127 4 22 24
128 8 24 26
129 9 21 26
130 8 26 25
131 11 24 18
132 8 16 21
133 5 23 26
134 4 18 23
135 8 16 23
136 10 26 22
137 6 19 20
138 9 21 13
139 9 21 24
140 13 22 15
141 9 23 14
142 10 29 22
143 20 21 10
144 5 21 24
145 11 23 22
146 6 27 24
147 9 25 19
148 7 21 20
149 9 10 13
150 10 20 20
151 9 26 22
152 8 24 24
153 7 29 29
154 6 19 12
155 13 24 20
156 6 19 21
157 8 24 24
158 10 22 22
159 16 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month Doubtsaboutactions
-20.5406 1.8521 0.8008
ParentalExpectations ParentalCriticism PersonalStandards
0.2339 0.2084 0.5713
Organization
-0.1083
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-12.0231 -2.5477 -0.3887 2.7002 12.4062
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -20.54062 19.25619 -1.067 0.2878
Month 1.85205 1.89629 0.977 0.3303
Doubtsaboutactions 0.80075 0.13071 6.126 7.37e-09 ***
ParentalExpectations 0.23389 0.13396 1.746 0.0828 .
ParentalCriticism 0.20845 0.16952 1.230 0.2207
PersonalStandards 0.57125 0.09597 5.952 1.76e-08 ***
Organization -0.10833 0.10332 -1.049 0.2960
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.478 on 152 degrees of freedom
Multiple R-squared: 0.4109, Adjusted R-squared: 0.3876
F-statistic: 17.67 on 6 and 152 DF, p-value: 1.807e-15
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.09706704 0.19413408 0.90293296
[2,] 0.35239373 0.70478746 0.64760627
[3,] 0.74156618 0.51686764 0.25843382
[4,] 0.75469718 0.49060563 0.24530282
[5,] 0.72544848 0.54910305 0.27455152
[6,] 0.72223313 0.55553375 0.27776687
[7,] 0.65232873 0.69534255 0.34767127
[8,] 0.57238676 0.85522649 0.42761324
[9,] 0.54185950 0.91628100 0.45814050
[10,] 0.47467688 0.94935376 0.52532312
[11,] 0.50584272 0.98831456 0.49415728
[12,] 0.45953680 0.91907360 0.54046320
[13,] 0.46150227 0.92300453 0.53849773
[14,] 0.39596743 0.79193486 0.60403257
[15,] 0.65039680 0.69920641 0.34960320
[16,] 0.58147041 0.83705918 0.41852959
[17,] 0.55296922 0.89406156 0.44703078
[18,] 0.48923338 0.97846677 0.51076662
[19,] 0.43944382 0.87888764 0.56055618
[20,] 0.37559732 0.75119464 0.62440268
[21,] 0.32027279 0.64054558 0.67972721
[22,] 0.36296208 0.72592416 0.63703792
[23,] 0.43846828 0.87693656 0.56153172
[24,] 0.39239087 0.78478175 0.60760913
[25,] 0.38617622 0.77235244 0.61382378
[26,] 0.40248223 0.80496447 0.59751777
[27,] 0.38317035 0.76634071 0.61682965
[28,] 0.53978898 0.92042205 0.46021102
[29,] 0.73767220 0.52465559 0.26232780
[30,] 0.72858217 0.54283566 0.27141783
[31,] 0.68684214 0.62631572 0.31315786
[32,] 0.65766200 0.68467599 0.34233800
[33,] 0.60574671 0.78850657 0.39425329
[34,] 0.55656401 0.88687198 0.44343599
[35,] 0.54185577 0.91628846 0.45814423
[36,] 0.51558758 0.96882483 0.48441242
[37,] 0.54692661 0.90614677 0.45307339
[38,] 0.50650358 0.98699283 0.49349642
[39,] 0.49152767 0.98305534 0.50847233
[40,] 0.54704241 0.90591518 0.45295759
[41,] 0.52249916 0.95500168 0.47750084
[42,] 0.48554144 0.97108289 0.51445856
[43,] 0.43683076 0.87366152 0.56316924
[44,] 0.39480406 0.78960812 0.60519594
[45,] 0.35025969 0.70051937 0.64974031
[46,] 0.31185243 0.62370487 0.68814757
[47,] 0.28222319 0.56444638 0.71777681
[48,] 0.24196538 0.48393076 0.75803462
[49,] 0.22024925 0.44049850 0.77975075
[50,] 0.20611693 0.41223385 0.79388307
[51,] 0.25873335 0.51746669 0.74126665
[52,] 0.25250093 0.50500186 0.74749907
[53,] 0.21659210 0.43318420 0.78340790
[54,] 0.20546032 0.41092064 0.79453968
[55,] 0.24631273 0.49262545 0.75368727
[56,] 0.32192359 0.64384717 0.67807641
[57,] 0.32025069 0.64050138 0.67974931
[58,] 0.64202235 0.71595529 0.35797765
[59,] 0.63720013 0.72559975 0.36279987
[60,] 0.82660200 0.34679601 0.17339800
[61,] 0.80682197 0.38635606 0.19317803
[62,] 0.91941617 0.16116767 0.08058383
[63,] 0.90097520 0.19804959 0.09902480
[64,] 0.92542465 0.14915070 0.07457535
[65,] 0.91183009 0.17633982 0.08816991
[66,] 0.91353332 0.17293336 0.08646668
[67,] 0.90561310 0.18877379 0.09438690
[68,] 0.96270941 0.07458118 0.03729059
[69,] 0.95393601 0.09212798 0.04606399
[70,] 0.94562529 0.10874942 0.05437471
[71,] 0.94857190 0.10285620 0.05142810
[72,] 0.93991599 0.12016803 0.06008401
[73,] 0.93851567 0.12296865 0.06148433
[74,] 0.92333853 0.15332294 0.07666147
[75,] 0.90882304 0.18235393 0.09117696
[76,] 0.89856158 0.20287684 0.10143842
[77,] 0.88109273 0.23781454 0.11890727
[78,] 0.85734244 0.28531513 0.14265756
[79,] 0.90926577 0.18146847 0.09073423
[80,] 0.89123240 0.21753520 0.10876760
[81,] 0.86929130 0.26141740 0.13070870
[82,] 0.87156054 0.25687892 0.12843946
[83,] 0.86081943 0.27836114 0.13918057
[84,] 0.83722873 0.32554254 0.16277127
[85,] 0.80797274 0.38405453 0.19202726
[86,] 0.77328209 0.45343581 0.22671791
[87,] 0.74204845 0.51590310 0.25795155
[88,] 0.76213180 0.47573640 0.23786820
[89,] 0.75606062 0.48787875 0.24393938
[90,] 0.71927514 0.56144972 0.28072486
[91,] 0.69370755 0.61258489 0.30629245
[92,] 0.64991342 0.70017315 0.35008658
[93,] 0.61043042 0.77913917 0.38956958
[94,] 0.57085821 0.85828358 0.42914179
[95,] 0.52840457 0.94319087 0.47159543
[96,] 0.48182389 0.96364778 0.51817611
[97,] 0.46241592 0.92483184 0.53758408
[98,] 0.45782797 0.91565594 0.54217203
[99,] 0.46789461 0.93578922 0.53210539
[100,] 0.41804847 0.83609694 0.58195153
[101,] 0.39467098 0.78934197 0.60532902
[102,] 0.35585164 0.71170328 0.64414836
[103,] 0.57522344 0.84955312 0.42477656
[104,] 0.56734387 0.86531226 0.43265613
[105,] 0.53938943 0.92122114 0.46061057
[106,] 0.75717030 0.48565940 0.24282970
[107,] 0.73299470 0.53401060 0.26700530
[108,] 0.72059395 0.55881210 0.27940605
[109,] 0.69173273 0.61653454 0.30826727
[110,] 0.64084905 0.71830189 0.35915095
[111,] 0.64975171 0.70049658 0.35024829
[112,] 0.70204716 0.59590567 0.29795284
[113,] 0.70661975 0.58676051 0.29338025
[114,] 0.71238355 0.57523290 0.28761645
[115,] 0.65917903 0.68164194 0.34082097
[116,] 0.70518925 0.58962151 0.29481075
[117,] 0.67534067 0.64931866 0.32465933
[118,] 0.66367758 0.67264485 0.33632242
[119,] 0.62718621 0.74562758 0.37281379
[120,] 0.59979980 0.80040039 0.40020020
[121,] 0.67066390 0.65867220 0.32933610
[122,] 0.61297507 0.77404986 0.38702493
[123,] 0.54863125 0.90273750 0.45136875
[124,] 0.54650453 0.90699095 0.45349547
[125,] 0.48506349 0.97012697 0.51493651
[126,] 0.44252424 0.88504848 0.55747576
[127,] 0.41362929 0.82725858 0.58637071
[128,] 0.41721696 0.83443392 0.58278304
[129,] 0.45709142 0.91418284 0.54290858
[130,] 0.38929874 0.77859749 0.61070126
[131,] 0.31719465 0.63438929 0.68280535
[132,] 0.41941613 0.83883226 0.58058387
[133,] 0.36506261 0.73012523 0.63493739
[134,] 0.29687686 0.59375371 0.70312314
[135,] 0.22285836 0.44571671 0.77714164
[136,] 0.26640171 0.53280342 0.73359829
[137,] 0.18372950 0.36745901 0.81627050
[138,] 0.23871943 0.47743885 0.76128057
[139,] 0.14757957 0.29515914 0.85242043
[140,] 0.07898494 0.15796988 0.92101506
> postscript(file="/var/www/html/rcomp/tmp/18wo21290545792.ps",horizontal=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/215nn1290545792.ps",horizontal=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/315nn1290545792.ps",horizontal=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/415nn1290545792.ps",horizontal=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/5temq1290545792.ps",horizontal=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 = 159
Frequency = 1
1 2 3 4 5 6
0.69408811 4.96946112 -4.00527578 -0.10546403 0.27422459 -1.82703401
7 8 9 10 11 12
-0.96693535 -6.51767552 -4.38569717 -3.57581934 0.58069901 7.68055849
13 14 15 16 17 18
7.77137671 -1.11044163 -6.78399128 -5.91547855 1.43143151 -0.32382215
19 20 21 22 23 24
0.21128754 4.56837584 1.69620929 6.87547798 1.25025920 10.01222876
25 26 27 28 29 30
-0.42022932 -4.30907860 -1.62698458 2.64295518 -0.02331013 -2.55378285
31 32 33 34 35 36
3.51728901 -5.58968526 -0.65673128 0.77657491 -6.04512289 4.10275890
37 38 39 40 41 42
9.24443844 -8.96879762 4.08795711 -0.92935724 1.91253029 -0.12677672
43 44 45 46 47 48
0.68077665 -4.76076184 -2.35476299 -5.54598776 -2.23190432 4.77384400
49 50 51 52 53 54
6.74870360 -3.63199176 2.66606191 -1.05720456 1.14663226 -0.85696625
55 56 57 58 59 60
-1.13915048 2.56770289 -0.38920753 -3.23775782 -3.59034866 -6.96354247
61 62 63 64 65 66
-3.87107184 -0.38870323 -3.99921280 -5.24685305 -7.96455011 4.60581516
67 68 69 70 71 72
12.40619043 -4.04360629 -11.12469898 -2.60148813 10.30657987 0.74458663
73 74 75 76 77 78
6.82183432 1.85873481 4.48135034 3.38828781 -9.76963062 -1.70695041
79 80 81 82 83 84
-2.59250840 5.02262243 -2.67176311 4.08062169 0.23247406 -1.89392211
85 86 87 88 89 90
2.96745118 0.18542022 -0.85497086 -7.96012365 0.71009260 1.31049001
91 92 93 94 95 96
4.75624604 -3.35922021 -1.15501795 0.85267448 0.08479277 2.13612459
97 98 99 100 101 102
5.76962058 4.17762418 1.53999288 3.08022747 0.55595949 -1.22130078
103 104 105 106 107 108
-1.40677745 -1.59169660 0.86894500 4.10825741 4.37519110 4.45949111
109 110 111 112 113 114
-0.28425421 -2.54157333 -1.59092003 9.68793401 0.67278402 -3.24025497
115 116 117 118 119 120
-12.02306579 -1.86499366 -2.19275652 -2.51055984 0.45765011 4.48897796
121 122 123 124 125 126
7.27162384 -5.03193828 -4.98078437 -0.75661293 -6.47064032 -1.93650740
127 128 129 130 131 132
-2.52611836 -1.92190240 -2.31752239 7.42500001 -1.88171532 -0.52595527
133 134 135 136 137 138
-2.12379490 0.88444207 3.88996089 -1.62117962 -3.13415781 -5.09349163
139 140 141 142 143 144
-1.46490065 -2.84873327 5.20640275 2.63528219 -5.88576450 -1.06691678
145 146 147 148 149 150
-4.41420063 1.56080646 7.73820727 0.95179764 1.82642044 2.99677648
151 152 153 154 155 156
-0.50317875 0.68819878 11.41637698 2.73439333 -5.71918980 -1.05670026
157 158 159
3.45916671 -2.16671583 4.88434024
> postscript(file="/var/www/html/rcomp/tmp/6temq1290545792.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 0.69408811 NA
1 4.96946112 0.69408811
2 -4.00527578 4.96946112
3 -0.10546403 -4.00527578
4 0.27422459 -0.10546403
5 -1.82703401 0.27422459
6 -0.96693535 -1.82703401
7 -6.51767552 -0.96693535
8 -4.38569717 -6.51767552
9 -3.57581934 -4.38569717
10 0.58069901 -3.57581934
11 7.68055849 0.58069901
12 7.77137671 7.68055849
13 -1.11044163 7.77137671
14 -6.78399128 -1.11044163
15 -5.91547855 -6.78399128
16 1.43143151 -5.91547855
17 -0.32382215 1.43143151
18 0.21128754 -0.32382215
19 4.56837584 0.21128754
20 1.69620929 4.56837584
21 6.87547798 1.69620929
22 1.25025920 6.87547798
23 10.01222876 1.25025920
24 -0.42022932 10.01222876
25 -4.30907860 -0.42022932
26 -1.62698458 -4.30907860
27 2.64295518 -1.62698458
28 -0.02331013 2.64295518
29 -2.55378285 -0.02331013
30 3.51728901 -2.55378285
31 -5.58968526 3.51728901
32 -0.65673128 -5.58968526
33 0.77657491 -0.65673128
34 -6.04512289 0.77657491
35 4.10275890 -6.04512289
36 9.24443844 4.10275890
37 -8.96879762 9.24443844
38 4.08795711 -8.96879762
39 -0.92935724 4.08795711
40 1.91253029 -0.92935724
41 -0.12677672 1.91253029
42 0.68077665 -0.12677672
43 -4.76076184 0.68077665
44 -2.35476299 -4.76076184
45 -5.54598776 -2.35476299
46 -2.23190432 -5.54598776
47 4.77384400 -2.23190432
48 6.74870360 4.77384400
49 -3.63199176 6.74870360
50 2.66606191 -3.63199176
51 -1.05720456 2.66606191
52 1.14663226 -1.05720456
53 -0.85696625 1.14663226
54 -1.13915048 -0.85696625
55 2.56770289 -1.13915048
56 -0.38920753 2.56770289
57 -3.23775782 -0.38920753
58 -3.59034866 -3.23775782
59 -6.96354247 -3.59034866
60 -3.87107184 -6.96354247
61 -0.38870323 -3.87107184
62 -3.99921280 -0.38870323
63 -5.24685305 -3.99921280
64 -7.96455011 -5.24685305
65 4.60581516 -7.96455011
66 12.40619043 4.60581516
67 -4.04360629 12.40619043
68 -11.12469898 -4.04360629
69 -2.60148813 -11.12469898
70 10.30657987 -2.60148813
71 0.74458663 10.30657987
72 6.82183432 0.74458663
73 1.85873481 6.82183432
74 4.48135034 1.85873481
75 3.38828781 4.48135034
76 -9.76963062 3.38828781
77 -1.70695041 -9.76963062
78 -2.59250840 -1.70695041
79 5.02262243 -2.59250840
80 -2.67176311 5.02262243
81 4.08062169 -2.67176311
82 0.23247406 4.08062169
83 -1.89392211 0.23247406
84 2.96745118 -1.89392211
85 0.18542022 2.96745118
86 -0.85497086 0.18542022
87 -7.96012365 -0.85497086
88 0.71009260 -7.96012365
89 1.31049001 0.71009260
90 4.75624604 1.31049001
91 -3.35922021 4.75624604
92 -1.15501795 -3.35922021
93 0.85267448 -1.15501795
94 0.08479277 0.85267448
95 2.13612459 0.08479277
96 5.76962058 2.13612459
97 4.17762418 5.76962058
98 1.53999288 4.17762418
99 3.08022747 1.53999288
100 0.55595949 3.08022747
101 -1.22130078 0.55595949
102 -1.40677745 -1.22130078
103 -1.59169660 -1.40677745
104 0.86894500 -1.59169660
105 4.10825741 0.86894500
106 4.37519110 4.10825741
107 4.45949111 4.37519110
108 -0.28425421 4.45949111
109 -2.54157333 -0.28425421
110 -1.59092003 -2.54157333
111 9.68793401 -1.59092003
112 0.67278402 9.68793401
113 -3.24025497 0.67278402
114 -12.02306579 -3.24025497
115 -1.86499366 -12.02306579
116 -2.19275652 -1.86499366
117 -2.51055984 -2.19275652
118 0.45765011 -2.51055984
119 4.48897796 0.45765011
120 7.27162384 4.48897796
121 -5.03193828 7.27162384
122 -4.98078437 -5.03193828
123 -0.75661293 -4.98078437
124 -6.47064032 -0.75661293
125 -1.93650740 -6.47064032
126 -2.52611836 -1.93650740
127 -1.92190240 -2.52611836
128 -2.31752239 -1.92190240
129 7.42500001 -2.31752239
130 -1.88171532 7.42500001
131 -0.52595527 -1.88171532
132 -2.12379490 -0.52595527
133 0.88444207 -2.12379490
134 3.88996089 0.88444207
135 -1.62117962 3.88996089
136 -3.13415781 -1.62117962
137 -5.09349163 -3.13415781
138 -1.46490065 -5.09349163
139 -2.84873327 -1.46490065
140 5.20640275 -2.84873327
141 2.63528219 5.20640275
142 -5.88576450 2.63528219
143 -1.06691678 -5.88576450
144 -4.41420063 -1.06691678
145 1.56080646 -4.41420063
146 7.73820727 1.56080646
147 0.95179764 7.73820727
148 1.82642044 0.95179764
149 2.99677648 1.82642044
150 -0.50317875 2.99677648
151 0.68819878 -0.50317875
152 11.41637698 0.68819878
153 2.73439333 11.41637698
154 -5.71918980 2.73439333
155 -1.05670026 -5.71918980
156 3.45916671 -1.05670026
157 -2.16671583 3.45916671
158 4.88434024 -2.16671583
159 NA 4.88434024
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 4.96946112 0.69408811
[2,] -4.00527578 4.96946112
[3,] -0.10546403 -4.00527578
[4,] 0.27422459 -0.10546403
[5,] -1.82703401 0.27422459
[6,] -0.96693535 -1.82703401
[7,] -6.51767552 -0.96693535
[8,] -4.38569717 -6.51767552
[9,] -3.57581934 -4.38569717
[10,] 0.58069901 -3.57581934
[11,] 7.68055849 0.58069901
[12,] 7.77137671 7.68055849
[13,] -1.11044163 7.77137671
[14,] -6.78399128 -1.11044163
[15,] -5.91547855 -6.78399128
[16,] 1.43143151 -5.91547855
[17,] -0.32382215 1.43143151
[18,] 0.21128754 -0.32382215
[19,] 4.56837584 0.21128754
[20,] 1.69620929 4.56837584
[21,] 6.87547798 1.69620929
[22,] 1.25025920 6.87547798
[23,] 10.01222876 1.25025920
[24,] -0.42022932 10.01222876
[25,] -4.30907860 -0.42022932
[26,] -1.62698458 -4.30907860
[27,] 2.64295518 -1.62698458
[28,] -0.02331013 2.64295518
[29,] -2.55378285 -0.02331013
[30,] 3.51728901 -2.55378285
[31,] -5.58968526 3.51728901
[32,] -0.65673128 -5.58968526
[33,] 0.77657491 -0.65673128
[34,] -6.04512289 0.77657491
[35,] 4.10275890 -6.04512289
[36,] 9.24443844 4.10275890
[37,] -8.96879762 9.24443844
[38,] 4.08795711 -8.96879762
[39,] -0.92935724 4.08795711
[40,] 1.91253029 -0.92935724
[41,] -0.12677672 1.91253029
[42,] 0.68077665 -0.12677672
[43,] -4.76076184 0.68077665
[44,] -2.35476299 -4.76076184
[45,] -5.54598776 -2.35476299
[46,] -2.23190432 -5.54598776
[47,] 4.77384400 -2.23190432
[48,] 6.74870360 4.77384400
[49,] -3.63199176 6.74870360
[50,] 2.66606191 -3.63199176
[51,] -1.05720456 2.66606191
[52,] 1.14663226 -1.05720456
[53,] -0.85696625 1.14663226
[54,] -1.13915048 -0.85696625
[55,] 2.56770289 -1.13915048
[56,] -0.38920753 2.56770289
[57,] -3.23775782 -0.38920753
[58,] -3.59034866 -3.23775782
[59,] -6.96354247 -3.59034866
[60,] -3.87107184 -6.96354247
[61,] -0.38870323 -3.87107184
[62,] -3.99921280 -0.38870323
[63,] -5.24685305 -3.99921280
[64,] -7.96455011 -5.24685305
[65,] 4.60581516 -7.96455011
[66,] 12.40619043 4.60581516
[67,] -4.04360629 12.40619043
[68,] -11.12469898 -4.04360629
[69,] -2.60148813 -11.12469898
[70,] 10.30657987 -2.60148813
[71,] 0.74458663 10.30657987
[72,] 6.82183432 0.74458663
[73,] 1.85873481 6.82183432
[74,] 4.48135034 1.85873481
[75,] 3.38828781 4.48135034
[76,] -9.76963062 3.38828781
[77,] -1.70695041 -9.76963062
[78,] -2.59250840 -1.70695041
[79,] 5.02262243 -2.59250840
[80,] -2.67176311 5.02262243
[81,] 4.08062169 -2.67176311
[82,] 0.23247406 4.08062169
[83,] -1.89392211 0.23247406
[84,] 2.96745118 -1.89392211
[85,] 0.18542022 2.96745118
[86,] -0.85497086 0.18542022
[87,] -7.96012365 -0.85497086
[88,] 0.71009260 -7.96012365
[89,] 1.31049001 0.71009260
[90,] 4.75624604 1.31049001
[91,] -3.35922021 4.75624604
[92,] -1.15501795 -3.35922021
[93,] 0.85267448 -1.15501795
[94,] 0.08479277 0.85267448
[95,] 2.13612459 0.08479277
[96,] 5.76962058 2.13612459
[97,] 4.17762418 5.76962058
[98,] 1.53999288 4.17762418
[99,] 3.08022747 1.53999288
[100,] 0.55595949 3.08022747
[101,] -1.22130078 0.55595949
[102,] -1.40677745 -1.22130078
[103,] -1.59169660 -1.40677745
[104,] 0.86894500 -1.59169660
[105,] 4.10825741 0.86894500
[106,] 4.37519110 4.10825741
[107,] 4.45949111 4.37519110
[108,] -0.28425421 4.45949111
[109,] -2.54157333 -0.28425421
[110,] -1.59092003 -2.54157333
[111,] 9.68793401 -1.59092003
[112,] 0.67278402 9.68793401
[113,] -3.24025497 0.67278402
[114,] -12.02306579 -3.24025497
[115,] -1.86499366 -12.02306579
[116,] -2.19275652 -1.86499366
[117,] -2.51055984 -2.19275652
[118,] 0.45765011 -2.51055984
[119,] 4.48897796 0.45765011
[120,] 7.27162384 4.48897796
[121,] -5.03193828 7.27162384
[122,] -4.98078437 -5.03193828
[123,] -0.75661293 -4.98078437
[124,] -6.47064032 -0.75661293
[125,] -1.93650740 -6.47064032
[126,] -2.52611836 -1.93650740
[127,] -1.92190240 -2.52611836
[128,] -2.31752239 -1.92190240
[129,] 7.42500001 -2.31752239
[130,] -1.88171532 7.42500001
[131,] -0.52595527 -1.88171532
[132,] -2.12379490 -0.52595527
[133,] 0.88444207 -2.12379490
[134,] 3.88996089 0.88444207
[135,] -1.62117962 3.88996089
[136,] -3.13415781 -1.62117962
[137,] -5.09349163 -3.13415781
[138,] -1.46490065 -5.09349163
[139,] -2.84873327 -1.46490065
[140,] 5.20640275 -2.84873327
[141,] 2.63528219 5.20640275
[142,] -5.88576450 2.63528219
[143,] -1.06691678 -5.88576450
[144,] -4.41420063 -1.06691678
[145,] 1.56080646 -4.41420063
[146,] 7.73820727 1.56080646
[147,] 0.95179764 7.73820727
[148,] 1.82642044 0.95179764
[149,] 2.99677648 1.82642044
[150,] -0.50317875 2.99677648
[151,] 0.68819878 -0.50317875
[152,] 11.41637698 0.68819878
[153,] 2.73439333 11.41637698
[154,] -5.71918980 2.73439333
[155,] -1.05670026 -5.71918980
[156,] 3.45916671 -1.05670026
[157,] -2.16671583 3.45916671
[158,] 4.88434024 -2.16671583
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 4.96946112 0.69408811
2 -4.00527578 4.96946112
3 -0.10546403 -4.00527578
4 0.27422459 -0.10546403
5 -1.82703401 0.27422459
6 -0.96693535 -1.82703401
7 -6.51767552 -0.96693535
8 -4.38569717 -6.51767552
9 -3.57581934 -4.38569717
10 0.58069901 -3.57581934
11 7.68055849 0.58069901
12 7.77137671 7.68055849
13 -1.11044163 7.77137671
14 -6.78399128 -1.11044163
15 -5.91547855 -6.78399128
16 1.43143151 -5.91547855
17 -0.32382215 1.43143151
18 0.21128754 -0.32382215
19 4.56837584 0.21128754
20 1.69620929 4.56837584
21 6.87547798 1.69620929
22 1.25025920 6.87547798
23 10.01222876 1.25025920
24 -0.42022932 10.01222876
25 -4.30907860 -0.42022932
26 -1.62698458 -4.30907860
27 2.64295518 -1.62698458
28 -0.02331013 2.64295518
29 -2.55378285 -0.02331013
30 3.51728901 -2.55378285
31 -5.58968526 3.51728901
32 -0.65673128 -5.58968526
33 0.77657491 -0.65673128
34 -6.04512289 0.77657491
35 4.10275890 -6.04512289
36 9.24443844 4.10275890
37 -8.96879762 9.24443844
38 4.08795711 -8.96879762
39 -0.92935724 4.08795711
40 1.91253029 -0.92935724
41 -0.12677672 1.91253029
42 0.68077665 -0.12677672
43 -4.76076184 0.68077665
44 -2.35476299 -4.76076184
45 -5.54598776 -2.35476299
46 -2.23190432 -5.54598776
47 4.77384400 -2.23190432
48 6.74870360 4.77384400
49 -3.63199176 6.74870360
50 2.66606191 -3.63199176
51 -1.05720456 2.66606191
52 1.14663226 -1.05720456
53 -0.85696625 1.14663226
54 -1.13915048 -0.85696625
55 2.56770289 -1.13915048
56 -0.38920753 2.56770289
57 -3.23775782 -0.38920753
58 -3.59034866 -3.23775782
59 -6.96354247 -3.59034866
60 -3.87107184 -6.96354247
61 -0.38870323 -3.87107184
62 -3.99921280 -0.38870323
63 -5.24685305 -3.99921280
64 -7.96455011 -5.24685305
65 4.60581516 -7.96455011
66 12.40619043 4.60581516
67 -4.04360629 12.40619043
68 -11.12469898 -4.04360629
69 -2.60148813 -11.12469898
70 10.30657987 -2.60148813
71 0.74458663 10.30657987
72 6.82183432 0.74458663
73 1.85873481 6.82183432
74 4.48135034 1.85873481
75 3.38828781 4.48135034
76 -9.76963062 3.38828781
77 -1.70695041 -9.76963062
78 -2.59250840 -1.70695041
79 5.02262243 -2.59250840
80 -2.67176311 5.02262243
81 4.08062169 -2.67176311
82 0.23247406 4.08062169
83 -1.89392211 0.23247406
84 2.96745118 -1.89392211
85 0.18542022 2.96745118
86 -0.85497086 0.18542022
87 -7.96012365 -0.85497086
88 0.71009260 -7.96012365
89 1.31049001 0.71009260
90 4.75624604 1.31049001
91 -3.35922021 4.75624604
92 -1.15501795 -3.35922021
93 0.85267448 -1.15501795
94 0.08479277 0.85267448
95 2.13612459 0.08479277
96 5.76962058 2.13612459
97 4.17762418 5.76962058
98 1.53999288 4.17762418
99 3.08022747 1.53999288
100 0.55595949 3.08022747
101 -1.22130078 0.55595949
102 -1.40677745 -1.22130078
103 -1.59169660 -1.40677745
104 0.86894500 -1.59169660
105 4.10825741 0.86894500
106 4.37519110 4.10825741
107 4.45949111 4.37519110
108 -0.28425421 4.45949111
109 -2.54157333 -0.28425421
110 -1.59092003 -2.54157333
111 9.68793401 -1.59092003
112 0.67278402 9.68793401
113 -3.24025497 0.67278402
114 -12.02306579 -3.24025497
115 -1.86499366 -12.02306579
116 -2.19275652 -1.86499366
117 -2.51055984 -2.19275652
118 0.45765011 -2.51055984
119 4.48897796 0.45765011
120 7.27162384 4.48897796
121 -5.03193828 7.27162384
122 -4.98078437 -5.03193828
123 -0.75661293 -4.98078437
124 -6.47064032 -0.75661293
125 -1.93650740 -6.47064032
126 -2.52611836 -1.93650740
127 -1.92190240 -2.52611836
128 -2.31752239 -1.92190240
129 7.42500001 -2.31752239
130 -1.88171532 7.42500001
131 -0.52595527 -1.88171532
132 -2.12379490 -0.52595527
133 0.88444207 -2.12379490
134 3.88996089 0.88444207
135 -1.62117962 3.88996089
136 -3.13415781 -1.62117962
137 -5.09349163 -3.13415781
138 -1.46490065 -5.09349163
139 -2.84873327 -1.46490065
140 5.20640275 -2.84873327
141 2.63528219 5.20640275
142 -5.88576450 2.63528219
143 -1.06691678 -5.88576450
144 -4.41420063 -1.06691678
145 1.56080646 -4.41420063
146 7.73820727 1.56080646
147 0.95179764 7.73820727
148 1.82642044 0.95179764
149 2.99677648 1.82642044
150 -0.50317875 2.99677648
151 0.68819878 -0.50317875
152 11.41637698 0.68819878
153 2.73439333 11.41637698
154 -5.71918980 2.73439333
155 -1.05670026 -5.71918980
156 3.45916671 -1.05670026
157 -2.16671583 3.45916671
158 4.88434024 -2.16671583
> 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/7momt1290545792.ps",horizontal=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/8momt1290545792.ps",horizontal=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/9ff3v1290545792.ps",horizontal=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/10ff3v1290545792.ps",horizontal=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/11ix111290545792.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/12lgi71290545792.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/13szfj1290545792.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/14l8wm1290545792.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/15orda1290545792.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/16k0s01290545792.tab")
+ }
>
> try(system("convert tmp/18wo21290545792.ps tmp/18wo21290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/215nn1290545792.ps tmp/215nn1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/315nn1290545792.ps tmp/315nn1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/415nn1290545792.ps tmp/415nn1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/5temq1290545792.ps tmp/5temq1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/6temq1290545792.ps tmp/6temq1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/7momt1290545792.ps tmp/7momt1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/8momt1290545792.ps tmp/8momt1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ff3v1290545792.ps tmp/9ff3v1290545792.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ff3v1290545792.ps tmp/10ff3v1290545792.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.094 1.707 21.959