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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '3'
> par3 <- '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 t
1 13 41 38 12 14 12 53 1
2 16 39 32 11 18 11 86 2
3 19 30 35 15 11 14 66 3
4 15 31 33 6 12 12 67 4
5 14 34 37 13 16 21 76 5
6 13 35 29 10 18 12 78 6
7 19 39 31 12 14 22 53 7
8 15 34 36 14 14 11 80 8
9 14 36 35 12 15 10 74 9
10 15 37 38 6 15 13 76 10
11 16 38 31 10 17 10 79 11
12 16 36 34 12 19 8 54 12
13 16 38 35 12 10 15 67 13
14 16 39 38 11 16 14 54 14
15 17 33 37 15 18 10 87 15
16 15 32 33 12 14 14 58 16
17 15 36 32 10 14 14 75 17
18 20 38 38 12 17 11 88 18
19 18 39 38 11 14 10 64 19
20 16 32 32 12 16 13 57 20
21 16 32 33 11 18 7 66 21
22 16 31 31 12 11 14 68 22
23 19 39 38 13 14 12 54 23
24 16 37 39 11 12 14 56 24
25 17 39 32 9 17 11 86 25
26 17 41 32 13 9 9 80 26
27 16 36 35 10 16 11 76 27
28 15 33 37 14 14 15 69 28
29 16 33 33 12 15 14 78 29
30 14 34 33 10 11 13 67 30
31 15 31 28 12 16 9 80 31
32 12 27 32 8 13 15 54 32
33 14 37 31 10 17 10 71 33
34 16 34 37 12 15 11 84 34
35 14 34 30 12 14 13 74 35
36 7 32 33 7 16 8 71 36
37 10 29 31 6 9 20 63 37
38 14 36 33 12 15 12 71 38
39 16 29 31 10 17 10 76 39
40 16 35 33 10 13 10 69 40
41 16 37 32 10 15 9 74 41
42 14 34 33 12 16 14 75 42
43 20 38 32 15 16 8 54 43
44 14 35 33 10 12 14 52 44
45 14 38 28 10 12 11 69 45
46 11 37 35 12 11 13 68 46
47 14 38 39 13 15 9 65 47
48 15 33 34 11 15 11 75 48
49 16 36 38 11 17 15 74 49
50 14 38 32 12 13 11 75 50
51 16 32 38 14 16 10 72 51
52 14 32 30 10 14 14 67 52
53 12 32 33 12 11 18 63 53
54 16 34 38 13 12 14 62 54
55 9 32 32 5 12 11 63 55
56 14 37 32 6 15 12 76 56
57 16 39 34 12 16 13 74 57
58 16 29 34 12 15 9 67 58
59 15 37 36 11 12 10 73 59
60 16 35 34 10 12 15 70 60
61 12 30 28 7 8 20 53 61
62 16 38 34 12 13 12 77 62
63 16 34 35 14 11 12 77 63
64 14 31 35 11 14 14 52 64
65 16 34 31 12 15 13 54 65
66 17 35 37 13 10 11 80 66
67 18 36 35 14 11 17 66 67
68 18 30 27 11 12 12 73 68
69 12 39 40 12 15 13 63 69
70 16 35 37 12 15 14 69 70
71 10 38 36 8 14 13 67 71
72 14 31 38 11 16 15 54 72
73 18 34 39 14 15 13 81 73
74 18 38 41 14 15 10 69 74
75 16 34 27 12 13 11 84 75
76 17 39 30 9 12 19 80 76
77 16 37 37 13 17 13 70 77
78 16 34 31 11 13 17 69 78
79 13 28 31 12 15 13 77 79
80 16 37 27 12 13 9 54 80
81 16 33 36 12 15 11 79 81
82 20 37 38 12 16 10 30 82
83 16 35 37 12 15 9 71 83
84 15 37 33 12 16 12 73 84
85 15 32 34 11 15 12 72 85
86 16 33 31 10 14 13 77 86
87 14 38 39 9 15 13 75 87
88 16 33 34 12 14 12 69 88
89 16 29 32 12 13 15 54 89
90 15 33 33 12 7 22 70 90
91 12 31 36 9 17 13 73 91
92 17 36 32 15 13 15 54 92
93 16 35 41 12 15 13 77 93
94 15 32 28 12 14 15 82 94
95 13 29 30 12 13 10 80 95
96 16 39 36 10 16 11 80 96
97 16 37 35 13 12 16 69 97
98 16 35 31 9 14 11 78 98
99 16 37 34 12 17 11 81 99
100 14 32 36 10 15 10 76 100
101 16 38 36 14 17 10 76 101
102 16 37 35 11 12 16 73 102
103 20 36 37 15 16 12 85 103
104 15 32 28 11 11 11 66 104
105 16 33 39 11 15 16 79 105
106 13 40 32 12 9 19 68 106
107 17 38 35 12 16 11 76 107
108 16 41 39 12 15 16 71 108
109 16 36 35 11 10 15 54 109
110 12 43 42 7 10 24 46 110
111 16 30 34 12 15 14 82 111
112 16 31 33 14 11 15 74 112
113 17 32 41 11 13 11 88 113
114 13 32 33 11 14 15 38 114
115 12 37 34 10 18 12 76 115
116 18 37 32 13 16 10 86 116
117 14 33 40 13 14 14 54 117
118 14 34 40 8 14 13 70 118
119 13 33 35 11 14 9 69 119
120 16 38 36 12 14 15 90 120
121 13 33 37 11 12 15 54 121
122 16 31 27 13 14 14 76 122
123 13 38 39 12 15 11 89 123
124 16 37 38 14 15 8 76 124
125 15 33 31 13 15 11 73 125
126 16 31 33 15 13 11 79 126
127 15 39 32 10 17 8 90 127
128 17 44 39 11 17 10 74 128
129 15 33 36 9 19 11 81 129
130 12 35 33 11 15 13 72 130
131 16 32 33 10 13 11 71 131
132 10 28 32 11 9 20 66 132
133 16 40 37 8 15 10 77 133
134 12 27 30 11 15 15 65 134
135 14 37 38 12 15 12 74 135
136 15 32 29 12 16 14 82 136
137 13 28 22 9 11 23 54 137
138 15 34 35 11 14 14 63 138
139 11 30 35 10 11 16 54 139
140 12 35 34 8 15 11 64 140
141 8 31 35 9 13 12 69 141
142 16 32 34 8 15 10 54 142
143 15 30 34 9 16 14 84 143
144 17 30 35 15 14 12 86 144
145 16 31 23 11 15 12 77 145
146 10 40 31 8 16 11 89 146
147 18 32 27 13 16 12 76 147
148 13 36 36 12 11 13 60 148
149 16 32 31 12 12 11 75 149
150 13 35 32 9 9 19 73 150
151 10 38 39 7 16 12 85 151
152 15 42 37 13 13 17 79 152
153 16 34 38 9 16 9 71 153
154 16 35 39 6 12 12 72 154
155 14 35 34 8 9 19 69 155
156 10 33 31 8 13 18 78 156
157 17 36 32 15 13 15 54 157
158 13 32 37 6 14 14 69 158
159 15 33 36 9 19 11 81 159
160 16 34 32 11 13 9 84 160
161 12 32 35 8 12 18 84 161
162 13 34 36 8 13 16 69 162
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Connected Separate Software Happiness Depression
6.037403 0.107298 -0.017986 0.533734 0.055902 -0.069897
Belonging t
0.005127 -0.004092
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.1655 -1.1215 0.2265 1.1144 4.2575
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.037403 2.582313 2.338 0.0207 *
Connected 0.107298 0.047155 2.275 0.0243 *
Separate -0.017986 0.044755 -0.402 0.6883
Software 0.533734 0.069284 7.704 1.51e-12 ***
Happiness 0.055902 0.076258 0.733 0.4646
Depression -0.069897 0.056017 -1.248 0.2140
Belonging 0.005127 0.014678 0.349 0.7274
t -0.004092 0.003249 -1.260 0.2097
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.845 on 154 degrees of freedom
Multiple R-squared: 0.3605, Adjusted R-squared: 0.3314
F-statistic: 12.4 on 7 and 154 DF, p-value: 1.532e-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.44860666 0.89721332 0.5513933
[2,] 0.85555007 0.28889985 0.1444499
[3,] 0.82706996 0.34586008 0.1729300
[4,] 0.74718132 0.50563735 0.2528187
[5,] 0.69785587 0.60428826 0.3021441
[6,] 0.73384143 0.53231713 0.2661586
[7,] 0.67250466 0.65499068 0.3274953
[8,] 0.87019777 0.25960446 0.1298022
[9,] 0.84371312 0.31257376 0.1562869
[10,] 0.79302343 0.41395313 0.2069766
[11,] 0.72974027 0.54051945 0.2702597
[12,] 0.69013687 0.61972626 0.3098631
[13,] 0.65697716 0.68604569 0.3430228
[14,] 0.63321105 0.73357790 0.3667890
[15,] 0.57602054 0.84795892 0.4239795
[16,] 0.52726159 0.94547682 0.4727384
[17,] 0.47673413 0.95346826 0.5232659
[18,] 0.52686614 0.94626772 0.4731339
[19,] 0.46835334 0.93670667 0.5316467
[20,] 0.48184198 0.96368397 0.5181580
[21,] 0.42809432 0.85618863 0.5719057
[22,] 0.42602270 0.85204540 0.5739773
[23,] 0.41244333 0.82488665 0.5875567
[24,] 0.35449061 0.70898122 0.6455094
[25,] 0.33977208 0.67954417 0.6602279
[26,] 0.83893199 0.32213602 0.1610680
[27,] 0.82200224 0.35599552 0.1779978
[28,] 0.80590352 0.38819295 0.1940965
[29,] 0.83792177 0.32415646 0.1620782
[30,] 0.82465570 0.35068861 0.1753443
[31,] 0.79847356 0.40305288 0.2015264
[32,] 0.77709221 0.44581559 0.2229078
[33,] 0.79631435 0.40737130 0.2036856
[34,] 0.75838420 0.48323161 0.2416158
[35,] 0.72592417 0.54815166 0.2740758
[36,] 0.88327852 0.23344297 0.1167215
[37,] 0.89175186 0.21649628 0.1082481
[38,] 0.87066703 0.25866594 0.1293330
[39,] 0.85617198 0.28765603 0.1438280
[40,] 0.84933516 0.30132967 0.1506648
[41,] 0.82112363 0.35775275 0.1788764
[42,] 0.78948140 0.42103720 0.2105186
[43,] 0.80478450 0.39043101 0.1952155
[44,] 0.77827450 0.44345099 0.2217255
[45,] 0.79878124 0.40243752 0.2012188
[46,] 0.78915197 0.42169605 0.2108480
[47,] 0.75368317 0.49263366 0.2463168
[48,] 0.74206541 0.51586918 0.2579346
[49,] 0.70724869 0.58550263 0.2927513
[50,] 0.71447752 0.57104497 0.2855225
[51,] 0.67989394 0.64021212 0.3201061
[52,] 0.63900355 0.72199290 0.3609964
[53,] 0.59931132 0.80137737 0.4006887
[54,] 0.55585460 0.88829080 0.4441454
[55,] 0.51794245 0.96411511 0.4820576
[56,] 0.49267118 0.98534236 0.5073288
[57,] 0.48729993 0.97459987 0.5127001
[58,] 0.60662033 0.78675934 0.3933797
[59,] 0.73302875 0.53394250 0.2669712
[60,] 0.69928488 0.60143023 0.3007151
[61,] 0.80317245 0.39365510 0.1968276
[62,] 0.77367271 0.45265458 0.2263273
[63,] 0.76524591 0.46950818 0.2347541
[64,] 0.74289998 0.51420004 0.2571000
[65,] 0.70422411 0.59155178 0.2957759
[66,] 0.75390644 0.49218712 0.2460936
[67,] 0.71706177 0.56587647 0.2829382
[68,] 0.69570606 0.60858789 0.3042939
[69,] 0.70199891 0.59600219 0.2980011
[70,] 0.66310526 0.67378948 0.3368947
[71,] 0.62391384 0.75217232 0.3760862
[72,] 0.78674980 0.42650040 0.2132502
[73,] 0.75203154 0.49593692 0.2479685
[74,] 0.72473013 0.55053975 0.2752699
[75,] 0.68501293 0.62997413 0.3149871
[76,] 0.67111170 0.65777661 0.3288883
[77,] 0.62863826 0.74272347 0.3713617
[78,] 0.58710790 0.82578420 0.4128921
[79,] 0.56406365 0.87187270 0.4359364
[80,] 0.52623315 0.94753370 0.4737668
[81,] 0.51660959 0.96678082 0.4833904
[82,] 0.47608404 0.95216808 0.5239160
[83,] 0.43321803 0.86643606 0.5667820
[84,] 0.38807899 0.77615798 0.6119210
[85,] 0.41413121 0.82826242 0.5858688
[86,] 0.37615390 0.75230781 0.6238461
[87,] 0.33397561 0.66795121 0.6660244
[88,] 0.32643501 0.65287001 0.6735650
[89,] 0.28427336 0.56854672 0.7157266
[90,] 0.24980769 0.49961538 0.7501923
[91,] 0.22700758 0.45401517 0.7729924
[92,] 0.20694084 0.41388168 0.7930592
[93,] 0.24953917 0.49907834 0.7504608
[94,] 0.21272627 0.42545255 0.7872737
[95,] 0.20581223 0.41162447 0.7941878
[96,] 0.21702148 0.43404297 0.7829785
[97,] 0.19529693 0.39059385 0.8047031
[98,] 0.17392925 0.34785851 0.8260707
[99,] 0.16938126 0.33876252 0.8306187
[100,] 0.16591584 0.33183168 0.8340842
[101,] 0.15237090 0.30474180 0.8476291
[102,] 0.13140839 0.26281678 0.8685916
[103,] 0.17286779 0.34573558 0.8271322
[104,] 0.14859264 0.29718527 0.8514074
[105,] 0.16826740 0.33653481 0.8317326
[106,] 0.17217409 0.34434818 0.8278259
[107,] 0.14767683 0.29535366 0.8523232
[108,] 0.14530754 0.29061508 0.8546925
[109,] 0.13516554 0.27033109 0.8648345
[110,] 0.15134919 0.30269837 0.8486508
[111,] 0.12514400 0.25028801 0.8748560
[112,] 0.11165419 0.22330839 0.8883458
[113,] 0.10756286 0.21512573 0.8924371
[114,] 0.08514807 0.17029614 0.9148519
[115,] 0.06662188 0.13324376 0.9333781
[116,] 0.05090346 0.10180693 0.9490965
[117,] 0.03751936 0.07503871 0.9624806
[118,] 0.03830487 0.07660975 0.9616951
[119,] 0.03726502 0.07453004 0.9627350
[120,] 0.03696441 0.07392881 0.9630356
[121,] 0.04241924 0.08483848 0.9575808
[122,] 0.04382966 0.08765933 0.9561703
[123,] 0.09727011 0.19454023 0.9027299
[124,] 0.09826125 0.19652250 0.9017387
[125,] 0.07749329 0.15498658 0.9225067
[126,] 0.05966367 0.11932735 0.9403363
[127,] 0.04620191 0.09240382 0.9537981
[128,] 0.04233600 0.08467201 0.9576640
[129,] 0.04138385 0.08276769 0.9586162
[130,] 0.02885386 0.05770772 0.9711461
[131,] 0.44403876 0.88807751 0.5559612
[132,] 0.39089260 0.78178519 0.6091074
[133,] 0.34648445 0.69296890 0.6535155
[134,] 0.27520414 0.55040828 0.7247959
[135,] 0.22691400 0.45382800 0.7730860
[136,] 0.22266735 0.44533470 0.7773326
[137,] 0.33267554 0.66535108 0.6673245
[138,] 0.70472390 0.59055220 0.2952761
[139,] 0.60948262 0.78103477 0.3905174
[140,] 0.46728579 0.93457159 0.5327142
[141,] 0.70590224 0.58819551 0.2940978
> postscript(file="/var/fisher/rcomp/tmp/1x0l11355681964.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/2o0sy1355681964.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/3e4a71355681964.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/4qnjq1355681964.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/51ylg1355681964.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.369468601 -0.187649987 2.404686983 2.868292674 -1.754381453 -2.151399873
7 8 9 10 11 12
3.442748163 -1.901495356 -2.157554874 2.195036744 0.494120240 -0.424127057
13 14 15 16 17 18
0.309097822 0.454925544 -0.610690014 -0.318169270 0.219055867 3.604954972
19 20 21 22 23 24
2.256335375 0.503641044 0.482127982 0.894147980 2.396298735 0.941784334
25 26 27 28 29 30
2.029843465 0.022584623 0.987316552 -1.358382275 0.469294576 -0.356338320
31 32 33 34 35 36
-0.813492435 -0.452945003 -1.267535215 0.213950297 -1.660894839 -6.165485305
37 38 39 40 41 42
-1.070649047 -1.919674601 1.589770584 1.245539737 0.809715513 -1.625324325
43 44 45 46 47 48
2.018670753 -0.315446113 -1.020024118 -4.649378466 -2.702187903 -0.095540727
49 50 51 52 53 54
0.831510670 -2.081749505 -0.615641664 -0.203476078 -2.745094784 0.270234725
55 56 57 58 59 60
-2.563937232 1.205472832 -0.147214360 0.742063036 -0.335684210 1.745630920
61 62 63 64 65 66
0.439747589 0.062973389 -0.441419948 -0.413971792 0.526496460 1.003888907
67 68 69 70 71 72
1.766231749 3.430155351 -3.877894228 0.540569215 -3.664024724 -0.379435770
73 74 75 76 77 78
1.497229603 0.959932591 0.313681308 3.072024505 -0.365941648 1.427918519
79 80 81 82 83 84
-1.890338519 0.026260001 0.521237125 4.257524849 0.234032454 -0.904880275
85 86 87 88 89 90
0.248451536 1.725186206 -0.175239918 0.690978602 1.430786577 0.766329459
91 92 93 94 95 96
-1.563290080 0.090774202 0.595725159 -0.142042921 -2.063412397 0.945272202
97 98 99 100 101 102
0.174258902 1.948511522 0.007677681 -0.280758442 -1.167194524 1.241681110
103 104 105 106 107 108
2.689392151 0.402761987 1.556628475 -2.248506345 1.032639915 0.217800385
109 110 111 112 113 114
1.516942297 -0.299131271 1.124240154 0.270098674 2.448815404 -1.210952004
115 116 117 118 119 120
-2.819747725 1.467912712 -1.399466188 1.014071378 -1.840129062 0.423440748
121 122 123 124 125 126
-1.187886474 0.488985543 -2.840686362 -0.957790723 -0.891601802 -0.623366789
127 128 129 130 131 132
-0.316668670 0.964922350 1.085011116 -2.837376751 1.999480968 -3.240642183
133 134 135 136 137 138
2.076229902 -1.840897717 -1.555466550 -0.133878600 0.826837723 0.510571876
139 140 141 142 143 144
-2.168768934 -1.276044437 -5.202441329 3.035406626 1.790241619 0.571672564
145 146 147 148 149 150
1.377811982 -4.026011704 2.232399178 -2.065660403 1.005097985 0.043615623
151 152 153 154 155 156
-3.022928713 -1.138454893 2.191080825 4.135232515 1.654290316 -2.520623342
157 158 159 160 161 162
0.356776682 1.480895519 1.207781491 1.145400440 -0.295779324 0.392909849
> postscript(file="/var/fisher/rcomp/tmp/6aoto1355681964.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.369468601 NA
1 -0.187649987 -3.369468601
2 2.404686983 -0.187649987
3 2.868292674 2.404686983
4 -1.754381453 2.868292674
5 -2.151399873 -1.754381453
6 3.442748163 -2.151399873
7 -1.901495356 3.442748163
8 -2.157554874 -1.901495356
9 2.195036744 -2.157554874
10 0.494120240 2.195036744
11 -0.424127057 0.494120240
12 0.309097822 -0.424127057
13 0.454925544 0.309097822
14 -0.610690014 0.454925544
15 -0.318169270 -0.610690014
16 0.219055867 -0.318169270
17 3.604954972 0.219055867
18 2.256335375 3.604954972
19 0.503641044 2.256335375
20 0.482127982 0.503641044
21 0.894147980 0.482127982
22 2.396298735 0.894147980
23 0.941784334 2.396298735
24 2.029843465 0.941784334
25 0.022584623 2.029843465
26 0.987316552 0.022584623
27 -1.358382275 0.987316552
28 0.469294576 -1.358382275
29 -0.356338320 0.469294576
30 -0.813492435 -0.356338320
31 -0.452945003 -0.813492435
32 -1.267535215 -0.452945003
33 0.213950297 -1.267535215
34 -1.660894839 0.213950297
35 -6.165485305 -1.660894839
36 -1.070649047 -6.165485305
37 -1.919674601 -1.070649047
38 1.589770584 -1.919674601
39 1.245539737 1.589770584
40 0.809715513 1.245539737
41 -1.625324325 0.809715513
42 2.018670753 -1.625324325
43 -0.315446113 2.018670753
44 -1.020024118 -0.315446113
45 -4.649378466 -1.020024118
46 -2.702187903 -4.649378466
47 -0.095540727 -2.702187903
48 0.831510670 -0.095540727
49 -2.081749505 0.831510670
50 -0.615641664 -2.081749505
51 -0.203476078 -0.615641664
52 -2.745094784 -0.203476078
53 0.270234725 -2.745094784
54 -2.563937232 0.270234725
55 1.205472832 -2.563937232
56 -0.147214360 1.205472832
57 0.742063036 -0.147214360
58 -0.335684210 0.742063036
59 1.745630920 -0.335684210
60 0.439747589 1.745630920
61 0.062973389 0.439747589
62 -0.441419948 0.062973389
63 -0.413971792 -0.441419948
64 0.526496460 -0.413971792
65 1.003888907 0.526496460
66 1.766231749 1.003888907
67 3.430155351 1.766231749
68 -3.877894228 3.430155351
69 0.540569215 -3.877894228
70 -3.664024724 0.540569215
71 -0.379435770 -3.664024724
72 1.497229603 -0.379435770
73 0.959932591 1.497229603
74 0.313681308 0.959932591
75 3.072024505 0.313681308
76 -0.365941648 3.072024505
77 1.427918519 -0.365941648
78 -1.890338519 1.427918519
79 0.026260001 -1.890338519
80 0.521237125 0.026260001
81 4.257524849 0.521237125
82 0.234032454 4.257524849
83 -0.904880275 0.234032454
84 0.248451536 -0.904880275
85 1.725186206 0.248451536
86 -0.175239918 1.725186206
87 0.690978602 -0.175239918
88 1.430786577 0.690978602
89 0.766329459 1.430786577
90 -1.563290080 0.766329459
91 0.090774202 -1.563290080
92 0.595725159 0.090774202
93 -0.142042921 0.595725159
94 -2.063412397 -0.142042921
95 0.945272202 -2.063412397
96 0.174258902 0.945272202
97 1.948511522 0.174258902
98 0.007677681 1.948511522
99 -0.280758442 0.007677681
100 -1.167194524 -0.280758442
101 1.241681110 -1.167194524
102 2.689392151 1.241681110
103 0.402761987 2.689392151
104 1.556628475 0.402761987
105 -2.248506345 1.556628475
106 1.032639915 -2.248506345
107 0.217800385 1.032639915
108 1.516942297 0.217800385
109 -0.299131271 1.516942297
110 1.124240154 -0.299131271
111 0.270098674 1.124240154
112 2.448815404 0.270098674
113 -1.210952004 2.448815404
114 -2.819747725 -1.210952004
115 1.467912712 -2.819747725
116 -1.399466188 1.467912712
117 1.014071378 -1.399466188
118 -1.840129062 1.014071378
119 0.423440748 -1.840129062
120 -1.187886474 0.423440748
121 0.488985543 -1.187886474
122 -2.840686362 0.488985543
123 -0.957790723 -2.840686362
124 -0.891601802 -0.957790723
125 -0.623366789 -0.891601802
126 -0.316668670 -0.623366789
127 0.964922350 -0.316668670
128 1.085011116 0.964922350
129 -2.837376751 1.085011116
130 1.999480968 -2.837376751
131 -3.240642183 1.999480968
132 2.076229902 -3.240642183
133 -1.840897717 2.076229902
134 -1.555466550 -1.840897717
135 -0.133878600 -1.555466550
136 0.826837723 -0.133878600
137 0.510571876 0.826837723
138 -2.168768934 0.510571876
139 -1.276044437 -2.168768934
140 -5.202441329 -1.276044437
141 3.035406626 -5.202441329
142 1.790241619 3.035406626
143 0.571672564 1.790241619
144 1.377811982 0.571672564
145 -4.026011704 1.377811982
146 2.232399178 -4.026011704
147 -2.065660403 2.232399178
148 1.005097985 -2.065660403
149 0.043615623 1.005097985
150 -3.022928713 0.043615623
151 -1.138454893 -3.022928713
152 2.191080825 -1.138454893
153 4.135232515 2.191080825
154 1.654290316 4.135232515
155 -2.520623342 1.654290316
156 0.356776682 -2.520623342
157 1.480895519 0.356776682
158 1.207781491 1.480895519
159 1.145400440 1.207781491
160 -0.295779324 1.145400440
161 0.392909849 -0.295779324
162 NA 0.392909849
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.187649987 -3.369468601
[2,] 2.404686983 -0.187649987
[3,] 2.868292674 2.404686983
[4,] -1.754381453 2.868292674
[5,] -2.151399873 -1.754381453
[6,] 3.442748163 -2.151399873
[7,] -1.901495356 3.442748163
[8,] -2.157554874 -1.901495356
[9,] 2.195036744 -2.157554874
[10,] 0.494120240 2.195036744
[11,] -0.424127057 0.494120240
[12,] 0.309097822 -0.424127057
[13,] 0.454925544 0.309097822
[14,] -0.610690014 0.454925544
[15,] -0.318169270 -0.610690014
[16,] 0.219055867 -0.318169270
[17,] 3.604954972 0.219055867
[18,] 2.256335375 3.604954972
[19,] 0.503641044 2.256335375
[20,] 0.482127982 0.503641044
[21,] 0.894147980 0.482127982
[22,] 2.396298735 0.894147980
[23,] 0.941784334 2.396298735
[24,] 2.029843465 0.941784334
[25,] 0.022584623 2.029843465
[26,] 0.987316552 0.022584623
[27,] -1.358382275 0.987316552
[28,] 0.469294576 -1.358382275
[29,] -0.356338320 0.469294576
[30,] -0.813492435 -0.356338320
[31,] -0.452945003 -0.813492435
[32,] -1.267535215 -0.452945003
[33,] 0.213950297 -1.267535215
[34,] -1.660894839 0.213950297
[35,] -6.165485305 -1.660894839
[36,] -1.070649047 -6.165485305
[37,] -1.919674601 -1.070649047
[38,] 1.589770584 -1.919674601
[39,] 1.245539737 1.589770584
[40,] 0.809715513 1.245539737
[41,] -1.625324325 0.809715513
[42,] 2.018670753 -1.625324325
[43,] -0.315446113 2.018670753
[44,] -1.020024118 -0.315446113
[45,] -4.649378466 -1.020024118
[46,] -2.702187903 -4.649378466
[47,] -0.095540727 -2.702187903
[48,] 0.831510670 -0.095540727
[49,] -2.081749505 0.831510670
[50,] -0.615641664 -2.081749505
[51,] -0.203476078 -0.615641664
[52,] -2.745094784 -0.203476078
[53,] 0.270234725 -2.745094784
[54,] -2.563937232 0.270234725
[55,] 1.205472832 -2.563937232
[56,] -0.147214360 1.205472832
[57,] 0.742063036 -0.147214360
[58,] -0.335684210 0.742063036
[59,] 1.745630920 -0.335684210
[60,] 0.439747589 1.745630920
[61,] 0.062973389 0.439747589
[62,] -0.441419948 0.062973389
[63,] -0.413971792 -0.441419948
[64,] 0.526496460 -0.413971792
[65,] 1.003888907 0.526496460
[66,] 1.766231749 1.003888907
[67,] 3.430155351 1.766231749
[68,] -3.877894228 3.430155351
[69,] 0.540569215 -3.877894228
[70,] -3.664024724 0.540569215
[71,] -0.379435770 -3.664024724
[72,] 1.497229603 -0.379435770
[73,] 0.959932591 1.497229603
[74,] 0.313681308 0.959932591
[75,] 3.072024505 0.313681308
[76,] -0.365941648 3.072024505
[77,] 1.427918519 -0.365941648
[78,] -1.890338519 1.427918519
[79,] 0.026260001 -1.890338519
[80,] 0.521237125 0.026260001
[81,] 4.257524849 0.521237125
[82,] 0.234032454 4.257524849
[83,] -0.904880275 0.234032454
[84,] 0.248451536 -0.904880275
[85,] 1.725186206 0.248451536
[86,] -0.175239918 1.725186206
[87,] 0.690978602 -0.175239918
[88,] 1.430786577 0.690978602
[89,] 0.766329459 1.430786577
[90,] -1.563290080 0.766329459
[91,] 0.090774202 -1.563290080
[92,] 0.595725159 0.090774202
[93,] -0.142042921 0.595725159
[94,] -2.063412397 -0.142042921
[95,] 0.945272202 -2.063412397
[96,] 0.174258902 0.945272202
[97,] 1.948511522 0.174258902
[98,] 0.007677681 1.948511522
[99,] -0.280758442 0.007677681
[100,] -1.167194524 -0.280758442
[101,] 1.241681110 -1.167194524
[102,] 2.689392151 1.241681110
[103,] 0.402761987 2.689392151
[104,] 1.556628475 0.402761987
[105,] -2.248506345 1.556628475
[106,] 1.032639915 -2.248506345
[107,] 0.217800385 1.032639915
[108,] 1.516942297 0.217800385
[109,] -0.299131271 1.516942297
[110,] 1.124240154 -0.299131271
[111,] 0.270098674 1.124240154
[112,] 2.448815404 0.270098674
[113,] -1.210952004 2.448815404
[114,] -2.819747725 -1.210952004
[115,] 1.467912712 -2.819747725
[116,] -1.399466188 1.467912712
[117,] 1.014071378 -1.399466188
[118,] -1.840129062 1.014071378
[119,] 0.423440748 -1.840129062
[120,] -1.187886474 0.423440748
[121,] 0.488985543 -1.187886474
[122,] -2.840686362 0.488985543
[123,] -0.957790723 -2.840686362
[124,] -0.891601802 -0.957790723
[125,] -0.623366789 -0.891601802
[126,] -0.316668670 -0.623366789
[127,] 0.964922350 -0.316668670
[128,] 1.085011116 0.964922350
[129,] -2.837376751 1.085011116
[130,] 1.999480968 -2.837376751
[131,] -3.240642183 1.999480968
[132,] 2.076229902 -3.240642183
[133,] -1.840897717 2.076229902
[134,] -1.555466550 -1.840897717
[135,] -0.133878600 -1.555466550
[136,] 0.826837723 -0.133878600
[137,] 0.510571876 0.826837723
[138,] -2.168768934 0.510571876
[139,] -1.276044437 -2.168768934
[140,] -5.202441329 -1.276044437
[141,] 3.035406626 -5.202441329
[142,] 1.790241619 3.035406626
[143,] 0.571672564 1.790241619
[144,] 1.377811982 0.571672564
[145,] -4.026011704 1.377811982
[146,] 2.232399178 -4.026011704
[147,] -2.065660403 2.232399178
[148,] 1.005097985 -2.065660403
[149,] 0.043615623 1.005097985
[150,] -3.022928713 0.043615623
[151,] -1.138454893 -3.022928713
[152,] 2.191080825 -1.138454893
[153,] 4.135232515 2.191080825
[154,] 1.654290316 4.135232515
[155,] -2.520623342 1.654290316
[156,] 0.356776682 -2.520623342
[157,] 1.480895519 0.356776682
[158,] 1.207781491 1.480895519
[159,] 1.145400440 1.207781491
[160,] -0.295779324 1.145400440
[161,] 0.392909849 -0.295779324
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.187649987 -3.369468601
2 2.404686983 -0.187649987
3 2.868292674 2.404686983
4 -1.754381453 2.868292674
5 -2.151399873 -1.754381453
6 3.442748163 -2.151399873
7 -1.901495356 3.442748163
8 -2.157554874 -1.901495356
9 2.195036744 -2.157554874
10 0.494120240 2.195036744
11 -0.424127057 0.494120240
12 0.309097822 -0.424127057
13 0.454925544 0.309097822
14 -0.610690014 0.454925544
15 -0.318169270 -0.610690014
16 0.219055867 -0.318169270
17 3.604954972 0.219055867
18 2.256335375 3.604954972
19 0.503641044 2.256335375
20 0.482127982 0.503641044
21 0.894147980 0.482127982
22 2.396298735 0.894147980
23 0.941784334 2.396298735
24 2.029843465 0.941784334
25 0.022584623 2.029843465
26 0.987316552 0.022584623
27 -1.358382275 0.987316552
28 0.469294576 -1.358382275
29 -0.356338320 0.469294576
30 -0.813492435 -0.356338320
31 -0.452945003 -0.813492435
32 -1.267535215 -0.452945003
33 0.213950297 -1.267535215
34 -1.660894839 0.213950297
35 -6.165485305 -1.660894839
36 -1.070649047 -6.165485305
37 -1.919674601 -1.070649047
38 1.589770584 -1.919674601
39 1.245539737 1.589770584
40 0.809715513 1.245539737
41 -1.625324325 0.809715513
42 2.018670753 -1.625324325
43 -0.315446113 2.018670753
44 -1.020024118 -0.315446113
45 -4.649378466 -1.020024118
46 -2.702187903 -4.649378466
47 -0.095540727 -2.702187903
48 0.831510670 -0.095540727
49 -2.081749505 0.831510670
50 -0.615641664 -2.081749505
51 -0.203476078 -0.615641664
52 -2.745094784 -0.203476078
53 0.270234725 -2.745094784
54 -2.563937232 0.270234725
55 1.205472832 -2.563937232
56 -0.147214360 1.205472832
57 0.742063036 -0.147214360
58 -0.335684210 0.742063036
59 1.745630920 -0.335684210
60 0.439747589 1.745630920
61 0.062973389 0.439747589
62 -0.441419948 0.062973389
63 -0.413971792 -0.441419948
64 0.526496460 -0.413971792
65 1.003888907 0.526496460
66 1.766231749 1.003888907
67 3.430155351 1.766231749
68 -3.877894228 3.430155351
69 0.540569215 -3.877894228
70 -3.664024724 0.540569215
71 -0.379435770 -3.664024724
72 1.497229603 -0.379435770
73 0.959932591 1.497229603
74 0.313681308 0.959932591
75 3.072024505 0.313681308
76 -0.365941648 3.072024505
77 1.427918519 -0.365941648
78 -1.890338519 1.427918519
79 0.026260001 -1.890338519
80 0.521237125 0.026260001
81 4.257524849 0.521237125
82 0.234032454 4.257524849
83 -0.904880275 0.234032454
84 0.248451536 -0.904880275
85 1.725186206 0.248451536
86 -0.175239918 1.725186206
87 0.690978602 -0.175239918
88 1.430786577 0.690978602
89 0.766329459 1.430786577
90 -1.563290080 0.766329459
91 0.090774202 -1.563290080
92 0.595725159 0.090774202
93 -0.142042921 0.595725159
94 -2.063412397 -0.142042921
95 0.945272202 -2.063412397
96 0.174258902 0.945272202
97 1.948511522 0.174258902
98 0.007677681 1.948511522
99 -0.280758442 0.007677681
100 -1.167194524 -0.280758442
101 1.241681110 -1.167194524
102 2.689392151 1.241681110
103 0.402761987 2.689392151
104 1.556628475 0.402761987
105 -2.248506345 1.556628475
106 1.032639915 -2.248506345
107 0.217800385 1.032639915
108 1.516942297 0.217800385
109 -0.299131271 1.516942297
110 1.124240154 -0.299131271
111 0.270098674 1.124240154
112 2.448815404 0.270098674
113 -1.210952004 2.448815404
114 -2.819747725 -1.210952004
115 1.467912712 -2.819747725
116 -1.399466188 1.467912712
117 1.014071378 -1.399466188
118 -1.840129062 1.014071378
119 0.423440748 -1.840129062
120 -1.187886474 0.423440748
121 0.488985543 -1.187886474
122 -2.840686362 0.488985543
123 -0.957790723 -2.840686362
124 -0.891601802 -0.957790723
125 -0.623366789 -0.891601802
126 -0.316668670 -0.623366789
127 0.964922350 -0.316668670
128 1.085011116 0.964922350
129 -2.837376751 1.085011116
130 1.999480968 -2.837376751
131 -3.240642183 1.999480968
132 2.076229902 -3.240642183
133 -1.840897717 2.076229902
134 -1.555466550 -1.840897717
135 -0.133878600 -1.555466550
136 0.826837723 -0.133878600
137 0.510571876 0.826837723
138 -2.168768934 0.510571876
139 -1.276044437 -2.168768934
140 -5.202441329 -1.276044437
141 3.035406626 -5.202441329
142 1.790241619 3.035406626
143 0.571672564 1.790241619
144 1.377811982 0.571672564
145 -4.026011704 1.377811982
146 2.232399178 -4.026011704
147 -2.065660403 2.232399178
148 1.005097985 -2.065660403
149 0.043615623 1.005097985
150 -3.022928713 0.043615623
151 -1.138454893 -3.022928713
152 2.191080825 -1.138454893
153 4.135232515 2.191080825
154 1.654290316 4.135232515
155 -2.520623342 1.654290316
156 0.356776682 -2.520623342
157 1.480895519 0.356776682
158 1.207781491 1.480895519
159 1.145400440 1.207781491
160 -0.295779324 1.145400440
161 0.392909849 -0.295779324
> 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/79xz81355681964.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/8ymtv1355681964.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/918561355681964.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/1022631355681964.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/114j141355681964.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/12lpcg1355681964.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/132hm71355681964.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/14oeng1355681964.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/15o3ld1355681964.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/16jzdg1355681964.tab")
+ }
>
> try(system("convert tmp/1x0l11355681964.ps tmp/1x0l11355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/2o0sy1355681964.ps tmp/2o0sy1355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/3e4a71355681964.ps tmp/3e4a71355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qnjq1355681964.ps tmp/4qnjq1355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/51ylg1355681964.ps tmp/51ylg1355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/6aoto1355681964.ps tmp/6aoto1355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/79xz81355681964.ps tmp/79xz81355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ymtv1355681964.ps tmp/8ymtv1355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/918561355681964.ps tmp/918561355681964.png",intern=TRUE))
character(0)
> try(system("convert tmp/1022631355681964.ps tmp/1022631355681964.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.384 1.685 10.096