R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
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
+ ,12
+ ,14
+ ,39
+ ,11
+ ,18
+ ,30
+ ,15
+ ,11
+ ,31
+ ,6
+ ,12
+ ,34
+ ,13
+ ,16
+ ,35
+ ,10
+ ,18
+ ,39
+ ,12
+ ,14
+ ,34
+ ,14
+ ,14
+ ,36
+ ,12
+ ,15
+ ,37
+ ,6
+ ,15
+ ,38
+ ,10
+ ,17
+ ,36
+ ,12
+ ,19
+ ,38
+ ,12
+ ,10
+ ,39
+ ,11
+ ,16
+ ,33
+ ,15
+ ,18
+ ,32
+ ,12
+ ,14
+ ,36
+ ,10
+ ,14
+ ,38
+ ,12
+ ,17
+ ,39
+ ,11
+ ,14
+ ,32
+ ,12
+ ,16
+ ,32
+ ,11
+ ,18
+ ,31
+ ,12
+ ,11
+ ,39
+ ,13
+ ,14
+ ,37
+ ,11
+ ,12
+ ,39
+ ,9
+ ,17
+ ,41
+ ,13
+ ,9
+ ,36
+ ,10
+ ,16
+ ,33
+ ,14
+ ,14
+ ,33
+ ,12
+ ,15
+ ,34
+ ,10
+ ,11
+ ,31
+ ,12
+ ,16
+ ,27
+ ,8
+ ,13
+ ,37
+ ,10
+ ,17
+ ,34
+ ,12
+ ,15
+ ,34
+ ,12
+ ,14
+ ,32
+ ,7
+ ,16
+ ,29
+ ,6
+ ,9
+ ,36
+ ,12
+ ,15
+ ,29
+ ,10
+ ,17
+ ,35
+ ,10
+ ,13
+ ,37
+ ,10
+ ,15
+ ,34
+ ,12
+ ,16
+ ,38
+ ,15
+ ,16
+ ,35
+ ,10
+ ,12
+ ,38
+ ,10
+ ,12
+ ,37
+ ,12
+ ,11
+ ,38
+ ,13
+ ,15
+ ,33
+ ,11
+ ,15
+ ,36
+ ,11
+ ,17
+ ,38
+ ,12
+ ,13
+ ,32
+ ,14
+ ,16
+ ,32
+ ,10
+ ,14
+ ,32
+ ,12
+ ,11
+ ,34
+ ,13
+ ,12
+ ,32
+ ,5
+ ,12
+ ,37
+ ,6
+ ,15
+ ,39
+ ,12
+ ,16
+ ,29
+ ,12
+ ,15
+ ,37
+ ,11
+ ,12
+ ,35
+ ,10
+ ,12
+ ,30
+ ,7
+ ,8
+ ,38
+ ,12
+ ,13
+ ,34
+ ,14
+ ,11
+ ,31
+ ,11
+ ,14
+ ,34
+ ,12
+ ,15
+ ,35
+ ,13
+ ,10
+ ,36
+ ,14
+ ,11
+ ,30
+ ,11
+ ,12
+ ,39
+ ,12
+ ,15
+ ,35
+ ,12
+ ,15
+ ,38
+ ,8
+ ,14
+ ,31
+ ,11
+ ,16
+ ,34
+ ,14
+ ,15
+ ,38
+ ,14
+ ,15
+ ,34
+ ,12
+ ,13
+ ,39
+ ,9
+ ,12
+ ,37
+ ,13
+ ,17
+ ,34
+ ,11
+ ,13
+ ,28
+ ,12
+ ,15
+ ,37
+ ,12
+ ,13
+ ,33
+ ,12
+ ,15
+ ,37
+ ,12
+ ,16
+ ,35
+ ,12
+ ,15
+ ,37
+ ,12
+ ,16
+ ,32
+ ,11
+ ,15
+ ,33
+ ,10
+ ,14
+ ,38
+ ,9
+ ,15
+ ,33
+ ,12
+ ,14
+ ,29
+ ,12
+ ,13
+ ,33
+ ,12
+ ,7
+ ,31
+ ,9
+ ,17
+ ,36
+ ,15
+ ,13
+ ,35
+ ,12
+ ,15
+ ,32
+ ,12
+ ,14
+ ,29
+ ,12
+ ,13
+ ,39
+ ,10
+ ,16
+ ,37
+ ,13
+ ,12
+ ,35
+ ,9
+ ,14
+ ,37
+ ,12
+ ,17
+ ,32
+ ,10
+ ,15
+ ,38
+ ,14
+ ,17
+ ,37
+ ,11
+ ,12
+ ,36
+ ,15
+ ,16
+ ,32
+ ,11
+ ,11
+ ,33
+ ,11
+ ,15
+ ,40
+ ,12
+ ,9
+ ,38
+ ,12
+ ,16
+ ,41
+ ,12
+ ,15
+ ,36
+ ,11
+ ,10
+ ,43
+ ,7
+ ,10
+ ,30
+ ,12
+ ,15
+ ,31
+ ,14
+ ,11
+ ,32
+ ,11
+ ,13
+ ,32
+ ,11
+ ,14
+ ,37
+ ,10
+ ,18
+ ,37
+ ,13
+ ,16
+ ,33
+ ,13
+ ,14
+ ,34
+ ,8
+ ,14
+ ,33
+ ,11
+ ,14
+ ,38
+ ,12
+ ,14
+ ,33
+ ,11
+ ,12
+ ,31
+ ,13
+ ,14
+ ,38
+ ,12
+ ,15
+ ,37
+ ,14
+ ,15
+ ,33
+ ,13
+ ,15
+ ,31
+ ,15
+ ,13
+ ,39
+ ,10
+ ,17
+ ,44
+ ,11
+ ,17
+ ,33
+ ,9
+ ,19
+ ,35
+ ,11
+ ,15
+ ,32
+ ,10
+ ,13
+ ,28
+ ,11
+ ,9
+ ,40
+ ,8
+ ,15
+ ,27
+ ,11
+ ,15
+ ,37
+ ,12
+ ,15
+ ,32
+ ,12
+ ,16
+ ,28
+ ,9
+ ,11
+ ,34
+ ,11
+ ,14
+ ,30
+ ,10
+ ,11
+ ,35
+ ,8
+ ,15
+ ,31
+ ,9
+ ,13
+ ,32
+ ,8
+ ,15
+ ,30
+ ,9
+ ,16
+ ,30
+ ,15
+ ,14
+ ,31
+ ,11
+ ,15
+ ,40
+ ,8
+ ,16
+ ,32
+ ,13
+ ,16
+ ,36
+ ,12
+ ,11
+ ,32
+ ,12
+ ,12
+ ,35
+ ,9
+ ,9
+ ,38
+ ,7
+ ,16
+ ,42
+ ,13
+ ,13
+ ,34
+ ,9
+ ,16
+ ,35
+ ,6
+ ,12
+ ,35
+ ,8
+ ,9
+ ,33
+ ,8
+ ,13
+ ,36
+ ,15
+ ,13
+ ,32
+ ,6
+ ,14
+ ,33
+ ,9
+ ,19
+ ,34
+ ,11
+ ,13
+ ,32
+ ,8
+ ,12
+ ,34
+ ,8
+ ,13)
+ ,dim=c(3
+ ,162)
+ ,dimnames=list(c('Connected'
+ ,'Software'
+ ,'Happiness')
+ ,1:162))
> y <- array(NA,dim=c(3,162),dimnames=list(c('Connected','Software','Happiness'),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 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Connected Software Happiness t
1 41 12 14 1
2 39 11 18 2
3 30 15 11 3
4 31 6 12 4
5 34 13 16 5
6 35 10 18 6
7 39 12 14 7
8 34 14 14 8
9 36 12 15 9
10 37 6 15 10
11 38 10 17 11
12 36 12 19 12
13 38 12 10 13
14 39 11 16 14
15 33 15 18 15
16 32 12 14 16
17 36 10 14 17
18 38 12 17 18
19 39 11 14 19
20 32 12 16 20
21 32 11 18 21
22 31 12 11 22
23 39 13 14 23
24 37 11 12 24
25 39 9 17 25
26 41 13 9 26
27 36 10 16 27
28 33 14 14 28
29 33 12 15 29
30 34 10 11 30
31 31 12 16 31
32 27 8 13 32
33 37 10 17 33
34 34 12 15 34
35 34 12 14 35
36 32 7 16 36
37 29 6 9 37
38 36 12 15 38
39 29 10 17 39
40 35 10 13 40
41 37 10 15 41
42 34 12 16 42
43 38 15 16 43
44 35 10 12 44
45 38 10 12 45
46 37 12 11 46
47 38 13 15 47
48 33 11 15 48
49 36 11 17 49
50 38 12 13 50
51 32 14 16 51
52 32 10 14 52
53 32 12 11 53
54 34 13 12 54
55 32 5 12 55
56 37 6 15 56
57 39 12 16 57
58 29 12 15 58
59 37 11 12 59
60 35 10 12 60
61 30 7 8 61
62 38 12 13 62
63 34 14 11 63
64 31 11 14 64
65 34 12 15 65
66 35 13 10 66
67 36 14 11 67
68 30 11 12 68
69 39 12 15 69
70 35 12 15 70
71 38 8 14 71
72 31 11 16 72
73 34 14 15 73
74 38 14 15 74
75 34 12 13 75
76 39 9 12 76
77 37 13 17 77
78 34 11 13 78
79 28 12 15 79
80 37 12 13 80
81 33 12 15 81
82 37 12 16 82
83 35 12 15 83
84 37 12 16 84
85 32 11 15 85
86 33 10 14 86
87 38 9 15 87
88 33 12 14 88
89 29 12 13 89
90 33 12 7 90
91 31 9 17 91
92 36 15 13 92
93 35 12 15 93
94 32 12 14 94
95 29 12 13 95
96 39 10 16 96
97 37 13 12 97
98 35 9 14 98
99 37 12 17 99
100 32 10 15 100
101 38 14 17 101
102 37 11 12 102
103 36 15 16 103
104 32 11 11 104
105 33 11 15 105
106 40 12 9 106
107 38 12 16 107
108 41 12 15 108
109 36 11 10 109
110 43 7 10 110
111 30 12 15 111
112 31 14 11 112
113 32 11 13 113
114 32 11 14 114
115 37 10 18 115
116 37 13 16 116
117 33 13 14 117
118 34 8 14 118
119 33 11 14 119
120 38 12 14 120
121 33 11 12 121
122 31 13 14 122
123 38 12 15 123
124 37 14 15 124
125 33 13 15 125
126 31 15 13 126
127 39 10 17 127
128 44 11 17 128
129 33 9 19 129
130 35 11 15 130
131 32 10 13 131
132 28 11 9 132
133 40 8 15 133
134 27 11 15 134
135 37 12 15 135
136 32 12 16 136
137 28 9 11 137
138 34 11 14 138
139 30 10 11 139
140 35 8 15 140
141 31 9 13 141
142 32 8 15 142
143 30 9 16 143
144 30 15 14 144
145 31 11 15 145
146 40 8 16 146
147 32 13 16 147
148 36 12 11 148
149 32 12 12 149
150 35 9 9 150
151 38 7 16 151
152 42 13 13 152
153 34 9 16 153
154 35 6 12 154
155 35 8 9 155
156 33 8 13 156
157 36 15 13 157
158 32 6 14 158
159 33 9 19 159
160 34 11 13 160
161 32 8 12 161
162 34 8 13 162
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Software Happiness t
31.913999 0.059944 0.187464 -0.007174
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.6010 -2.3638 -0.1403 2.3755 9.5809
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 31.913999 2.188821 14.580 <2e-16 ***
Software 0.059944 0.124867 0.480 0.632
Happiness 0.187464 0.113756 1.648 0.101
t -0.007174 0.005714 -1.255 0.211
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.351 on 158 degrees of freedom
Multiple R-squared: 0.03269, Adjusted R-squared: 0.01433
F-statistic: 1.78 on 3 and 158 DF, p-value: 0.1532
> 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.91167537 0.176649257 0.088324628
[2,] 0.83704099 0.325918015 0.162959008
[3,] 0.76221661 0.475566785 0.237783393
[4,] 0.70572848 0.588543035 0.294271517
[5,] 0.61077072 0.778458561 0.389229281
[6,] 0.54001421 0.919971578 0.459985789
[7,] 0.61348305 0.773033902 0.386516951
[8,] 0.54718551 0.905628980 0.452814490
[9,] 0.58724174 0.825516524 0.412758262
[10,] 0.58211223 0.835775544 0.417887772
[11,] 0.50130126 0.997397471 0.498698736
[12,] 0.44626394 0.892527880 0.553736060
[13,] 0.43747788 0.874955751 0.562522125
[14,] 0.47826846 0.956536922 0.521731539
[15,] 0.50619823 0.987603535 0.493801767
[16,] 0.47873956 0.957479115 0.521260442
[17,] 0.54596406 0.908071883 0.454035941
[18,] 0.50911612 0.981767752 0.490883876
[19,] 0.48545201 0.970904013 0.514547994
[20,] 0.62014121 0.759717580 0.379858790
[21,] 0.56214272 0.875714554 0.437857277
[22,] 0.54020463 0.919590747 0.459795373
[23,] 0.51810574 0.963788527 0.481894264
[24,] 0.47205216 0.944104315 0.527947843
[25,] 0.50259988 0.994800247 0.497400124
[26,] 0.72345420 0.553091601 0.276545800
[27,] 0.70096830 0.598063394 0.299031697
[28,] 0.65009154 0.699816928 0.349908464
[29,] 0.59640181 0.807196388 0.403598194
[30,] 0.56453313 0.870933736 0.435466868
[31,] 0.57836429 0.843271415 0.421635707
[32,] 0.54430485 0.911390292 0.455695146
[33,] 0.61025226 0.779495478 0.389747739
[34,] 0.57564153 0.848716949 0.424358474
[35,] 0.57692339 0.846153220 0.423076610
[36,] 0.52745029 0.945099425 0.472549712
[37,] 0.52412878 0.951742444 0.475871222
[38,] 0.48314573 0.966291457 0.516854272
[39,] 0.51343771 0.973124578 0.486562289
[40,] 0.49659093 0.993181864 0.503409068
[41,] 0.48560187 0.971203741 0.514398129
[42,] 0.44734991 0.894699830 0.552650085
[43,] 0.40389404 0.807788081 0.596105959
[44,] 0.40163110 0.803262190 0.598368905
[45,] 0.40205336 0.804106729 0.597946636
[46,] 0.37714828 0.754296561 0.622851719
[47,] 0.35060015 0.701200303 0.649399848
[48,] 0.30650149 0.613002973 0.693498514
[49,] 0.27363768 0.547275360 0.726362320
[50,] 0.27539388 0.550787765 0.724606117
[51,] 0.29636800 0.592735997 0.703632001
[52,] 0.38096333 0.761926666 0.619036667
[53,] 0.36855672 0.737113443 0.631443278
[54,] 0.32777725 0.655554503 0.672222748
[55,] 0.32492339 0.649846774 0.675076613
[56,] 0.32949060 0.658981196 0.670509402
[57,] 0.28857717 0.577154333 0.711422834
[58,] 0.29245554 0.584911087 0.707544457
[59,] 0.25560385 0.511207706 0.744396147
[60,] 0.22200226 0.444004528 0.777997736
[61,] 0.19662329 0.393246574 0.803376713
[62,] 0.21511741 0.430234830 0.784882585
[63,] 0.23908964 0.478179279 0.760910360
[64,] 0.20500000 0.410000000 0.795000000
[65,] 0.21538770 0.430775404 0.784612298
[66,] 0.22802144 0.456042887 0.771978556
[67,] 0.19706477 0.394129548 0.802935226
[68,] 0.19158372 0.383167441 0.808416279
[69,] 0.16239209 0.324784188 0.837607906
[70,] 0.19716551 0.394331021 0.802834490
[71,] 0.17440984 0.348819673 0.825590163
[72,] 0.14690289 0.293805776 0.853097112
[73,] 0.24353827 0.487076539 0.756461730
[74,] 0.22813547 0.456270936 0.771864532
[75,] 0.20430201 0.408604013 0.795697994
[76,] 0.18455908 0.369118165 0.815440918
[77,] 0.15581132 0.311622645 0.844188678
[78,] 0.13885976 0.277719512 0.861140244
[79,] 0.13082054 0.261641085 0.869179458
[80,] 0.11312912 0.226258249 0.886870876
[81,] 0.11319739 0.226394789 0.886802605
[82,] 0.09748851 0.194977022 0.902511489
[83,] 0.13417819 0.268356372 0.865821814
[84,] 0.11148285 0.222965702 0.888517149
[85,] 0.12653077 0.253061548 0.873469226
[86,] 0.10768039 0.215360776 0.892319612
[87,] 0.08865970 0.177319398 0.911340301
[88,] 0.08364556 0.167291112 0.916354444
[89,] 0.12285006 0.245700129 0.877149936
[90,] 0.13214697 0.264293946 0.867853027
[91,] 0.12140773 0.242815457 0.878592271
[92,] 0.10236041 0.204720816 0.897639592
[93,] 0.08760699 0.175213989 0.912393006
[94,] 0.08767265 0.175345306 0.912327347
[95,] 0.07956291 0.159125824 0.920437088
[96,] 0.07182008 0.143640157 0.928179921
[97,] 0.05780855 0.115617093 0.942191454
[98,] 0.05172921 0.103458428 0.948270786
[99,] 0.04557332 0.091146646 0.954426677
[100,] 0.07547142 0.150942836 0.924528582
[101,] 0.06970972 0.139419444 0.930290278
[102,] 0.11103997 0.222079939 0.888960031
[103,] 0.09893345 0.197866891 0.901066555
[104,] 0.33974043 0.679480856 0.660259572
[105,] 0.37165010 0.743300191 0.628349904
[106,] 0.34875856 0.697517111 0.651241445
[107,] 0.31691115 0.633822292 0.683088854
[108,] 0.29151381 0.583027624 0.708486188
[109,] 0.25766200 0.515324002 0.742337999
[110,] 0.23334817 0.466696338 0.766651831
[111,] 0.20075391 0.401507827 0.799246087
[112,] 0.16680257 0.333605138 0.833197431
[113,] 0.13998928 0.279978566 0.860010717
[114,] 0.14808243 0.296164864 0.851917568
[115,] 0.12119334 0.242386678 0.878806661
[116,] 0.11493861 0.229877217 0.885061392
[117,] 0.11788802 0.235776046 0.882111977
[118,] 0.11092608 0.221852160 0.889073920
[119,] 0.08965090 0.179301800 0.910349100
[120,] 0.07934844 0.158696887 0.920651557
[121,] 0.09056427 0.181128543 0.909435728
[122,] 0.38843701 0.776874018 0.611562991
[123,] 0.34121037 0.682420745 0.658789628
[124,] 0.31488421 0.629768412 0.685115794
[125,] 0.26969753 0.539395055 0.730302472
[126,] 0.28535618 0.570712367 0.714643817
[127,] 0.51150876 0.976982481 0.488491240
[128,] 0.62498194 0.750036112 0.375018056
[129,] 0.67283653 0.654326945 0.327163473
[130,] 0.61759074 0.764818525 0.382409263
[131,] 0.66680223 0.666395533 0.333197766
[132,] 0.61091462 0.778170760 0.389085380
[133,] 0.60378565 0.792428698 0.396214349
[134,] 0.55776338 0.884473247 0.442236624
[135,] 0.52045792 0.959084165 0.479542083
[136,] 0.46211323 0.924226458 0.537886771
[137,] 0.50300192 0.993996157 0.496998079
[138,] 0.60004805 0.799903899 0.399951950
[139,] 0.71291916 0.574161685 0.287080843
[140,] 0.78068807 0.438623853 0.219311927
[141,] 0.85112652 0.297746950 0.148873475
[142,] 0.79508499 0.409830021 0.204915010
[143,] 0.95658362 0.086832754 0.043416377
[144,] 0.96299386 0.074012276 0.037006138
[145,] 0.95354752 0.092904966 0.046452483
[146,] 0.99790582 0.004188363 0.002094182
[147,] 0.99276683 0.014466348 0.007233174
[148,] 0.98846664 0.023066723 0.011533361
[149,] 0.98025654 0.039486922 0.019743461
> postscript(file="/var/www/html/freestat/rcomp/tmp/1fmdi1290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/2fmdi1290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/3qvck1290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/4qvck1290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/5qvck1290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 162
Frequency = 1
1 2 3 4 5 6
5.74934672 3.06660844 -4.85374475 -3.49453737 -1.65682883 -0.84475049
7 8 9 10 11 12
3.79239212 -1.32032194 0.61927641 1.98611552 2.37858484 -0.10905755
13 14 15 16 17 18
3.58529417 3.52762756 -3.07990313 -3.14303980 0.98402273 2.30891617
19 20 21 22 23 24
3.93842705 -3.48927120 -3.79708115 -3.53760191 3.84723568 2.34922654
25 26 27 28 29 30
3.53896824 6.80607921 0.68083672 -2.17683730 -2.23723894 -0.36031976
31 32 33 34 35 36
-4.41035464 -7.60101133 1.53641795 -1.20136778 -1.00672938 -3.07476275
37 38 39 40 41 42
-4.69539521 0.82732915 -6.42053666 0.33649423 1.96874014 -1.33143809
43 44 45 46 47 48
2.49590370 0.55265533 3.55982956 2.63457967 2.83195309 -2.04098439
49 50 51 52 53 54
0.59126152 3.28834826 -3.38675829 -2.76487914 -2.31520071 -0.55543479
55 56 57 58 59 60
-2.06870739 2.31613020 3.77617539 -6.02918621 2.60032467 0.66744304
61 62 63 64 65 66
-3.39569362 3.37443905 -0.36334668 -3.73873251 -0.97896659 0.90558433
67 68 69 70 71 72
1.66535025 -4.33510725 4.04973034 0.05690458 3.49131956 -4.05626698
73 74 75 76 77 78
-1.04146102 2.96571321 -0.53229593 4.84217490 1.67225172 -0.45082909
79 80 81 82 83 84
-6.87852733 2.50357523 -1.86417887 1.95553120 0.15016959 1.96987966
85 86 87 88 89 90
-2.77553780 -1.52095525 3.35869896 -1.62649508 -5.43185668 -0.29989746
91 92 93 94 95 96
-3.98753244 1.40983358 0.22191192 -2.58344969 -5.38881129 4.17585874
97 98 99 100 101 102
2.75305719 0.62507968 1.89002898 -2.60798017 2.78448915 2.90881665
103 104 105 106 107 108
0.92635763 -1.88937072 -1.63205315 6.43996193 3.13488700 6.32952540
109 110 111 112 113 114
2.33396460 9.58091542 -4.64895191 -3.01180930 -2.19973096 -2.38002090
115 116 117 118 119 120
1.93724082 2.13951094 -1.47838649 -0.17149153 -1.34414974 3.60308035
121 122 123 124 125 126
-0.95487294 -3.44251533 3.43713888 2.32442482 -1.60845680 -3.34624253
127 128 129 130 131 132
4.21079577 9.15802586 -2.08983995 0.54730265 -2.01065064 -5.31356389
133 134 135 136 137 138
5.74865779 -7.42400042 2.52322967 -2.65706027 -5.53273277 -0.20783933
139 140 141 142 143 144
-3.57832845 0.79887741 -2.87896417 -2.18677412 -4.42700820 -4.40457052
145 146 147 148 149 150
-3.34508387 5.65445864 -2.63808786 2.36635135 -1.81393859 1.93546058
151 152 153 154 155 156
3.75027395 7.96017580 -0.35526588 1.58159745 2.03127589 -0.71140654
157 158 159 160 161 162
1.87615867 -1.76463395 -1.87461299 0.13745795 -1.48807122 0.33163885
> postscript(file="/var/www/html/freestat/rcomp/tmp/6i4u51290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 5.74934672 NA
1 3.06660844 5.74934672
2 -4.85374475 3.06660844
3 -3.49453737 -4.85374475
4 -1.65682883 -3.49453737
5 -0.84475049 -1.65682883
6 3.79239212 -0.84475049
7 -1.32032194 3.79239212
8 0.61927641 -1.32032194
9 1.98611552 0.61927641
10 2.37858484 1.98611552
11 -0.10905755 2.37858484
12 3.58529417 -0.10905755
13 3.52762756 3.58529417
14 -3.07990313 3.52762756
15 -3.14303980 -3.07990313
16 0.98402273 -3.14303980
17 2.30891617 0.98402273
18 3.93842705 2.30891617
19 -3.48927120 3.93842705
20 -3.79708115 -3.48927120
21 -3.53760191 -3.79708115
22 3.84723568 -3.53760191
23 2.34922654 3.84723568
24 3.53896824 2.34922654
25 6.80607921 3.53896824
26 0.68083672 6.80607921
27 -2.17683730 0.68083672
28 -2.23723894 -2.17683730
29 -0.36031976 -2.23723894
30 -4.41035464 -0.36031976
31 -7.60101133 -4.41035464
32 1.53641795 -7.60101133
33 -1.20136778 1.53641795
34 -1.00672938 -1.20136778
35 -3.07476275 -1.00672938
36 -4.69539521 -3.07476275
37 0.82732915 -4.69539521
38 -6.42053666 0.82732915
39 0.33649423 -6.42053666
40 1.96874014 0.33649423
41 -1.33143809 1.96874014
42 2.49590370 -1.33143809
43 0.55265533 2.49590370
44 3.55982956 0.55265533
45 2.63457967 3.55982956
46 2.83195309 2.63457967
47 -2.04098439 2.83195309
48 0.59126152 -2.04098439
49 3.28834826 0.59126152
50 -3.38675829 3.28834826
51 -2.76487914 -3.38675829
52 -2.31520071 -2.76487914
53 -0.55543479 -2.31520071
54 -2.06870739 -0.55543479
55 2.31613020 -2.06870739
56 3.77617539 2.31613020
57 -6.02918621 3.77617539
58 2.60032467 -6.02918621
59 0.66744304 2.60032467
60 -3.39569362 0.66744304
61 3.37443905 -3.39569362
62 -0.36334668 3.37443905
63 -3.73873251 -0.36334668
64 -0.97896659 -3.73873251
65 0.90558433 -0.97896659
66 1.66535025 0.90558433
67 -4.33510725 1.66535025
68 4.04973034 -4.33510725
69 0.05690458 4.04973034
70 3.49131956 0.05690458
71 -4.05626698 3.49131956
72 -1.04146102 -4.05626698
73 2.96571321 -1.04146102
74 -0.53229593 2.96571321
75 4.84217490 -0.53229593
76 1.67225172 4.84217490
77 -0.45082909 1.67225172
78 -6.87852733 -0.45082909
79 2.50357523 -6.87852733
80 -1.86417887 2.50357523
81 1.95553120 -1.86417887
82 0.15016959 1.95553120
83 1.96987966 0.15016959
84 -2.77553780 1.96987966
85 -1.52095525 -2.77553780
86 3.35869896 -1.52095525
87 -1.62649508 3.35869896
88 -5.43185668 -1.62649508
89 -0.29989746 -5.43185668
90 -3.98753244 -0.29989746
91 1.40983358 -3.98753244
92 0.22191192 1.40983358
93 -2.58344969 0.22191192
94 -5.38881129 -2.58344969
95 4.17585874 -5.38881129
96 2.75305719 4.17585874
97 0.62507968 2.75305719
98 1.89002898 0.62507968
99 -2.60798017 1.89002898
100 2.78448915 -2.60798017
101 2.90881665 2.78448915
102 0.92635763 2.90881665
103 -1.88937072 0.92635763
104 -1.63205315 -1.88937072
105 6.43996193 -1.63205315
106 3.13488700 6.43996193
107 6.32952540 3.13488700
108 2.33396460 6.32952540
109 9.58091542 2.33396460
110 -4.64895191 9.58091542
111 -3.01180930 -4.64895191
112 -2.19973096 -3.01180930
113 -2.38002090 -2.19973096
114 1.93724082 -2.38002090
115 2.13951094 1.93724082
116 -1.47838649 2.13951094
117 -0.17149153 -1.47838649
118 -1.34414974 -0.17149153
119 3.60308035 -1.34414974
120 -0.95487294 3.60308035
121 -3.44251533 -0.95487294
122 3.43713888 -3.44251533
123 2.32442482 3.43713888
124 -1.60845680 2.32442482
125 -3.34624253 -1.60845680
126 4.21079577 -3.34624253
127 9.15802586 4.21079577
128 -2.08983995 9.15802586
129 0.54730265 -2.08983995
130 -2.01065064 0.54730265
131 -5.31356389 -2.01065064
132 5.74865779 -5.31356389
133 -7.42400042 5.74865779
134 2.52322967 -7.42400042
135 -2.65706027 2.52322967
136 -5.53273277 -2.65706027
137 -0.20783933 -5.53273277
138 -3.57832845 -0.20783933
139 0.79887741 -3.57832845
140 -2.87896417 0.79887741
141 -2.18677412 -2.87896417
142 -4.42700820 -2.18677412
143 -4.40457052 -4.42700820
144 -3.34508387 -4.40457052
145 5.65445864 -3.34508387
146 -2.63808786 5.65445864
147 2.36635135 -2.63808786
148 -1.81393859 2.36635135
149 1.93546058 -1.81393859
150 3.75027395 1.93546058
151 7.96017580 3.75027395
152 -0.35526588 7.96017580
153 1.58159745 -0.35526588
154 2.03127589 1.58159745
155 -0.71140654 2.03127589
156 1.87615867 -0.71140654
157 -1.76463395 1.87615867
158 -1.87461299 -1.76463395
159 0.13745795 -1.87461299
160 -1.48807122 0.13745795
161 0.33163885 -1.48807122
162 NA 0.33163885
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.06660844 5.74934672
[2,] -4.85374475 3.06660844
[3,] -3.49453737 -4.85374475
[4,] -1.65682883 -3.49453737
[5,] -0.84475049 -1.65682883
[6,] 3.79239212 -0.84475049
[7,] -1.32032194 3.79239212
[8,] 0.61927641 -1.32032194
[9,] 1.98611552 0.61927641
[10,] 2.37858484 1.98611552
[11,] -0.10905755 2.37858484
[12,] 3.58529417 -0.10905755
[13,] 3.52762756 3.58529417
[14,] -3.07990313 3.52762756
[15,] -3.14303980 -3.07990313
[16,] 0.98402273 -3.14303980
[17,] 2.30891617 0.98402273
[18,] 3.93842705 2.30891617
[19,] -3.48927120 3.93842705
[20,] -3.79708115 -3.48927120
[21,] -3.53760191 -3.79708115
[22,] 3.84723568 -3.53760191
[23,] 2.34922654 3.84723568
[24,] 3.53896824 2.34922654
[25,] 6.80607921 3.53896824
[26,] 0.68083672 6.80607921
[27,] -2.17683730 0.68083672
[28,] -2.23723894 -2.17683730
[29,] -0.36031976 -2.23723894
[30,] -4.41035464 -0.36031976
[31,] -7.60101133 -4.41035464
[32,] 1.53641795 -7.60101133
[33,] -1.20136778 1.53641795
[34,] -1.00672938 -1.20136778
[35,] -3.07476275 -1.00672938
[36,] -4.69539521 -3.07476275
[37,] 0.82732915 -4.69539521
[38,] -6.42053666 0.82732915
[39,] 0.33649423 -6.42053666
[40,] 1.96874014 0.33649423
[41,] -1.33143809 1.96874014
[42,] 2.49590370 -1.33143809
[43,] 0.55265533 2.49590370
[44,] 3.55982956 0.55265533
[45,] 2.63457967 3.55982956
[46,] 2.83195309 2.63457967
[47,] -2.04098439 2.83195309
[48,] 0.59126152 -2.04098439
[49,] 3.28834826 0.59126152
[50,] -3.38675829 3.28834826
[51,] -2.76487914 -3.38675829
[52,] -2.31520071 -2.76487914
[53,] -0.55543479 -2.31520071
[54,] -2.06870739 -0.55543479
[55,] 2.31613020 -2.06870739
[56,] 3.77617539 2.31613020
[57,] -6.02918621 3.77617539
[58,] 2.60032467 -6.02918621
[59,] 0.66744304 2.60032467
[60,] -3.39569362 0.66744304
[61,] 3.37443905 -3.39569362
[62,] -0.36334668 3.37443905
[63,] -3.73873251 -0.36334668
[64,] -0.97896659 -3.73873251
[65,] 0.90558433 -0.97896659
[66,] 1.66535025 0.90558433
[67,] -4.33510725 1.66535025
[68,] 4.04973034 -4.33510725
[69,] 0.05690458 4.04973034
[70,] 3.49131956 0.05690458
[71,] -4.05626698 3.49131956
[72,] -1.04146102 -4.05626698
[73,] 2.96571321 -1.04146102
[74,] -0.53229593 2.96571321
[75,] 4.84217490 -0.53229593
[76,] 1.67225172 4.84217490
[77,] -0.45082909 1.67225172
[78,] -6.87852733 -0.45082909
[79,] 2.50357523 -6.87852733
[80,] -1.86417887 2.50357523
[81,] 1.95553120 -1.86417887
[82,] 0.15016959 1.95553120
[83,] 1.96987966 0.15016959
[84,] -2.77553780 1.96987966
[85,] -1.52095525 -2.77553780
[86,] 3.35869896 -1.52095525
[87,] -1.62649508 3.35869896
[88,] -5.43185668 -1.62649508
[89,] -0.29989746 -5.43185668
[90,] -3.98753244 -0.29989746
[91,] 1.40983358 -3.98753244
[92,] 0.22191192 1.40983358
[93,] -2.58344969 0.22191192
[94,] -5.38881129 -2.58344969
[95,] 4.17585874 -5.38881129
[96,] 2.75305719 4.17585874
[97,] 0.62507968 2.75305719
[98,] 1.89002898 0.62507968
[99,] -2.60798017 1.89002898
[100,] 2.78448915 -2.60798017
[101,] 2.90881665 2.78448915
[102,] 0.92635763 2.90881665
[103,] -1.88937072 0.92635763
[104,] -1.63205315 -1.88937072
[105,] 6.43996193 -1.63205315
[106,] 3.13488700 6.43996193
[107,] 6.32952540 3.13488700
[108,] 2.33396460 6.32952540
[109,] 9.58091542 2.33396460
[110,] -4.64895191 9.58091542
[111,] -3.01180930 -4.64895191
[112,] -2.19973096 -3.01180930
[113,] -2.38002090 -2.19973096
[114,] 1.93724082 -2.38002090
[115,] 2.13951094 1.93724082
[116,] -1.47838649 2.13951094
[117,] -0.17149153 -1.47838649
[118,] -1.34414974 -0.17149153
[119,] 3.60308035 -1.34414974
[120,] -0.95487294 3.60308035
[121,] -3.44251533 -0.95487294
[122,] 3.43713888 -3.44251533
[123,] 2.32442482 3.43713888
[124,] -1.60845680 2.32442482
[125,] -3.34624253 -1.60845680
[126,] 4.21079577 -3.34624253
[127,] 9.15802586 4.21079577
[128,] -2.08983995 9.15802586
[129,] 0.54730265 -2.08983995
[130,] -2.01065064 0.54730265
[131,] -5.31356389 -2.01065064
[132,] 5.74865779 -5.31356389
[133,] -7.42400042 5.74865779
[134,] 2.52322967 -7.42400042
[135,] -2.65706027 2.52322967
[136,] -5.53273277 -2.65706027
[137,] -0.20783933 -5.53273277
[138,] -3.57832845 -0.20783933
[139,] 0.79887741 -3.57832845
[140,] -2.87896417 0.79887741
[141,] -2.18677412 -2.87896417
[142,] -4.42700820 -2.18677412
[143,] -4.40457052 -4.42700820
[144,] -3.34508387 -4.40457052
[145,] 5.65445864 -3.34508387
[146,] -2.63808786 5.65445864
[147,] 2.36635135 -2.63808786
[148,] -1.81393859 2.36635135
[149,] 1.93546058 -1.81393859
[150,] 3.75027395 1.93546058
[151,] 7.96017580 3.75027395
[152,] -0.35526588 7.96017580
[153,] 1.58159745 -0.35526588
[154,] 2.03127589 1.58159745
[155,] -0.71140654 2.03127589
[156,] 1.87615867 -0.71140654
[157,] -1.76463395 1.87615867
[158,] -1.87461299 -1.76463395
[159,] 0.13745795 -1.87461299
[160,] -1.48807122 0.13745795
[161,] 0.33163885 -1.48807122
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.06660844 5.74934672
2 -4.85374475 3.06660844
3 -3.49453737 -4.85374475
4 -1.65682883 -3.49453737
5 -0.84475049 -1.65682883
6 3.79239212 -0.84475049
7 -1.32032194 3.79239212
8 0.61927641 -1.32032194
9 1.98611552 0.61927641
10 2.37858484 1.98611552
11 -0.10905755 2.37858484
12 3.58529417 -0.10905755
13 3.52762756 3.58529417
14 -3.07990313 3.52762756
15 -3.14303980 -3.07990313
16 0.98402273 -3.14303980
17 2.30891617 0.98402273
18 3.93842705 2.30891617
19 -3.48927120 3.93842705
20 -3.79708115 -3.48927120
21 -3.53760191 -3.79708115
22 3.84723568 -3.53760191
23 2.34922654 3.84723568
24 3.53896824 2.34922654
25 6.80607921 3.53896824
26 0.68083672 6.80607921
27 -2.17683730 0.68083672
28 -2.23723894 -2.17683730
29 -0.36031976 -2.23723894
30 -4.41035464 -0.36031976
31 -7.60101133 -4.41035464
32 1.53641795 -7.60101133
33 -1.20136778 1.53641795
34 -1.00672938 -1.20136778
35 -3.07476275 -1.00672938
36 -4.69539521 -3.07476275
37 0.82732915 -4.69539521
38 -6.42053666 0.82732915
39 0.33649423 -6.42053666
40 1.96874014 0.33649423
41 -1.33143809 1.96874014
42 2.49590370 -1.33143809
43 0.55265533 2.49590370
44 3.55982956 0.55265533
45 2.63457967 3.55982956
46 2.83195309 2.63457967
47 -2.04098439 2.83195309
48 0.59126152 -2.04098439
49 3.28834826 0.59126152
50 -3.38675829 3.28834826
51 -2.76487914 -3.38675829
52 -2.31520071 -2.76487914
53 -0.55543479 -2.31520071
54 -2.06870739 -0.55543479
55 2.31613020 -2.06870739
56 3.77617539 2.31613020
57 -6.02918621 3.77617539
58 2.60032467 -6.02918621
59 0.66744304 2.60032467
60 -3.39569362 0.66744304
61 3.37443905 -3.39569362
62 -0.36334668 3.37443905
63 -3.73873251 -0.36334668
64 -0.97896659 -3.73873251
65 0.90558433 -0.97896659
66 1.66535025 0.90558433
67 -4.33510725 1.66535025
68 4.04973034 -4.33510725
69 0.05690458 4.04973034
70 3.49131956 0.05690458
71 -4.05626698 3.49131956
72 -1.04146102 -4.05626698
73 2.96571321 -1.04146102
74 -0.53229593 2.96571321
75 4.84217490 -0.53229593
76 1.67225172 4.84217490
77 -0.45082909 1.67225172
78 -6.87852733 -0.45082909
79 2.50357523 -6.87852733
80 -1.86417887 2.50357523
81 1.95553120 -1.86417887
82 0.15016959 1.95553120
83 1.96987966 0.15016959
84 -2.77553780 1.96987966
85 -1.52095525 -2.77553780
86 3.35869896 -1.52095525
87 -1.62649508 3.35869896
88 -5.43185668 -1.62649508
89 -0.29989746 -5.43185668
90 -3.98753244 -0.29989746
91 1.40983358 -3.98753244
92 0.22191192 1.40983358
93 -2.58344969 0.22191192
94 -5.38881129 -2.58344969
95 4.17585874 -5.38881129
96 2.75305719 4.17585874
97 0.62507968 2.75305719
98 1.89002898 0.62507968
99 -2.60798017 1.89002898
100 2.78448915 -2.60798017
101 2.90881665 2.78448915
102 0.92635763 2.90881665
103 -1.88937072 0.92635763
104 -1.63205315 -1.88937072
105 6.43996193 -1.63205315
106 3.13488700 6.43996193
107 6.32952540 3.13488700
108 2.33396460 6.32952540
109 9.58091542 2.33396460
110 -4.64895191 9.58091542
111 -3.01180930 -4.64895191
112 -2.19973096 -3.01180930
113 -2.38002090 -2.19973096
114 1.93724082 -2.38002090
115 2.13951094 1.93724082
116 -1.47838649 2.13951094
117 -0.17149153 -1.47838649
118 -1.34414974 -0.17149153
119 3.60308035 -1.34414974
120 -0.95487294 3.60308035
121 -3.44251533 -0.95487294
122 3.43713888 -3.44251533
123 2.32442482 3.43713888
124 -1.60845680 2.32442482
125 -3.34624253 -1.60845680
126 4.21079577 -3.34624253
127 9.15802586 4.21079577
128 -2.08983995 9.15802586
129 0.54730265 -2.08983995
130 -2.01065064 0.54730265
131 -5.31356389 -2.01065064
132 5.74865779 -5.31356389
133 -7.42400042 5.74865779
134 2.52322967 -7.42400042
135 -2.65706027 2.52322967
136 -5.53273277 -2.65706027
137 -0.20783933 -5.53273277
138 -3.57832845 -0.20783933
139 0.79887741 -3.57832845
140 -2.87896417 0.79887741
141 -2.18677412 -2.87896417
142 -4.42700820 -2.18677412
143 -4.40457052 -4.42700820
144 -3.34508387 -4.40457052
145 5.65445864 -3.34508387
146 -2.63808786 5.65445864
147 2.36635135 -2.63808786
148 -1.81393859 2.36635135
149 1.93546058 -1.81393859
150 3.75027395 1.93546058
151 7.96017580 3.75027395
152 -0.35526588 7.96017580
153 1.58159745 -0.35526588
154 2.03127589 1.58159745
155 -0.71140654 2.03127589
156 1.87615867 -0.71140654
157 -1.76463395 1.87615867
158 -1.87461299 -1.76463395
159 0.13745795 -1.87461299
160 -1.48807122 0.13745795
161 0.33163885 -1.48807122
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/7tet91290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/8tet91290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/9tet91290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/freestat/rcomp/tmp/1045at1290550606.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/11p5rh1290550606.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/12b67n1290550606.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/137g5e1290550606.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/14agm21290550606.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/freestat/rcomp/tmp/15dzkq1290550606.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/freestat/rcomp/tmp/16hhjd1290550606.tab")
+ }
>
> try(system("convert tmp/1fmdi1290550606.ps tmp/1fmdi1290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/2fmdi1290550606.ps tmp/2fmdi1290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/3qvck1290550606.ps tmp/3qvck1290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qvck1290550606.ps tmp/4qvck1290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/5qvck1290550606.ps tmp/5qvck1290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/6i4u51290550606.ps tmp/6i4u51290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/7tet91290550606.ps tmp/7tet91290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/8tet91290550606.ps tmp/8tet91290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/9tet91290550606.ps tmp/9tet91290550606.png",intern=TRUE))
character(0)
> try(system("convert tmp/1045at1290550606.ps tmp/1045at1290550606.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.474 2.640 5.844