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(41
+ ,38
+ ,13
+ ,12
+ ,14
+ ,12
+ ,53
+ ,39
+ ,32
+ ,16
+ ,11
+ ,18
+ ,11
+ ,86
+ ,30
+ ,35
+ ,19
+ ,15
+ ,11
+ ,14
+ ,66
+ ,31
+ ,33
+ ,15
+ ,6
+ ,12
+ ,12
+ ,67
+ ,34
+ ,37
+ ,14
+ ,13
+ ,16
+ ,21
+ ,76
+ ,35
+ ,29
+ ,13
+ ,10
+ ,18
+ ,12
+ ,78
+ ,39
+ ,31
+ ,19
+ ,12
+ ,14
+ ,22
+ ,53
+ ,34
+ ,36
+ ,15
+ ,14
+ ,14
+ ,11
+ ,80
+ ,36
+ ,35
+ ,14
+ ,12
+ ,15
+ ,10
+ ,74
+ ,37
+ ,38
+ ,15
+ ,6
+ ,15
+ ,13
+ ,76
+ ,38
+ ,31
+ ,16
+ ,10
+ ,17
+ ,10
+ ,79
+ ,36
+ ,34
+ ,16
+ ,12
+ ,19
+ ,8
+ ,54
+ ,38
+ ,35
+ ,16
+ ,12
+ ,10
+ ,15
+ ,67
+ ,39
+ ,38
+ ,16
+ ,11
+ ,16
+ ,14
+ ,54
+ ,33
+ ,37
+ ,17
+ ,15
+ ,18
+ ,10
+ ,87
+ ,32
+ ,33
+ ,15
+ ,12
+ ,14
+ ,14
+ ,58
+ ,36
+ ,32
+ ,15
+ ,10
+ ,14
+ ,14
+ ,75
+ ,38
+ ,38
+ ,20
+ ,12
+ ,17
+ ,11
+ ,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onging')
+ ,1:162))
> y <- array(NA,dim=c(7,162),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging'),1:162))
> 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 = '3'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '3'
> #'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, 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 Connected Separate Software Happiness Depression Belonging
1 13 41 38 12 14 12 53
2 16 39 32 11 18 11 86
3 19 30 35 15 11 14 66
4 15 31 33 6 12 12 67
5 14 34 37 13 16 21 76
6 13 35 29 10 18 12 78
7 19 39 31 12 14 22 53
8 15 34 36 14 14 11 80
9 14 36 35 12 15 10 74
10 15 37 38 6 15 13 76
11 16 38 31 10 17 10 79
12 16 36 34 12 19 8 54
13 16 38 35 12 10 15 67
14 16 39 38 11 16 14 54
15 17 33 37 15 18 10 87
16 15 32 33 12 14 14 58
17 15 36 32 10 14 14 75
18 20 38 38 12 17 11 88
19 18 39 38 11 14 10 64
20 16 32 32 12 16 13 57
21 16 32 33 11 18 7 66
22 16 31 31 12 11 14 68
23 19 39 38 13 14 12 54
24 16 37 39 11 12 14 56
25 17 39 32 9 17 11 86
26 17 41 32 13 9 9 80
27 16 36 35 10 16 11 76
28 15 33 37 14 14 15 69
29 16 33 33 12 15 14 78
30 14 34 33 10 11 13 67
31 15 31 28 12 16 9 80
32 12 27 32 8 13 15 54
33 14 37 31 10 17 10 71
34 16 34 37 12 15 11 84
35 14 34 30 12 14 13 74
36 7 32 33 7 16 8 71
37 10 29 31 6 9 20 63
38 14 36 33 12 15 12 71
39 16 29 31 10 17 10 76
40 16 35 33 10 13 10 69
41 16 37 32 10 15 9 74
42 14 34 33 12 16 14 75
43 20 38 32 15 16 8 54
44 14 35 33 10 12 14 52
45 14 38 28 10 12 11 69
46 11 37 35 12 11 13 68
47 14 38 39 13 15 9 65
48 15 33 34 11 15 11 75
49 16 36 38 11 17 15 74
50 14 38 32 12 13 11 75
51 16 32 38 14 16 10 72
52 14 32 30 10 14 14 67
53 12 32 33 12 11 18 63
54 16 34 38 13 12 14 62
55 9 32 32 5 12 11 63
56 14 37 32 6 15 12 76
57 16 39 34 12 16 13 74
58 16 29 34 12 15 9 67
59 15 37 36 11 12 10 73
60 16 35 34 10 12 15 70
61 12 30 28 7 8 20 53
62 16 38 34 12 13 12 77
63 16 34 35 14 11 12 77
64 14 31 35 11 14 14 52
65 16 34 31 12 15 13 54
66 17 35 37 13 10 11 80
67 18 36 35 14 11 17 66
68 18 30 27 11 12 12 73
69 12 39 40 12 15 13 63
70 16 35 37 12 15 14 69
71 10 38 36 8 14 13 67
72 14 31 38 11 16 15 54
73 18 34 39 14 15 13 81
74 18 38 41 14 15 10 69
75 16 34 27 12 13 11 84
76 17 39 30 9 12 19 80
77 16 37 37 13 17 13 70
78 16 34 31 11 13 17 69
79 13 28 31 12 15 13 77
80 16 37 27 12 13 9 54
81 16 33 36 12 15 11 79
82 20 37 38 12 16 10 30
83 16 35 37 12 15 9 71
84 15 37 33 12 16 12 73
85 15 32 34 11 15 12 72
86 16 33 31 10 14 13 77
87 14 38 39 9 15 13 75
88 16 33 34 12 14 12 69
89 16 29 32 12 13 15 54
90 15 33 33 12 7 22 70
91 12 31 36 9 17 13 73
92 17 36 32 15 13 15 54
93 16 35 41 12 15 13 77
94 15 32 28 12 14 15 82
95 13 29 30 12 13 10 80
96 16 39 36 10 16 11 80
97 16 37 35 13 12 16 69
98 16 35 31 9 14 11 78
99 16 37 34 12 17 11 81
100 14 32 36 10 15 10 76
101 16 38 36 14 17 10 76
102 16 37 35 11 12 16 73
103 20 36 37 15 16 12 85
104 15 32 28 11 11 11 66
105 16 33 39 11 15 16 79
106 13 40 32 12 9 19 68
107 17 38 35 12 16 11 76
108 16 41 39 12 15 16 71
109 16 36 35 11 10 15 54
110 12 43 42 7 10 24 46
111 16 30 34 12 15 14 82
112 16 31 33 14 11 15 74
113 17 32 41 11 13 11 88
114 13 32 33 11 14 15 38
115 12 37 34 10 18 12 76
116 18 37 32 13 16 10 86
117 14 33 40 13 14 14 54
118 14 34 40 8 14 13 70
119 13 33 35 11 14 9 69
120 16 38 36 12 14 15 90
121 13 33 37 11 12 15 54
122 16 31 27 13 14 14 76
123 13 38 39 12 15 11 89
124 16 37 38 14 15 8 76
125 15 33 31 13 15 11 73
126 16 31 33 15 13 11 79
127 15 39 32 10 17 8 90
128 17 44 39 11 17 10 74
129 15 33 36 9 19 11 81
130 12 35 33 11 15 13 72
131 16 32 33 10 13 11 71
132 10 28 32 11 9 20 66
133 16 40 37 8 15 10 77
134 12 27 30 11 15 15 65
135 14 37 38 12 15 12 74
136 15 32 29 12 16 14 82
137 13 28 22 9 11 23 54
138 15 34 35 11 14 14 63
139 11 30 35 10 11 16 54
140 12 35 34 8 15 11 64
141 8 31 35 9 13 12 69
142 16 32 34 8 15 10 54
143 15 30 34 9 16 14 84
144 17 30 35 15 14 12 86
145 16 31 23 11 15 12 77
146 10 40 31 8 16 11 89
147 18 32 27 13 16 12 76
148 13 36 36 12 11 13 60
149 16 32 31 12 12 11 75
150 13 35 32 9 9 19 73
151 10 38 39 7 16 12 85
152 15 42 37 13 13 17 79
153 16 34 38 9 16 9 71
154 16 35 39 6 12 12 72
155 14 35 34 8 9 19 69
156 10 33 31 8 13 18 78
157 17 36 32 15 13 15 54
158 13 32 37 6 14 14 69
159 15 33 36 9 19 11 81
160 16 34 32 11 13 9 84
161 12 32 35 8 12 18 84
162 13 34 36 8 13 16 69
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Connected Separate Software Happiness Depression
5.751629 0.115277 -0.023713 0.545447 0.062907 -0.076831
Belonging
0.001351
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.9639 -1.1354 0.1896 1.1048 4.0601
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.751629 2.577192 2.232 0.0271 *
Connected 0.115277 0.046815 2.462 0.0149 *
Separate -0.023713 0.044607 -0.532 0.5958
Software 0.545447 0.068787 7.929 4.06e-13 ***
Happiness 0.062907 0.076199 0.826 0.4103
Depression -0.076831 0.055851 -1.376 0.1709
Belonging 0.001351 0.014396 0.094 0.9254
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.848 on 155 degrees of freedom
Multiple R-squared: 0.3539, Adjusted R-squared: 0.3289
F-statistic: 14.15 on 6 and 155 DF, p-value: 8.113e-13
> 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.41179894 0.82359788 0.58820106
[2,] 0.28428265 0.56856530 0.71571735
[3,] 0.83945761 0.32108479 0.16054239
[4,] 0.76614022 0.46771957 0.23385978
[5,] 0.70244401 0.59511197 0.29755599
[6,] 0.71610010 0.56779980 0.28389990
[7,] 0.68339477 0.63321046 0.31660523
[8,] 0.60229969 0.79540062 0.39770031
[9,] 0.88439948 0.23120103 0.11560052
[10,] 0.88983108 0.22033784 0.11016892
[11,] 0.85174217 0.29651565 0.14825783
[12,] 0.80995070 0.38009861 0.19004930
[13,] 0.75623169 0.48753662 0.24376831
[14,] 0.77618281 0.44763438 0.22381719
[15,] 0.72638822 0.54722355 0.27361178
[16,] 0.71112923 0.57774154 0.28887077
[17,] 0.65199873 0.69600253 0.34800127
[18,] 0.59251628 0.81496744 0.40748372
[19,] 0.56724761 0.86550478 0.43275239
[20,] 0.50287472 0.99425057 0.49712528
[21,] 0.48029601 0.96059201 0.51970399
[22,] 0.42003879 0.84007759 0.57996121
[23,] 0.39960934 0.79921868 0.60039066
[24,] 0.37552458 0.75104916 0.62447542
[25,] 0.31912487 0.63824974 0.68087513
[26,] 0.30369698 0.60739396 0.69630302
[27,] 0.82820567 0.34358865 0.17179433
[28,] 0.81792420 0.36415161 0.18207580
[29,] 0.81618612 0.36762776 0.18381388
[30,] 0.83451788 0.33096424 0.16548212
[31,] 0.81535178 0.36929643 0.18464822
[32,] 0.78492951 0.43014099 0.21507049
[33,] 0.77169971 0.45660057 0.22830029
[34,] 0.78094704 0.43810592 0.21905296
[35,] 0.74456769 0.51086462 0.25543231
[36,] 0.71456954 0.57086092 0.28543046
[37,] 0.89601302 0.20797397 0.10398698
[38,] 0.91812975 0.16374050 0.08187025
[39,] 0.89701348 0.20597303 0.10298652
[40,] 0.87652321 0.24695359 0.12347679
[41,] 0.87764979 0.24470041 0.12235021
[42,] 0.85148832 0.29702337 0.14851168
[43,] 0.82048244 0.35903511 0.17951756
[44,] 0.84707782 0.30584437 0.15292218
[45,] 0.81706822 0.36586356 0.18293178
[46,] 0.83490769 0.33018461 0.16509231
[47,] 0.81507403 0.36985194 0.18492597
[48,] 0.78233479 0.43533043 0.21766521
[49,] 0.75904332 0.48191336 0.24095668
[50,] 0.72067348 0.55865304 0.27932652
[51,] 0.71636921 0.56726158 0.28363079
[52,] 0.67849813 0.64300375 0.32150187
[53,] 0.63419797 0.73160407 0.36580203
[54,] 0.58998201 0.82003599 0.41001799
[55,] 0.54457201 0.91085598 0.45542799
[56,] 0.50129527 0.99740946 0.49870473
[57,] 0.47107405 0.94214811 0.52892595
[58,] 0.46266358 0.92532716 0.53733642
[59,] 0.58926425 0.82147150 0.41073575
[60,] 0.72758600 0.54482800 0.27241400
[61,] 0.69080950 0.61838100 0.30919050
[62,] 0.78905834 0.42188333 0.21094166
[63,] 0.75427152 0.49145696 0.24572848
[64,] 0.74248474 0.51503052 0.25751526
[65,] 0.71553391 0.56893217 0.28446609
[66,] 0.67566558 0.64866884 0.32433442
[67,] 0.73938199 0.52123602 0.26061801
[68,] 0.70203702 0.59592596 0.29796298
[69,] 0.68582122 0.62835757 0.31417878
[70,] 0.68852504 0.62294992 0.31147496
[71,] 0.64642066 0.70715867 0.35357934
[72,] 0.60572119 0.78855762 0.39427881
[73,] 0.77147050 0.45705900 0.22852950
[74,] 0.73544720 0.52910560 0.26455280
[75,] 0.70564478 0.58871044 0.29435522
[76,] 0.66502259 0.66995482 0.33497741
[77,] 0.65929598 0.68140804 0.34070402
[78,] 0.61550964 0.76898072 0.38449036
[79,] 0.57645165 0.84709670 0.42354835
[80,] 0.55969267 0.88061467 0.44030733
[81,] 0.52627709 0.94744583 0.47372291
[82,] 0.50993582 0.98012835 0.49006418
[83,] 0.47213331 0.94426663 0.52786669
[84,] 0.43085115 0.86170231 0.56914885
[85,] 0.38672517 0.77345034 0.61327483
[86,] 0.39978113 0.79956225 0.60021887
[87,] 0.36606337 0.73212674 0.63393663
[88,] 0.32739529 0.65479058 0.67260471
[89,] 0.32878081 0.65756162 0.67121919
[90,] 0.28719066 0.57438131 0.71280934
[91,] 0.24993854 0.49987708 0.75006146
[92,] 0.22631566 0.45263132 0.77368434
[93,] 0.21094051 0.42188102 0.78905949
[94,] 0.25780366 0.51560731 0.74219634
[95,] 0.22124399 0.44248799 0.77875601
[96,] 0.21616244 0.43232488 0.78383756
[97,] 0.22743017 0.45486034 0.77256983
[98,] 0.20610710 0.41221419 0.79389290
[99,] 0.18439648 0.36879297 0.81560352
[100,] 0.17798485 0.35596970 0.82201515
[101,] 0.16848502 0.33697003 0.83151498
[102,] 0.15023958 0.30047916 0.84976042
[103,] 0.12596588 0.25193176 0.87403412
[104,] 0.14573643 0.29147285 0.85426357
[105,] 0.12669299 0.25338599 0.87330701
[106,] 0.15991574 0.31983147 0.84008426
[107,] 0.15140103 0.30280206 0.84859897
[108,] 0.13139792 0.26279584 0.86860208
[109,] 0.11385062 0.22770124 0.88614938
[110,] 0.11760091 0.23520183 0.88239909
[111,] 0.11063935 0.22127870 0.88936065
[112,] 0.09365159 0.18730319 0.90634841
[113,] 0.07560006 0.15120013 0.92439994
[114,] 0.08417027 0.16834054 0.91582973
[115,] 0.06847620 0.13695240 0.93152380
[116,] 0.05592660 0.11185319 0.94407340
[117,] 0.04280570 0.08561141 0.95719430
[118,] 0.03251416 0.06502832 0.96748584
[119,] 0.02680762 0.05361525 0.97319238
[120,] 0.02083676 0.04167352 0.97916324
[121,] 0.02822873 0.05645746 0.97177127
[122,] 0.02442983 0.04885966 0.97557017
[123,] 0.03590857 0.07181714 0.96409143
[124,] 0.04001264 0.08002527 0.95998736
[125,] 0.05109565 0.10219130 0.94890435
[126,] 0.04103908 0.08207815 0.95896092
[127,] 0.02884804 0.05769607 0.97115196
[128,] 0.01980623 0.03961247 0.98019377
[129,] 0.01324879 0.02649759 0.98675121
[130,] 0.02413528 0.04827057 0.97586472
[131,] 0.02094692 0.04189383 0.97905308
[132,] 0.53456354 0.93087292 0.46543646
[133,] 0.47347169 0.94694337 0.52652831
[134,] 0.40959384 0.81918767 0.59040616
[135,] 0.35178796 0.70357591 0.64821204
[136,] 0.29458081 0.58916162 0.70541919
[137,] 0.29501952 0.59003904 0.70498048
[138,] 0.32319020 0.64638041 0.67680980
[139,] 0.79300895 0.41398209 0.20699105
[140,] 0.73503770 0.52992460 0.26496230
[141,] 0.61614617 0.76770766 0.38385383
[142,] 0.84743748 0.30512504 0.15256252
[143,] 0.84803053 0.30393895 0.15196947
> postscript(file="/var/fisher/rcomp/tmp/1nzk91352139527.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/238cy1352139527.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/3wgjp1352139527.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/44fii1352139527.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/5mt6w1352139527.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.15259537 0.10810056 2.73280314 3.26120555 -1.38021008 -1.86884471
7 8 9 10 11 12
3.68028286 -1.59727044 -1.89227852 2.56405873 0.74064269 -0.29427136
13 14 15 16 17 18
0.58531356 0.64990412 -0.34164216 -0.08675258 0.49635962 3.88041331
19 20 21 22 23 24
2.45488787 0.68823937 0.65844199 1.15631547 2.53116161 1.15309982
25 26 27 28 29 30
2.26190248 0.20725787 1.20983887 -1.13609880 0.70805100 -0.12667741
31 32 33 34 35 36
-0.62972264 -0.20714801 -1.13327521 0.44902727 -1.48688629 -5.96387582
37 38 39 40 41 42
-0.74689073 -1.78198974 1.78219137 1.39903558 0.93536916 -1.46608200
43 44 45 46 47 48
1.98012829 -0.20777215 -0.92562189 -4.51732942 -2.63810571 0.05076903
49 50 51 52 53 54
0.98264870 -1.99267633 -0.51113129 -0.07915146 -2.59745852 0.37622127
55 56 57 58 59 60
-2.40376626 1.34495099 -0.09423711 0.82357362 -0.24832338 1.86846135
61 62 63 64 65 66
0.59765944 0.12887926 -0.35137824 -0.37049884 0.50093082 1.10824143
67 68 69 70 71 72
1.81707961 3.49886647 -3.87419689 0.58450237 -3.61447624 -0.35104513
73 74 75 76 77 78
1.56327243 0.93530140 0.33771443 3.15176713 -0.39549628 1.45925903
79 80 81 82 83 84
-1.83846799 -0.12126289 0.54734488 4.06010065 0.19764491 -0.96287566
85 86 87 88 89 90
0.24692947 1.73894676 -0.16249729 0.65316379 1.38050789 0.83676425
91 92 93 94 95 96
-1.54980694 -0.06277608 0.59171743 -0.16089906 -2.08618907 0.88231698
97 98 99 100 101 102
0.10345915 1.89882609 -0.08970615 -0.31926258 -1.31853105 1.18895143
103 104 105 106 107 108
2.59470385 0.28755449 1.54808672 -2.34749779 0.88838939 0.09122459
109 110 111 112 113 114
1.37887332 -0.37800428 1.07219372 0.18157411 2.44029273 -1.43746234
115 116 117 118 119 120
-2.97813468 1.29674418 -1.57608576 0.93743274 -2.00816993 0.32633363
121 122 123 124 125 126
-1.35368350 0.31649057 -2.97140990 -1.18367601 -1.10856266 -0.80376578
127 128 129 130 131 132
-0.51944094 0.69998566 0.92935638 -3.04578432 1.81899798 -3.33918882
133 134 135 136 137 138
1.87177470 -2.03158647 -1.78275519 -0.33983220 0.63546447 0.26881243
139 140 141 142 143 144
-2.37009081 -1.52858751 -5.39331936 2.75391938 1.64292716 0.36340701
145 146 147 148 149 150
1.09461377 -4.27278484 1.92173599 -2.36753457 0.73818286 -0.14152161
151 152 153 154 155 156
-3.22484709 -1.42508442 1.91006969 3.93561937 1.45675352 -2.72444561
157 158 159 160 161 162
-0.06277608 1.26592582 0.92935638 0.84806295 -0.45951337 0.13733342
> postscript(file="/var/fisher/rcomp/tmp/6a9w01352139527.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.15259537 NA
1 0.10810056 -3.15259537
2 2.73280314 0.10810056
3 3.26120555 2.73280314
4 -1.38021008 3.26120555
5 -1.86884471 -1.38021008
6 3.68028286 -1.86884471
7 -1.59727044 3.68028286
8 -1.89227852 -1.59727044
9 2.56405873 -1.89227852
10 0.74064269 2.56405873
11 -0.29427136 0.74064269
12 0.58531356 -0.29427136
13 0.64990412 0.58531356
14 -0.34164216 0.64990412
15 -0.08675258 -0.34164216
16 0.49635962 -0.08675258
17 3.88041331 0.49635962
18 2.45488787 3.88041331
19 0.68823937 2.45488787
20 0.65844199 0.68823937
21 1.15631547 0.65844199
22 2.53116161 1.15631547
23 1.15309982 2.53116161
24 2.26190248 1.15309982
25 0.20725787 2.26190248
26 1.20983887 0.20725787
27 -1.13609880 1.20983887
28 0.70805100 -1.13609880
29 -0.12667741 0.70805100
30 -0.62972264 -0.12667741
31 -0.20714801 -0.62972264
32 -1.13327521 -0.20714801
33 0.44902727 -1.13327521
34 -1.48688629 0.44902727
35 -5.96387582 -1.48688629
36 -0.74689073 -5.96387582
37 -1.78198974 -0.74689073
38 1.78219137 -1.78198974
39 1.39903558 1.78219137
40 0.93536916 1.39903558
41 -1.46608200 0.93536916
42 1.98012829 -1.46608200
43 -0.20777215 1.98012829
44 -0.92562189 -0.20777215
45 -4.51732942 -0.92562189
46 -2.63810571 -4.51732942
47 0.05076903 -2.63810571
48 0.98264870 0.05076903
49 -1.99267633 0.98264870
50 -0.51113129 -1.99267633
51 -0.07915146 -0.51113129
52 -2.59745852 -0.07915146
53 0.37622127 -2.59745852
54 -2.40376626 0.37622127
55 1.34495099 -2.40376626
56 -0.09423711 1.34495099
57 0.82357362 -0.09423711
58 -0.24832338 0.82357362
59 1.86846135 -0.24832338
60 0.59765944 1.86846135
61 0.12887926 0.59765944
62 -0.35137824 0.12887926
63 -0.37049884 -0.35137824
64 0.50093082 -0.37049884
65 1.10824143 0.50093082
66 1.81707961 1.10824143
67 3.49886647 1.81707961
68 -3.87419689 3.49886647
69 0.58450237 -3.87419689
70 -3.61447624 0.58450237
71 -0.35104513 -3.61447624
72 1.56327243 -0.35104513
73 0.93530140 1.56327243
74 0.33771443 0.93530140
75 3.15176713 0.33771443
76 -0.39549628 3.15176713
77 1.45925903 -0.39549628
78 -1.83846799 1.45925903
79 -0.12126289 -1.83846799
80 0.54734488 -0.12126289
81 4.06010065 0.54734488
82 0.19764491 4.06010065
83 -0.96287566 0.19764491
84 0.24692947 -0.96287566
85 1.73894676 0.24692947
86 -0.16249729 1.73894676
87 0.65316379 -0.16249729
88 1.38050789 0.65316379
89 0.83676425 1.38050789
90 -1.54980694 0.83676425
91 -0.06277608 -1.54980694
92 0.59171743 -0.06277608
93 -0.16089906 0.59171743
94 -2.08618907 -0.16089906
95 0.88231698 -2.08618907
96 0.10345915 0.88231698
97 1.89882609 0.10345915
98 -0.08970615 1.89882609
99 -0.31926258 -0.08970615
100 -1.31853105 -0.31926258
101 1.18895143 -1.31853105
102 2.59470385 1.18895143
103 0.28755449 2.59470385
104 1.54808672 0.28755449
105 -2.34749779 1.54808672
106 0.88838939 -2.34749779
107 0.09122459 0.88838939
108 1.37887332 0.09122459
109 -0.37800428 1.37887332
110 1.07219372 -0.37800428
111 0.18157411 1.07219372
112 2.44029273 0.18157411
113 -1.43746234 2.44029273
114 -2.97813468 -1.43746234
115 1.29674418 -2.97813468
116 -1.57608576 1.29674418
117 0.93743274 -1.57608576
118 -2.00816993 0.93743274
119 0.32633363 -2.00816993
120 -1.35368350 0.32633363
121 0.31649057 -1.35368350
122 -2.97140990 0.31649057
123 -1.18367601 -2.97140990
124 -1.10856266 -1.18367601
125 -0.80376578 -1.10856266
126 -0.51944094 -0.80376578
127 0.69998566 -0.51944094
128 0.92935638 0.69998566
129 -3.04578432 0.92935638
130 1.81899798 -3.04578432
131 -3.33918882 1.81899798
132 1.87177470 -3.33918882
133 -2.03158647 1.87177470
134 -1.78275519 -2.03158647
135 -0.33983220 -1.78275519
136 0.63546447 -0.33983220
137 0.26881243 0.63546447
138 -2.37009081 0.26881243
139 -1.52858751 -2.37009081
140 -5.39331936 -1.52858751
141 2.75391938 -5.39331936
142 1.64292716 2.75391938
143 0.36340701 1.64292716
144 1.09461377 0.36340701
145 -4.27278484 1.09461377
146 1.92173599 -4.27278484
147 -2.36753457 1.92173599
148 0.73818286 -2.36753457
149 -0.14152161 0.73818286
150 -3.22484709 -0.14152161
151 -1.42508442 -3.22484709
152 1.91006969 -1.42508442
153 3.93561937 1.91006969
154 1.45675352 3.93561937
155 -2.72444561 1.45675352
156 -0.06277608 -2.72444561
157 1.26592582 -0.06277608
158 0.92935638 1.26592582
159 0.84806295 0.92935638
160 -0.45951337 0.84806295
161 0.13733342 -0.45951337
162 NA 0.13733342
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.10810056 -3.15259537
[2,] 2.73280314 0.10810056
[3,] 3.26120555 2.73280314
[4,] -1.38021008 3.26120555
[5,] -1.86884471 -1.38021008
[6,] 3.68028286 -1.86884471
[7,] -1.59727044 3.68028286
[8,] -1.89227852 -1.59727044
[9,] 2.56405873 -1.89227852
[10,] 0.74064269 2.56405873
[11,] -0.29427136 0.74064269
[12,] 0.58531356 -0.29427136
[13,] 0.64990412 0.58531356
[14,] -0.34164216 0.64990412
[15,] -0.08675258 -0.34164216
[16,] 0.49635962 -0.08675258
[17,] 3.88041331 0.49635962
[18,] 2.45488787 3.88041331
[19,] 0.68823937 2.45488787
[20,] 0.65844199 0.68823937
[21,] 1.15631547 0.65844199
[22,] 2.53116161 1.15631547
[23,] 1.15309982 2.53116161
[24,] 2.26190248 1.15309982
[25,] 0.20725787 2.26190248
[26,] 1.20983887 0.20725787
[27,] -1.13609880 1.20983887
[28,] 0.70805100 -1.13609880
[29,] -0.12667741 0.70805100
[30,] -0.62972264 -0.12667741
[31,] -0.20714801 -0.62972264
[32,] -1.13327521 -0.20714801
[33,] 0.44902727 -1.13327521
[34,] -1.48688629 0.44902727
[35,] -5.96387582 -1.48688629
[36,] -0.74689073 -5.96387582
[37,] -1.78198974 -0.74689073
[38,] 1.78219137 -1.78198974
[39,] 1.39903558 1.78219137
[40,] 0.93536916 1.39903558
[41,] -1.46608200 0.93536916
[42,] 1.98012829 -1.46608200
[43,] -0.20777215 1.98012829
[44,] -0.92562189 -0.20777215
[45,] -4.51732942 -0.92562189
[46,] -2.63810571 -4.51732942
[47,] 0.05076903 -2.63810571
[48,] 0.98264870 0.05076903
[49,] -1.99267633 0.98264870
[50,] -0.51113129 -1.99267633
[51,] -0.07915146 -0.51113129
[52,] -2.59745852 -0.07915146
[53,] 0.37622127 -2.59745852
[54,] -2.40376626 0.37622127
[55,] 1.34495099 -2.40376626
[56,] -0.09423711 1.34495099
[57,] 0.82357362 -0.09423711
[58,] -0.24832338 0.82357362
[59,] 1.86846135 -0.24832338
[60,] 0.59765944 1.86846135
[61,] 0.12887926 0.59765944
[62,] -0.35137824 0.12887926
[63,] -0.37049884 -0.35137824
[64,] 0.50093082 -0.37049884
[65,] 1.10824143 0.50093082
[66,] 1.81707961 1.10824143
[67,] 3.49886647 1.81707961
[68,] -3.87419689 3.49886647
[69,] 0.58450237 -3.87419689
[70,] -3.61447624 0.58450237
[71,] -0.35104513 -3.61447624
[72,] 1.56327243 -0.35104513
[73,] 0.93530140 1.56327243
[74,] 0.33771443 0.93530140
[75,] 3.15176713 0.33771443
[76,] -0.39549628 3.15176713
[77,] 1.45925903 -0.39549628
[78,] -1.83846799 1.45925903
[79,] -0.12126289 -1.83846799
[80,] 0.54734488 -0.12126289
[81,] 4.06010065 0.54734488
[82,] 0.19764491 4.06010065
[83,] -0.96287566 0.19764491
[84,] 0.24692947 -0.96287566
[85,] 1.73894676 0.24692947
[86,] -0.16249729 1.73894676
[87,] 0.65316379 -0.16249729
[88,] 1.38050789 0.65316379
[89,] 0.83676425 1.38050789
[90,] -1.54980694 0.83676425
[91,] -0.06277608 -1.54980694
[92,] 0.59171743 -0.06277608
[93,] -0.16089906 0.59171743
[94,] -2.08618907 -0.16089906
[95,] 0.88231698 -2.08618907
[96,] 0.10345915 0.88231698
[97,] 1.89882609 0.10345915
[98,] -0.08970615 1.89882609
[99,] -0.31926258 -0.08970615
[100,] -1.31853105 -0.31926258
[101,] 1.18895143 -1.31853105
[102,] 2.59470385 1.18895143
[103,] 0.28755449 2.59470385
[104,] 1.54808672 0.28755449
[105,] -2.34749779 1.54808672
[106,] 0.88838939 -2.34749779
[107,] 0.09122459 0.88838939
[108,] 1.37887332 0.09122459
[109,] -0.37800428 1.37887332
[110,] 1.07219372 -0.37800428
[111,] 0.18157411 1.07219372
[112,] 2.44029273 0.18157411
[113,] -1.43746234 2.44029273
[114,] -2.97813468 -1.43746234
[115,] 1.29674418 -2.97813468
[116,] -1.57608576 1.29674418
[117,] 0.93743274 -1.57608576
[118,] -2.00816993 0.93743274
[119,] 0.32633363 -2.00816993
[120,] -1.35368350 0.32633363
[121,] 0.31649057 -1.35368350
[122,] -2.97140990 0.31649057
[123,] -1.18367601 -2.97140990
[124,] -1.10856266 -1.18367601
[125,] -0.80376578 -1.10856266
[126,] -0.51944094 -0.80376578
[127,] 0.69998566 -0.51944094
[128,] 0.92935638 0.69998566
[129,] -3.04578432 0.92935638
[130,] 1.81899798 -3.04578432
[131,] -3.33918882 1.81899798
[132,] 1.87177470 -3.33918882
[133,] -2.03158647 1.87177470
[134,] -1.78275519 -2.03158647
[135,] -0.33983220 -1.78275519
[136,] 0.63546447 -0.33983220
[137,] 0.26881243 0.63546447
[138,] -2.37009081 0.26881243
[139,] -1.52858751 -2.37009081
[140,] -5.39331936 -1.52858751
[141,] 2.75391938 -5.39331936
[142,] 1.64292716 2.75391938
[143,] 0.36340701 1.64292716
[144,] 1.09461377 0.36340701
[145,] -4.27278484 1.09461377
[146,] 1.92173599 -4.27278484
[147,] -2.36753457 1.92173599
[148,] 0.73818286 -2.36753457
[149,] -0.14152161 0.73818286
[150,] -3.22484709 -0.14152161
[151,] -1.42508442 -3.22484709
[152,] 1.91006969 -1.42508442
[153,] 3.93561937 1.91006969
[154,] 1.45675352 3.93561937
[155,] -2.72444561 1.45675352
[156,] -0.06277608 -2.72444561
[157,] 1.26592582 -0.06277608
[158,] 0.92935638 1.26592582
[159,] 0.84806295 0.92935638
[160,] -0.45951337 0.84806295
[161,] 0.13733342 -0.45951337
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.10810056 -3.15259537
2 2.73280314 0.10810056
3 3.26120555 2.73280314
4 -1.38021008 3.26120555
5 -1.86884471 -1.38021008
6 3.68028286 -1.86884471
7 -1.59727044 3.68028286
8 -1.89227852 -1.59727044
9 2.56405873 -1.89227852
10 0.74064269 2.56405873
11 -0.29427136 0.74064269
12 0.58531356 -0.29427136
13 0.64990412 0.58531356
14 -0.34164216 0.64990412
15 -0.08675258 -0.34164216
16 0.49635962 -0.08675258
17 3.88041331 0.49635962
18 2.45488787 3.88041331
19 0.68823937 2.45488787
20 0.65844199 0.68823937
21 1.15631547 0.65844199
22 2.53116161 1.15631547
23 1.15309982 2.53116161
24 2.26190248 1.15309982
25 0.20725787 2.26190248
26 1.20983887 0.20725787
27 -1.13609880 1.20983887
28 0.70805100 -1.13609880
29 -0.12667741 0.70805100
30 -0.62972264 -0.12667741
31 -0.20714801 -0.62972264
32 -1.13327521 -0.20714801
33 0.44902727 -1.13327521
34 -1.48688629 0.44902727
35 -5.96387582 -1.48688629
36 -0.74689073 -5.96387582
37 -1.78198974 -0.74689073
38 1.78219137 -1.78198974
39 1.39903558 1.78219137
40 0.93536916 1.39903558
41 -1.46608200 0.93536916
42 1.98012829 -1.46608200
43 -0.20777215 1.98012829
44 -0.92562189 -0.20777215
45 -4.51732942 -0.92562189
46 -2.63810571 -4.51732942
47 0.05076903 -2.63810571
48 0.98264870 0.05076903
49 -1.99267633 0.98264870
50 -0.51113129 -1.99267633
51 -0.07915146 -0.51113129
52 -2.59745852 -0.07915146
53 0.37622127 -2.59745852
54 -2.40376626 0.37622127
55 1.34495099 -2.40376626
56 -0.09423711 1.34495099
57 0.82357362 -0.09423711
58 -0.24832338 0.82357362
59 1.86846135 -0.24832338
60 0.59765944 1.86846135
61 0.12887926 0.59765944
62 -0.35137824 0.12887926
63 -0.37049884 -0.35137824
64 0.50093082 -0.37049884
65 1.10824143 0.50093082
66 1.81707961 1.10824143
67 3.49886647 1.81707961
68 -3.87419689 3.49886647
69 0.58450237 -3.87419689
70 -3.61447624 0.58450237
71 -0.35104513 -3.61447624
72 1.56327243 -0.35104513
73 0.93530140 1.56327243
74 0.33771443 0.93530140
75 3.15176713 0.33771443
76 -0.39549628 3.15176713
77 1.45925903 -0.39549628
78 -1.83846799 1.45925903
79 -0.12126289 -1.83846799
80 0.54734488 -0.12126289
81 4.06010065 0.54734488
82 0.19764491 4.06010065
83 -0.96287566 0.19764491
84 0.24692947 -0.96287566
85 1.73894676 0.24692947
86 -0.16249729 1.73894676
87 0.65316379 -0.16249729
88 1.38050789 0.65316379
89 0.83676425 1.38050789
90 -1.54980694 0.83676425
91 -0.06277608 -1.54980694
92 0.59171743 -0.06277608
93 -0.16089906 0.59171743
94 -2.08618907 -0.16089906
95 0.88231698 -2.08618907
96 0.10345915 0.88231698
97 1.89882609 0.10345915
98 -0.08970615 1.89882609
99 -0.31926258 -0.08970615
100 -1.31853105 -0.31926258
101 1.18895143 -1.31853105
102 2.59470385 1.18895143
103 0.28755449 2.59470385
104 1.54808672 0.28755449
105 -2.34749779 1.54808672
106 0.88838939 -2.34749779
107 0.09122459 0.88838939
108 1.37887332 0.09122459
109 -0.37800428 1.37887332
110 1.07219372 -0.37800428
111 0.18157411 1.07219372
112 2.44029273 0.18157411
113 -1.43746234 2.44029273
114 -2.97813468 -1.43746234
115 1.29674418 -2.97813468
116 -1.57608576 1.29674418
117 0.93743274 -1.57608576
118 -2.00816993 0.93743274
119 0.32633363 -2.00816993
120 -1.35368350 0.32633363
121 0.31649057 -1.35368350
122 -2.97140990 0.31649057
123 -1.18367601 -2.97140990
124 -1.10856266 -1.18367601
125 -0.80376578 -1.10856266
126 -0.51944094 -0.80376578
127 0.69998566 -0.51944094
128 0.92935638 0.69998566
129 -3.04578432 0.92935638
130 1.81899798 -3.04578432
131 -3.33918882 1.81899798
132 1.87177470 -3.33918882
133 -2.03158647 1.87177470
134 -1.78275519 -2.03158647
135 -0.33983220 -1.78275519
136 0.63546447 -0.33983220
137 0.26881243 0.63546447
138 -2.37009081 0.26881243
139 -1.52858751 -2.37009081
140 -5.39331936 -1.52858751
141 2.75391938 -5.39331936
142 1.64292716 2.75391938
143 0.36340701 1.64292716
144 1.09461377 0.36340701
145 -4.27278484 1.09461377
146 1.92173599 -4.27278484
147 -2.36753457 1.92173599
148 0.73818286 -2.36753457
149 -0.14152161 0.73818286
150 -3.22484709 -0.14152161
151 -1.42508442 -3.22484709
152 1.91006969 -1.42508442
153 3.93561937 1.91006969
154 1.45675352 3.93561937
155 -2.72444561 1.45675352
156 -0.06277608 -2.72444561
157 1.26592582 -0.06277608
158 0.92935638 1.26592582
159 0.84806295 0.92935638
160 -0.45951337 0.84806295
161 0.13733342 -0.45951337
> 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/70ufu1352139527.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/8dipj1352139527.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/9gmrk1352139527.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/100pfe1352139527.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/11w2i61352139527.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/12wvpy1352139527.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/1397f21352139527.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/14g5zg1352139527.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/15i9q11352139527.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/169z941352139527.tab")
+ }
>
> try(system("convert tmp/1nzk91352139527.ps tmp/1nzk91352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/238cy1352139527.ps tmp/238cy1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wgjp1352139527.ps tmp/3wgjp1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/44fii1352139527.ps tmp/44fii1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/5mt6w1352139527.ps tmp/5mt6w1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/6a9w01352139527.ps tmp/6a9w01352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/70ufu1352139527.ps tmp/70ufu1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/8dipj1352139527.ps tmp/8dipj1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/9gmrk1352139527.ps tmp/9gmrk1352139527.png",intern=TRUE))
character(0)
> try(system("convert tmp/100pfe1352139527.ps tmp/100pfe1352139527.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.002 1.136 9.137