R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(2
+ ,7
+ ,41
+ ,38
+ ,13
+ ,12
+ ,14
+ ,12
+ ,53
+ ,2
+ ,5
+ ,39
+ ,32
+ ,16
+ ,11
+ ,18
+ ,11
+ ,86
+ ,2
+ ,5
+ ,30
+ ,35
+ ,19
+ ,15
+ ,11
+ ,14
+ ,66
+ ,1
+ ,5
+ ,31
+ ,33
+ ,15
+ ,6
+ ,12
+ ,12
+ ,67
+ ,2
+ ,8
+ ,34
+ ,37
+ ,14
+ ,13
+ ,16
+ ,21
+ ,76
+ ,2
+ ,6
+ ,35
+ ,29
+ ,13
+ ,10
+ ,18
+ ,12
+ ,78
+ ,2
+ ,5
+ ,39
+ ,31
+ ,19
+ ,12
+ ,14
+ ,22
+ ,53
+ ,2
+ ,6
+ ,34
+ ,36
+ ,15
+ ,14
+ ,14
+ ,11
+ ,80
+ ,2
+ ,5
+ ,36
+ ,35
+ ,14
+ ,12
+ ,15
+ ,10
+ ,74
+ ,2
+ ,4
+ ,37
+ ,38
+ ,15
+ ,6
+ ,15
+ ,13
+ ,76
+ ,1
+ ,6
+ ,38
+ ,31
+ ,16
+ ,10
+ ,17
+ ,10
+ ,79
+ ,2
+ ,5
+ ,36
+ ,34
+ ,16
+ ,12
+ ,19
+ ,8
+ ,54
+ ,1
+ ,5
+ ,38
+ ,35
+ ,16
+ ,12
+ ,10
+ ,15
+ ,67
+ ,2
+ ,6
+ ,39
+ ,38
+ ,16
+ ,11
+ ,16
+ ,14
+ ,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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 = '5'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
Learning Gender Age Connected Separate Software Happiness Depression
1 13 2 7 41 38 12 14 12
2 16 2 5 39 32 11 18 11
3 19 2 5 30 35 15 11 14
4 15 1 5 31 33 6 12 12
5 14 2 8 34 37 13 16 21
6 13 2 6 35 29 10 18 12
7 19 2 5 39 31 12 14 22
8 15 2 6 34 36 14 14 11
9 14 2 5 36 35 12 15 10
10 15 2 4 37 38 6 15 13
11 16 1 6 38 31 10 17 10
12 16 2 5 36 34 12 19 8
13 16 1 5 38 35 12 10 15
14 16 2 6 39 38 11 16 14
15 17 2 7 33 37 15 18 10
16 15 1 6 32 33 12 14 14
17 15 1 7 36 32 10 14 14
18 20 2 6 38 38 12 17 11
19 18 1 8 39 38 11 14 10
20 16 2 7 32 32 12 16 13
21 16 1 5 32 33 11 18 7
22 16 2 5 31 31 12 11 14
23 19 2 7 39 38 13 14 12
24 16 2 7 37 39 11 12 14
25 17 1 5 39 32 9 17 11
26 17 2 4 41 32 13 9 9
27 16 1 10 36 35 10 16 11
28 15 2 6 33 37 14 14 15
29 16 2 5 33 33 12 15 14
30 14 1 5 34 33 10 11 13
31 15 2 5 31 28 12 16 9
32 12 1 5 27 32 8 13 15
33 14 2 6 37 31 10 17 10
34 16 2 5 34 37 12 15 11
35 14 1 5 34 30 12 14 13
36 7 1 5 32 33 7 16 8
37 10 1 5 29 31 6 9 20
38 14 1 5 36 33 12 15 12
39 16 2 5 29 31 10 17 10
40 16 1 5 35 33 10 13 10
41 16 1 5 37 32 10 15 9
42 14 2 7 34 33 12 16 14
43 20 1 5 38 32 15 16 8
44 14 1 6 35 33 10 12 14
45 14 2 7 38 28 10 12 11
46 11 2 7 37 35 12 11 13
47 14 2 5 38 39 13 15 9
48 15 2 5 33 34 11 15 11
49 16 2 4 36 38 11 17 15
50 14 1 5 38 32 12 13 11
51 16 2 4 32 38 14 16 10
52 14 1 5 32 30 10 14 14
53 12 1 5 32 33 12 11 18
54 16 2 7 34 38 13 12 14
55 9 1 5 32 32 5 12 11
56 14 2 5 37 32 6 15 12
57 16 2 6 39 34 12 16 13
58 16 2 4 29 34 12 15 9
59 15 1 6 37 36 11 12 10
60 16 2 6 35 34 10 12 15
61 12 1 5 30 28 7 8 20
62 16 1 7 38 34 12 13 12
63 16 2 6 34 35 14 11 12
64 14 2 8 31 35 11 14 14
65 16 2 7 34 31 12 15 13
66 17 1 5 35 37 13 10 11
67 18 2 6 36 35 14 11 17
68 18 1 6 30 27 11 12 12
69 12 2 5 39 40 12 15 13
70 16 1 5 35 37 12 15 14
71 10 1 5 38 36 8 14 13
72 14 2 5 31 38 11 16 15
73 18 2 4 34 39 14 15 13
74 18 1 6 38 41 14 15 10
75 16 1 6 34 27 12 13 11
76 17 2 6 39 30 9 12 19
77 16 2 6 37 37 13 17 13
78 16 2 7 34 31 11 13 17
79 13 1 5 28 31 12 15 13
80 16 1 7 37 27 12 13 9
81 16 1 6 33 36 12 15 11
82 20 1 5 37 38 12 16 10
83 16 2 5 35 37 12 15 9
84 15 1 4 37 33 12 16 12
85 15 2 8 32 34 11 15 12
86 16 2 8 33 31 10 14 13
87 14 1 5 38 39 9 15 13
88 16 2 5 33 34 12 14 12
89 16 2 6 29 32 12 13 15
90 15 2 4 33 33 12 7 22
91 12 2 5 31 36 9 17 13
92 17 2 5 36 32 15 13 15
93 16 2 5 35 41 12 15 13
94 15 2 5 32 28 12 14 15
95 13 2 6 29 30 12 13 10
96 16 2 6 39 36 10 16 11
97 16 2 5 37 35 13 12 16
98 16 2 6 35 31 9 14 11
99 16 1 5 37 34 12 17 11
100 14 1 7 32 36 10 15 10
101 16 2 5 38 36 14 17 10
102 16 1 6 37 35 11 12 16
103 20 2 6 36 37 15 16 12
104 15 1 6 32 28 11 11 11
105 16 2 4 33 39 11 15 16
106 13 1 5 40 32 12 9 19
107 17 2 5 38 35 12 16 11
108 16 1 7 41 39 12 15 16
109 16 1 6 36 35 11 10 15
110 12 2 9 43 42 7 10 24
111 16 2 6 30 34 12 15 14
112 16 2 6 31 33 14 11 15
113 17 2 5 32 41 11 13 11
114 13 1 6 32 33 11 14 15
115 12 2 5 37 34 10 18 12
116 18 1 8 37 32 13 16 10
117 14 2 7 33 40 13 14 14
118 14 2 5 34 40 8 14 13
119 13 2 7 33 35 11 14 9
120 16 2 6 38 36 12 14 15
121 13 2 6 33 37 11 12 15
122 16 2 9 31 27 13 14 14
123 13 2 7 38 39 12 15 11
124 16 2 6 37 38 14 15 8
125 15 2 5 33 31 13 15 11
126 16 2 5 31 33 15 13 11
127 15 1 6 39 32 10 17 8
128 17 2 6 44 39 11 17 10
129 15 2 7 33 36 9 19 11
130 12 2 5 35 33 11 15 13
131 16 1 5 32 33 10 13 11
132 10 1 5 28 32 11 9 20
133 16 2 6 40 37 8 15 10
134 12 1 4 27 30 11 15 15
135 14 1 5 37 38 12 15 12
136 15 2 7 32 29 12 16 14
137 13 1 5 28 22 9 11 23
138 15 1 7 34 35 11 14 14
139 11 2 7 30 35 10 11 16
140 12 2 6 35 34 8 15 11
141 8 1 5 31 35 9 13 12
142 16 2 8 32 34 8 15 10
143 15 1 5 30 34 9 16 14
144 17 2 5 30 35 15 14 12
145 16 1 5 31 23 11 15 12
146 10 2 6 40 31 8 16 11
147 18 2 4 32 27 13 16 12
148 13 1 5 36 36 12 11 13
149 16 1 5 32 31 12 12 11
150 13 1 7 35 32 9 9 19
151 10 2 6 38 39 7 16 12
152 15 2 7 42 37 13 13 17
153 16 1 10 34 38 9 16 9
154 16 2 6 35 39 6 12 12
155 14 2 8 35 34 8 9 19
156 10 2 4 33 31 8 13 18
157 17 2 5 36 32 15 13 15
158 13 2 6 32 37 6 14 14
159 15 2 7 33 36 9 19 11
160 16 2 7 34 32 11 13 9
161 12 2 6 32 35 8 12 18
162 13 2 6 34 36 8 13 16
Belonging
1 53
2 86
3 66
4 67
5 76
6 78
7 53
8 80
9 74
10 76
11 79
12 54
13 67
14 54
15 87
16 58
17 75
18 88
19 64
20 57
21 66
22 68
23 54
24 56
25 86
26 80
27 76
28 69
29 78
30 67
31 80
32 54
33 71
34 84
35 74
36 71
37 63
38 71
39 76
40 69
41 74
42 75
43 54
44 52
45 69
46 68
47 65
48 75
49 74
50 75
51 72
52 67
53 63
54 62
55 63
56 76
57 74
58 67
59 73
60 70
61 53
62 77
63 77
64 52
65 54
66 80
67 66
68 73
69 63
70 69
71 67
72 54
73 81
74 69
75 84
76 80
77 70
78 69
79 77
80 54
81 79
82 30
83 71
84 73
85 72
86 77
87 75
88 69
89 54
90 70
91 73
92 54
93 77
94 82
95 80
96 80
97 69
98 78
99 81
100 76
101 76
102 73
103 85
104 66
105 79
106 68
107 76
108 71
109 54
110 46
111 82
112 74
113 88
114 38
115 76
116 86
117 54
118 70
119 69
120 90
121 54
122 76
123 89
124 76
125 73
126 79
127 90
128 74
129 81
130 72
131 71
132 66
133 77
134 65
135 74
136 82
137 54
138 63
139 54
140 64
141 69
142 54
143 84
144 86
145 77
146 89
147 76
148 60
149 75
150 73
151 85
152 79
153 71
154 72
155 69
156 78
157 54
158 69
159 81
160 84
161 84
162 69
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gender Age Connected Separate Software
5.389942 0.108113 0.123741 0.110167 -0.029404 0.545975
Happiness Depression Belonging
0.055336 -0.082874 0.001622
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.8311 -1.1959 0.1376 1.0838 4.2674
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.389942 2.675479 2.015 0.0457 *
Gender 0.108113 0.327716 0.330 0.7419
Age 0.123741 0.128673 0.962 0.3377
Connected 0.110167 0.047418 2.323 0.0215 *
Separate -0.029404 0.045960 -0.640 0.5233
Software 0.545975 0.070236 7.773 1.04e-12 ***
Happiness 0.055336 0.078051 0.709 0.4794
Depression -0.082874 0.057370 -1.445 0.1506
Belonging 0.001622 0.014652 0.111 0.9120
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.854 on 153 degrees of freedom
Multiple R-squared: 0.3585, Adjusted R-squared: 0.3249
F-statistic: 10.69 on 8 and 153 DF, p-value: 7.1e-12
> 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.24306077 0.48612154 0.75693923
[2,] 0.40769039 0.81538078 0.59230961
[3,] 0.30927446 0.61854891 0.69072554
[4,] 0.32922097 0.65844194 0.67077903
[5,] 0.38410840 0.76821679 0.61589160
[6,] 0.33277726 0.66555452 0.66722274
[7,] 0.70223217 0.59553565 0.29776783
[8,] 0.85955874 0.28088251 0.14044126
[9,] 0.86124229 0.27751542 0.13875771
[10,] 0.81663959 0.36672083 0.18336041
[11,] 0.76578837 0.46842325 0.23421163
[12,] 0.81971949 0.36056103 0.18028051
[13,] 0.76771624 0.46456753 0.23228376
[14,] 0.73631724 0.52736551 0.26368276
[15,] 0.67449501 0.65100998 0.32550499
[16,] 0.64187902 0.71624197 0.35812098
[17,] 0.62717670 0.74564661 0.37282330
[18,] 0.56215958 0.87568083 0.43784042
[19,] 0.55787057 0.88425885 0.44212943
[20,] 0.49248858 0.98497717 0.50751142
[21,] 0.48050726 0.96101452 0.51949274
[22,] 0.43746596 0.87493192 0.56253404
[23,] 0.37733610 0.75467220 0.62266390
[24,] 0.37873013 0.75746026 0.62126987
[25,] 0.87467755 0.25064490 0.12532245
[26,] 0.86308013 0.27383973 0.13691987
[27,] 0.86380378 0.27239244 0.13619622
[28,] 0.87528266 0.24943467 0.12471734
[29,] 0.86090581 0.27818837 0.13909419
[30,] 0.83628732 0.32742536 0.16371268
[31,] 0.82449605 0.35100790 0.17550395
[32,] 0.82927000 0.34145999 0.17073000
[33,] 0.79630501 0.40738999 0.20369499
[34,] 0.76056750 0.47886500 0.23943250
[35,] 0.90566089 0.18867822 0.09433911
[36,] 0.93113267 0.13773466 0.06886733
[37,] 0.91221977 0.17556045 0.08778023
[38,] 0.89594426 0.20811148 0.10405574
[39,] 0.90118398 0.19763204 0.09881602
[40,] 0.87939326 0.24121349 0.12060674
[41,] 0.85252327 0.29495346 0.14747673
[42,] 0.87980262 0.24039476 0.12019738
[43,] 0.85460201 0.29079599 0.14539799
[44,] 0.86362898 0.27274204 0.13637102
[45,] 0.84860403 0.30279193 0.15139597
[46,] 0.81892408 0.36215184 0.18107592
[47,] 0.79671330 0.40657340 0.20328670
[48,] 0.76062435 0.47875131 0.23937565
[49,] 0.75769034 0.48461932 0.24230966
[50,] 0.72379152 0.55241695 0.27620848
[51,] 0.68219215 0.63561571 0.31780785
[52,] 0.64042251 0.71915497 0.35957749
[53,] 0.59890454 0.80219092 0.40109546
[54,] 0.55633638 0.88732724 0.44366362
[55,] 0.52712583 0.94574835 0.47287417
[56,] 0.51424632 0.97150737 0.48575368
[57,] 0.64848099 0.70303803 0.35151901
[58,] 0.77549348 0.44901304 0.22450652
[59,] 0.74370899 0.51258203 0.25629101
[60,] 0.81964338 0.36071323 0.18035662
[61,] 0.78711896 0.42576208 0.21288104
[62,] 0.77991622 0.44016755 0.22008378
[63,] 0.75530372 0.48939256 0.24469628
[64,] 0.71787167 0.56425665 0.28212833
[65,] 0.77585377 0.44829245 0.22414623
[66,] 0.74102528 0.51794944 0.25897472
[67,] 0.71904597 0.56190806 0.28095403
[68,] 0.71717608 0.56564783 0.28282392
[69,] 0.67677882 0.64644236 0.32322118
[70,] 0.63726214 0.72547572 0.36273786
[71,] 0.81013117 0.37973765 0.18986883
[72,] 0.77789106 0.44421787 0.22210894
[73,] 0.74965577 0.50068845 0.25034423
[74,] 0.71204011 0.57591977 0.28795989
[75,] 0.69420125 0.61159750 0.30579875
[76,] 0.65276889 0.69446222 0.34723111
[77,] 0.61600828 0.76798345 0.38399172
[78,] 0.59482168 0.81035663 0.40517832
[79,] 0.56974162 0.86051675 0.43025838
[80,] 0.54811036 0.90377927 0.45188964
[81,] 0.51250569 0.97498863 0.48749431
[82,] 0.47372580 0.94745159 0.52627420
[83,] 0.42836935 0.85673870 0.57163065
[84,] 0.44931098 0.89862197 0.55068902
[85,] 0.41509206 0.83018411 0.58490794
[86,] 0.37801627 0.75603253 0.62198373
[87,] 0.37886760 0.75773520 0.62113240
[88,] 0.33567568 0.67135135 0.66432432
[89,] 0.29874784 0.59749568 0.70125216
[90,] 0.26833705 0.53667410 0.73166295
[91,] 0.25276976 0.50553951 0.74723024
[92,] 0.30015205 0.60030409 0.69984795
[93,] 0.25954082 0.51908164 0.74045918
[94,] 0.27891161 0.55782322 0.72108839
[95,] 0.28096845 0.56193689 0.71903155
[96,] 0.26954066 0.53908133 0.73045934
[97,] 0.24245828 0.48491656 0.75754172
[98,] 0.24396197 0.48792394 0.75603803
[99,] 0.21868912 0.43737825 0.78131088
[100,] 0.19346224 0.38692449 0.80653776
[101,] 0.16220277 0.32440553 0.83779723
[102,] 0.20214204 0.40428408 0.79785796
[103,] 0.17658086 0.35316172 0.82341914
[104,] 0.20183687 0.40367373 0.79816313
[105,] 0.17871574 0.35743149 0.82128426
[106,] 0.15909792 0.31819585 0.84090208
[107,] 0.14823704 0.29647408 0.85176296
[108,] 0.16722934 0.33445867 0.83277066
[109,] 0.15802973 0.31605947 0.84197027
[110,] 0.13588379 0.27176759 0.86411621
[111,] 0.11539273 0.23078546 0.88460727
[112,] 0.13871167 0.27742334 0.86128833
[113,] 0.11610385 0.23220770 0.88389615
[114,] 0.09675450 0.19350899 0.90324550
[115,] 0.07678144 0.15356287 0.92321856
[116,] 0.05836727 0.11673453 0.94163273
[117,] 0.05516175 0.11032350 0.94483825
[118,] 0.04168182 0.08336364 0.95831818
[119,] 0.05033163 0.10066326 0.94966837
[120,] 0.05352071 0.10704142 0.94647929
[121,] 0.06784596 0.13569192 0.93215404
[122,] 0.09207922 0.18415843 0.90792078
[123,] 0.08711824 0.17423647 0.91288176
[124,] 0.06722650 0.13445301 0.93277350
[125,] 0.05995811 0.11991622 0.94004189
[126,] 0.04214501 0.08429002 0.95785499
[127,] 0.02912354 0.05824709 0.97087646
[128,] 0.11210139 0.22420277 0.88789861
[129,] 0.09693101 0.19386202 0.90306899
[130,] 0.59719229 0.80561541 0.40280771
[131,] 0.55738912 0.88522175 0.44261088
[132,] 0.61142863 0.77714274 0.38857137
[133,] 0.53509396 0.92981209 0.46490604
[134,] 0.50884662 0.98230676 0.49115338
[135,] 0.48580895 0.97161791 0.51419105
[136,] 0.57308591 0.85382818 0.42691409
[137,] 0.71716155 0.56567689 0.28283845
[138,] 0.57868002 0.84263996 0.42131998
[139,] 0.50195129 0.99609743 0.49804871
> postscript(file="/var/fisher/rcomp/tmp/1vzfe1355159593.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/fisher/rcomp/tmp/2lug81355159593.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/fisher/rcomp/tmp/3muz01355159593.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/fisher/rcomp/tmp/4b7a51355159593.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/fisher/rcomp/tmp/5s36r1355159593.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 = 162
Frequency = 1
1 2 3 4 5 6
-3.289728550 0.189909170 2.754130778 3.384335608 -1.619784661 -1.939553204
7 8 9 10 11 12
3.801000688 -1.672232757 -1.834759651 2.788250988 0.784832510 -0.218821112
13 14 15 16 17 18
0.755419036 0.653775653 -0.517946885 -0.055749549 0.414818207 3.858874541
19 20 21 22 23 24
2.277365963 0.491068639 0.799533240 1.161029671 2.383009322 0.997872174
25 26 27 28 29 30
2.445307177 0.343372488 0.770890256 -1.183328745 0.761942734 0.008145766
31 32 33 34 35 36
-0.637689296 -0.081981934 -1.200140144 0.511038880 -1.349373464 -5.831131227
37 38 39 40 41 42
-0.618653095 -1.614841385 1.796829367 1.535442338 1.084050805 -1.646177940
43 44 45 46 47 48
2.138234389 -0.173899866 -1.159462984 -4.712714688 -2.551732712 0.093564590
49 50 51 52 53 54
1.226864273 -1.843267785 -0.326180922 0.057135189 -2.442613783 0.197290609
55 56 57 58 59 60
-2.285647624 1.405214143 -0.125120349 0.959225320 -0.217547629 1.801074686
61 62 63 64 65 66
0.708546873 0.047687179 -0.447890020 -0.686666432 0.301531755 1.246176203
67 68 69 70 71 72
1.763982980 3.454736741 -3.751783161 0.781931005 -3.418370048 -0.258272769
73 74 75 76 77 78
1.772250842 1.021858698 0.312046053 3.104045075 -0.411399197 1.265348280
79 80 81 82 83 84
-1.719168360 -0.259294257 0.584282227 4.267414248 0.256205844 -0.659846263
85 86 87 88 89 90
-0.079753697 1.397944320 0.055557088 0.695529605 1.281931295 1.004334498
91 92 93 94 95 96
-1.477025779 -0.003420466 0.695585454 -0.143185295 -2.233407935 0.850158548
97 98 99 100 101 102
0.180457250 1.803698312 0.094633079 -0.415351719 -1.231554357 1.250291390
103 104 105 106 107 108
2.554955913 0.247619957 1.772206272 -2.167916628 0.969200825 0.094757410
109 110 111 112 113 114
1.419067927 -0.682877661 0.991619519 0.077290204 2.499147143 -1.394468020
115 116 117 118 119 120
-2.885884543 1.082980975 -1.731433565 1.026934689 -2.225196243 0.294326683
121 122 123 124 125 126
-1.410408388 -0.176505711 -3.126413127 -1.241397238 -1.083352105 -0.795218134
127 128 129 130 131 132
-0.479516720 0.713079858 0.765764830 -2.985560617 1.945573958 -3.213820295
133 134 135 136 137 138
1.838671341 -1.783481528 -1.582855327 -0.554809914 0.741502171 0.196848498
139 140 141 142 143 144
-2.578271601 -1.594748899 -5.253360081 2.421612355 1.802818414 0.389942450
145 146 147 148 149 150
1.178202337 -4.329672369 2.055614769 -2.204575037 0.843666797 -0.234748635
151 152 153 154 155 156
-3.238774327 -1.547732201 1.467770549 3.880126457 1.144665472 -2.547057993
157 158 159 160 161 162
-0.003420466 1.211761172 0.765764830 0.607436833 -0.521153278 0.091157699
> postscript(file="/var/fisher/rcomp/tmp/607vd1355159593.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -3.289728550 NA
1 0.189909170 -3.289728550
2 2.754130778 0.189909170
3 3.384335608 2.754130778
4 -1.619784661 3.384335608
5 -1.939553204 -1.619784661
6 3.801000688 -1.939553204
7 -1.672232757 3.801000688
8 -1.834759651 -1.672232757
9 2.788250988 -1.834759651
10 0.784832510 2.788250988
11 -0.218821112 0.784832510
12 0.755419036 -0.218821112
13 0.653775653 0.755419036
14 -0.517946885 0.653775653
15 -0.055749549 -0.517946885
16 0.414818207 -0.055749549
17 3.858874541 0.414818207
18 2.277365963 3.858874541
19 0.491068639 2.277365963
20 0.799533240 0.491068639
21 1.161029671 0.799533240
22 2.383009322 1.161029671
23 0.997872174 2.383009322
24 2.445307177 0.997872174
25 0.343372488 2.445307177
26 0.770890256 0.343372488
27 -1.183328745 0.770890256
28 0.761942734 -1.183328745
29 0.008145766 0.761942734
30 -0.637689296 0.008145766
31 -0.081981934 -0.637689296
32 -1.200140144 -0.081981934
33 0.511038880 -1.200140144
34 -1.349373464 0.511038880
35 -5.831131227 -1.349373464
36 -0.618653095 -5.831131227
37 -1.614841385 -0.618653095
38 1.796829367 -1.614841385
39 1.535442338 1.796829367
40 1.084050805 1.535442338
41 -1.646177940 1.084050805
42 2.138234389 -1.646177940
43 -0.173899866 2.138234389
44 -1.159462984 -0.173899866
45 -4.712714688 -1.159462984
46 -2.551732712 -4.712714688
47 0.093564590 -2.551732712
48 1.226864273 0.093564590
49 -1.843267785 1.226864273
50 -0.326180922 -1.843267785
51 0.057135189 -0.326180922
52 -2.442613783 0.057135189
53 0.197290609 -2.442613783
54 -2.285647624 0.197290609
55 1.405214143 -2.285647624
56 -0.125120349 1.405214143
57 0.959225320 -0.125120349
58 -0.217547629 0.959225320
59 1.801074686 -0.217547629
60 0.708546873 1.801074686
61 0.047687179 0.708546873
62 -0.447890020 0.047687179
63 -0.686666432 -0.447890020
64 0.301531755 -0.686666432
65 1.246176203 0.301531755
66 1.763982980 1.246176203
67 3.454736741 1.763982980
68 -3.751783161 3.454736741
69 0.781931005 -3.751783161
70 -3.418370048 0.781931005
71 -0.258272769 -3.418370048
72 1.772250842 -0.258272769
73 1.021858698 1.772250842
74 0.312046053 1.021858698
75 3.104045075 0.312046053
76 -0.411399197 3.104045075
77 1.265348280 -0.411399197
78 -1.719168360 1.265348280
79 -0.259294257 -1.719168360
80 0.584282227 -0.259294257
81 4.267414248 0.584282227
82 0.256205844 4.267414248
83 -0.659846263 0.256205844
84 -0.079753697 -0.659846263
85 1.397944320 -0.079753697
86 0.055557088 1.397944320
87 0.695529605 0.055557088
88 1.281931295 0.695529605
89 1.004334498 1.281931295
90 -1.477025779 1.004334498
91 -0.003420466 -1.477025779
92 0.695585454 -0.003420466
93 -0.143185295 0.695585454
94 -2.233407935 -0.143185295
95 0.850158548 -2.233407935
96 0.180457250 0.850158548
97 1.803698312 0.180457250
98 0.094633079 1.803698312
99 -0.415351719 0.094633079
100 -1.231554357 -0.415351719
101 1.250291390 -1.231554357
102 2.554955913 1.250291390
103 0.247619957 2.554955913
104 1.772206272 0.247619957
105 -2.167916628 1.772206272
106 0.969200825 -2.167916628
107 0.094757410 0.969200825
108 1.419067927 0.094757410
109 -0.682877661 1.419067927
110 0.991619519 -0.682877661
111 0.077290204 0.991619519
112 2.499147143 0.077290204
113 -1.394468020 2.499147143
114 -2.885884543 -1.394468020
115 1.082980975 -2.885884543
116 -1.731433565 1.082980975
117 1.026934689 -1.731433565
118 -2.225196243 1.026934689
119 0.294326683 -2.225196243
120 -1.410408388 0.294326683
121 -0.176505711 -1.410408388
122 -3.126413127 -0.176505711
123 -1.241397238 -3.126413127
124 -1.083352105 -1.241397238
125 -0.795218134 -1.083352105
126 -0.479516720 -0.795218134
127 0.713079858 -0.479516720
128 0.765764830 0.713079858
129 -2.985560617 0.765764830
130 1.945573958 -2.985560617
131 -3.213820295 1.945573958
132 1.838671341 -3.213820295
133 -1.783481528 1.838671341
134 -1.582855327 -1.783481528
135 -0.554809914 -1.582855327
136 0.741502171 -0.554809914
137 0.196848498 0.741502171
138 -2.578271601 0.196848498
139 -1.594748899 -2.578271601
140 -5.253360081 -1.594748899
141 2.421612355 -5.253360081
142 1.802818414 2.421612355
143 0.389942450 1.802818414
144 1.178202337 0.389942450
145 -4.329672369 1.178202337
146 2.055614769 -4.329672369
147 -2.204575037 2.055614769
148 0.843666797 -2.204575037
149 -0.234748635 0.843666797
150 -3.238774327 -0.234748635
151 -1.547732201 -3.238774327
152 1.467770549 -1.547732201
153 3.880126457 1.467770549
154 1.144665472 3.880126457
155 -2.547057993 1.144665472
156 -0.003420466 -2.547057993
157 1.211761172 -0.003420466
158 0.765764830 1.211761172
159 0.607436833 0.765764830
160 -0.521153278 0.607436833
161 0.091157699 -0.521153278
162 NA 0.091157699
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.189909170 -3.289728550
[2,] 2.754130778 0.189909170
[3,] 3.384335608 2.754130778
[4,] -1.619784661 3.384335608
[5,] -1.939553204 -1.619784661
[6,] 3.801000688 -1.939553204
[7,] -1.672232757 3.801000688
[8,] -1.834759651 -1.672232757
[9,] 2.788250988 -1.834759651
[10,] 0.784832510 2.788250988
[11,] -0.218821112 0.784832510
[12,] 0.755419036 -0.218821112
[13,] 0.653775653 0.755419036
[14,] -0.517946885 0.653775653
[15,] -0.055749549 -0.517946885
[16,] 0.414818207 -0.055749549
[17,] 3.858874541 0.414818207
[18,] 2.277365963 3.858874541
[19,] 0.491068639 2.277365963
[20,] 0.799533240 0.491068639
[21,] 1.161029671 0.799533240
[22,] 2.383009322 1.161029671
[23,] 0.997872174 2.383009322
[24,] 2.445307177 0.997872174
[25,] 0.343372488 2.445307177
[26,] 0.770890256 0.343372488
[27,] -1.183328745 0.770890256
[28,] 0.761942734 -1.183328745
[29,] 0.008145766 0.761942734
[30,] -0.637689296 0.008145766
[31,] -0.081981934 -0.637689296
[32,] -1.200140144 -0.081981934
[33,] 0.511038880 -1.200140144
[34,] -1.349373464 0.511038880
[35,] -5.831131227 -1.349373464
[36,] -0.618653095 -5.831131227
[37,] -1.614841385 -0.618653095
[38,] 1.796829367 -1.614841385
[39,] 1.535442338 1.796829367
[40,] 1.084050805 1.535442338
[41,] -1.646177940 1.084050805
[42,] 2.138234389 -1.646177940
[43,] -0.173899866 2.138234389
[44,] -1.159462984 -0.173899866
[45,] -4.712714688 -1.159462984
[46,] -2.551732712 -4.712714688
[47,] 0.093564590 -2.551732712
[48,] 1.226864273 0.093564590
[49,] -1.843267785 1.226864273
[50,] -0.326180922 -1.843267785
[51,] 0.057135189 -0.326180922
[52,] -2.442613783 0.057135189
[53,] 0.197290609 -2.442613783
[54,] -2.285647624 0.197290609
[55,] 1.405214143 -2.285647624
[56,] -0.125120349 1.405214143
[57,] 0.959225320 -0.125120349
[58,] -0.217547629 0.959225320
[59,] 1.801074686 -0.217547629
[60,] 0.708546873 1.801074686
[61,] 0.047687179 0.708546873
[62,] -0.447890020 0.047687179
[63,] -0.686666432 -0.447890020
[64,] 0.301531755 -0.686666432
[65,] 1.246176203 0.301531755
[66,] 1.763982980 1.246176203
[67,] 3.454736741 1.763982980
[68,] -3.751783161 3.454736741
[69,] 0.781931005 -3.751783161
[70,] -3.418370048 0.781931005
[71,] -0.258272769 -3.418370048
[72,] 1.772250842 -0.258272769
[73,] 1.021858698 1.772250842
[74,] 0.312046053 1.021858698
[75,] 3.104045075 0.312046053
[76,] -0.411399197 3.104045075
[77,] 1.265348280 -0.411399197
[78,] -1.719168360 1.265348280
[79,] -0.259294257 -1.719168360
[80,] 0.584282227 -0.259294257
[81,] 4.267414248 0.584282227
[82,] 0.256205844 4.267414248
[83,] -0.659846263 0.256205844
[84,] -0.079753697 -0.659846263
[85,] 1.397944320 -0.079753697
[86,] 0.055557088 1.397944320
[87,] 0.695529605 0.055557088
[88,] 1.281931295 0.695529605
[89,] 1.004334498 1.281931295
[90,] -1.477025779 1.004334498
[91,] -0.003420466 -1.477025779
[92,] 0.695585454 -0.003420466
[93,] -0.143185295 0.695585454
[94,] -2.233407935 -0.143185295
[95,] 0.850158548 -2.233407935
[96,] 0.180457250 0.850158548
[97,] 1.803698312 0.180457250
[98,] 0.094633079 1.803698312
[99,] -0.415351719 0.094633079
[100,] -1.231554357 -0.415351719
[101,] 1.250291390 -1.231554357
[102,] 2.554955913 1.250291390
[103,] 0.247619957 2.554955913
[104,] 1.772206272 0.247619957
[105,] -2.167916628 1.772206272
[106,] 0.969200825 -2.167916628
[107,] 0.094757410 0.969200825
[108,] 1.419067927 0.094757410
[109,] -0.682877661 1.419067927
[110,] 0.991619519 -0.682877661
[111,] 0.077290204 0.991619519
[112,] 2.499147143 0.077290204
[113,] -1.394468020 2.499147143
[114,] -2.885884543 -1.394468020
[115,] 1.082980975 -2.885884543
[116,] -1.731433565 1.082980975
[117,] 1.026934689 -1.731433565
[118,] -2.225196243 1.026934689
[119,] 0.294326683 -2.225196243
[120,] -1.410408388 0.294326683
[121,] -0.176505711 -1.410408388
[122,] -3.126413127 -0.176505711
[123,] -1.241397238 -3.126413127
[124,] -1.083352105 -1.241397238
[125,] -0.795218134 -1.083352105
[126,] -0.479516720 -0.795218134
[127,] 0.713079858 -0.479516720
[128,] 0.765764830 0.713079858
[129,] -2.985560617 0.765764830
[130,] 1.945573958 -2.985560617
[131,] -3.213820295 1.945573958
[132,] 1.838671341 -3.213820295
[133,] -1.783481528 1.838671341
[134,] -1.582855327 -1.783481528
[135,] -0.554809914 -1.582855327
[136,] 0.741502171 -0.554809914
[137,] 0.196848498 0.741502171
[138,] -2.578271601 0.196848498
[139,] -1.594748899 -2.578271601
[140,] -5.253360081 -1.594748899
[141,] 2.421612355 -5.253360081
[142,] 1.802818414 2.421612355
[143,] 0.389942450 1.802818414
[144,] 1.178202337 0.389942450
[145,] -4.329672369 1.178202337
[146,] 2.055614769 -4.329672369
[147,] -2.204575037 2.055614769
[148,] 0.843666797 -2.204575037
[149,] -0.234748635 0.843666797
[150,] -3.238774327 -0.234748635
[151,] -1.547732201 -3.238774327
[152,] 1.467770549 -1.547732201
[153,] 3.880126457 1.467770549
[154,] 1.144665472 3.880126457
[155,] -2.547057993 1.144665472
[156,] -0.003420466 -2.547057993
[157,] 1.211761172 -0.003420466
[158,] 0.765764830 1.211761172
[159,] 0.607436833 0.765764830
[160,] -0.521153278 0.607436833
[161,] 0.091157699 -0.521153278
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.189909170 -3.289728550
2 2.754130778 0.189909170
3 3.384335608 2.754130778
4 -1.619784661 3.384335608
5 -1.939553204 -1.619784661
6 3.801000688 -1.939553204
7 -1.672232757 3.801000688
8 -1.834759651 -1.672232757
9 2.788250988 -1.834759651
10 0.784832510 2.788250988
11 -0.218821112 0.784832510
12 0.755419036 -0.218821112
13 0.653775653 0.755419036
14 -0.517946885 0.653775653
15 -0.055749549 -0.517946885
16 0.414818207 -0.055749549
17 3.858874541 0.414818207
18 2.277365963 3.858874541
19 0.491068639 2.277365963
20 0.799533240 0.491068639
21 1.161029671 0.799533240
22 2.383009322 1.161029671
23 0.997872174 2.383009322
24 2.445307177 0.997872174
25 0.343372488 2.445307177
26 0.770890256 0.343372488
27 -1.183328745 0.770890256
28 0.761942734 -1.183328745
29 0.008145766 0.761942734
30 -0.637689296 0.008145766
31 -0.081981934 -0.637689296
32 -1.200140144 -0.081981934
33 0.511038880 -1.200140144
34 -1.349373464 0.511038880
35 -5.831131227 -1.349373464
36 -0.618653095 -5.831131227
37 -1.614841385 -0.618653095
38 1.796829367 -1.614841385
39 1.535442338 1.796829367
40 1.084050805 1.535442338
41 -1.646177940 1.084050805
42 2.138234389 -1.646177940
43 -0.173899866 2.138234389
44 -1.159462984 -0.173899866
45 -4.712714688 -1.159462984
46 -2.551732712 -4.712714688
47 0.093564590 -2.551732712
48 1.226864273 0.093564590
49 -1.843267785 1.226864273
50 -0.326180922 -1.843267785
51 0.057135189 -0.326180922
52 -2.442613783 0.057135189
53 0.197290609 -2.442613783
54 -2.285647624 0.197290609
55 1.405214143 -2.285647624
56 -0.125120349 1.405214143
57 0.959225320 -0.125120349
58 -0.217547629 0.959225320
59 1.801074686 -0.217547629
60 0.708546873 1.801074686
61 0.047687179 0.708546873
62 -0.447890020 0.047687179
63 -0.686666432 -0.447890020
64 0.301531755 -0.686666432
65 1.246176203 0.301531755
66 1.763982980 1.246176203
67 3.454736741 1.763982980
68 -3.751783161 3.454736741
69 0.781931005 -3.751783161
70 -3.418370048 0.781931005
71 -0.258272769 -3.418370048
72 1.772250842 -0.258272769
73 1.021858698 1.772250842
74 0.312046053 1.021858698
75 3.104045075 0.312046053
76 -0.411399197 3.104045075
77 1.265348280 -0.411399197
78 -1.719168360 1.265348280
79 -0.259294257 -1.719168360
80 0.584282227 -0.259294257
81 4.267414248 0.584282227
82 0.256205844 4.267414248
83 -0.659846263 0.256205844
84 -0.079753697 -0.659846263
85 1.397944320 -0.079753697
86 0.055557088 1.397944320
87 0.695529605 0.055557088
88 1.281931295 0.695529605
89 1.004334498 1.281931295
90 -1.477025779 1.004334498
91 -0.003420466 -1.477025779
92 0.695585454 -0.003420466
93 -0.143185295 0.695585454
94 -2.233407935 -0.143185295
95 0.850158548 -2.233407935
96 0.180457250 0.850158548
97 1.803698312 0.180457250
98 0.094633079 1.803698312
99 -0.415351719 0.094633079
100 -1.231554357 -0.415351719
101 1.250291390 -1.231554357
102 2.554955913 1.250291390
103 0.247619957 2.554955913
104 1.772206272 0.247619957
105 -2.167916628 1.772206272
106 0.969200825 -2.167916628
107 0.094757410 0.969200825
108 1.419067927 0.094757410
109 -0.682877661 1.419067927
110 0.991619519 -0.682877661
111 0.077290204 0.991619519
112 2.499147143 0.077290204
113 -1.394468020 2.499147143
114 -2.885884543 -1.394468020
115 1.082980975 -2.885884543
116 -1.731433565 1.082980975
117 1.026934689 -1.731433565
118 -2.225196243 1.026934689
119 0.294326683 -2.225196243
120 -1.410408388 0.294326683
121 -0.176505711 -1.410408388
122 -3.126413127 -0.176505711
123 -1.241397238 -3.126413127
124 -1.083352105 -1.241397238
125 -0.795218134 -1.083352105
126 -0.479516720 -0.795218134
127 0.713079858 -0.479516720
128 0.765764830 0.713079858
129 -2.985560617 0.765764830
130 1.945573958 -2.985560617
131 -3.213820295 1.945573958
132 1.838671341 -3.213820295
133 -1.783481528 1.838671341
134 -1.582855327 -1.783481528
135 -0.554809914 -1.582855327
136 0.741502171 -0.554809914
137 0.196848498 0.741502171
138 -2.578271601 0.196848498
139 -1.594748899 -2.578271601
140 -5.253360081 -1.594748899
141 2.421612355 -5.253360081
142 1.802818414 2.421612355
143 0.389942450 1.802818414
144 1.178202337 0.389942450
145 -4.329672369 1.178202337
146 2.055614769 -4.329672369
147 -2.204575037 2.055614769
148 0.843666797 -2.204575037
149 -0.234748635 0.843666797
150 -3.238774327 -0.234748635
151 -1.547732201 -3.238774327
152 1.467770549 -1.547732201
153 3.880126457 1.467770549
154 1.144665472 3.880126457
155 -2.547057993 1.144665472
156 -0.003420466 -2.547057993
157 1.211761172 -0.003420466
158 0.765764830 1.211761172
159 0.607436833 0.765764830
160 -0.521153278 0.607436833
161 0.091157699 -0.521153278
> 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/fisher/rcomp/tmp/7q9871355159593.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/fisher/rcomp/tmp/8iib81355159593.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/fisher/rcomp/tmp/9yeoq1355159593.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/fisher/rcomp/tmp/10gu4g1355159593.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/1152el1355159593.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/fisher/rcomp/tmp/12tkg51355159593.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/fisher/rcomp/tmp/13lrg01355159593.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/fisher/rcomp/tmp/14md661355159593.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/fisher/rcomp/tmp/1565xr1355159593.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/fisher/rcomp/tmp/16s1oa1355159594.tab")
+ }
>
> try(system("convert tmp/1vzfe1355159593.ps tmp/1vzfe1355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/2lug81355159593.ps tmp/2lug81355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/3muz01355159593.ps tmp/3muz01355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/4b7a51355159593.ps tmp/4b7a51355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/5s36r1355159593.ps tmp/5s36r1355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/607vd1355159593.ps tmp/607vd1355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/7q9871355159593.ps tmp/7q9871355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/8iib81355159593.ps tmp/8iib81355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/9yeoq1355159593.ps tmp/9yeoq1355159593.png",intern=TRUE))
character(0)
> try(system("convert tmp/10gu4g1355159593.ps tmp/10gu4g1355159593.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.148 1.540 9.753