R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(41
+ ,12
+ ,14
+ ,12
+ ,39
+ ,11
+ ,18
+ ,11
+ ,30
+ ,15
+ ,11
+ ,14
+ ,31
+ ,6
+ ,12
+ ,12
+ ,34
+ ,13
+ ,16
+ ,21
+ ,35
+ ,10
+ ,18
+ ,12
+ ,39
+ ,12
+ ,14
+ ,22
+ ,34
+ ,14
+ ,14
+ ,11
+ ,36
+ ,12
+ ,15
+ ,10
+ ,37
+ ,6
+ ,15
+ ,13
+ ,38
+ ,10
+ ,17
+ ,10
+ ,36
+ ,12
+ ,19
+ ,8
+ ,38
+ ,12
+ ,10
+ ,15
+ ,39
+ ,11
+ ,16
+ ,14
+ ,33
+ ,15
+ ,18
+ ,10
+ ,32
+ ,12
+ ,14
+ ,14
+ ,36
+ ,10
+ ,14
+ ,14
+ ,38
+ ,12
+ ,17
+ ,11
+ ,39
+ ,11
+ ,14
+ ,10
+ ,32
+ ,12
+ ,16
+ ,13
+ ,32
+ ,11
+ ,18
+ ,7
+ ,31
+ ,12
+ ,11
+ ,14
+ ,39
+ ,13
+ ,14
+ ,12
+ ,37
+ ,11
+ ,12
+ ,14
+ ,39
+ ,9
+ ,17
+ ,11
+ ,41
+ ,13
+ ,9
+ ,9
+ ,36
+ ,10
+ ,16
+ ,11
+ ,33
+ ,14
+ ,14
+ ,15
+ ,33
+ ,12
+ ,15
+ ,14
+ ,34
+ ,10
+ ,11
+ ,13
+ ,31
+ ,12
+ ,16
+ ,9
+ ,27
+ ,8
+ ,13
+ ,15
+ ,37
+ ,10
+ ,17
+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,18
+ ,34
+ ,8
+ ,13
+ ,16)
+ ,dim=c(4
+ ,162)
+ ,dimnames=list(c('Connected'
+ ,'Software'
+ ,'Happiness'
+ ,'Depression')
+ ,1:162))
> y <- array(NA,dim=c(4,162),dimnames=list(c('Connected','Software','Happiness','Depression'),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 Depression t
1 41 12 14 12 1
2 39 11 18 11 2
3 30 15 11 14 3
4 31 6 12 12 4
5 34 13 16 21 5
6 35 10 18 12 6
7 39 12 14 22 7
8 34 14 14 11 8
9 36 12 15 10 9
10 37 6 15 13 10
11 38 10 17 10 11
12 36 12 19 8 12
13 38 12 10 15 13
14 39 11 16 14 14
15 33 15 18 10 15
16 32 12 14 14 16
17 36 10 14 14 17
18 38 12 17 11 18
19 39 11 14 10 19
20 32 12 16 13 20
21 32 11 18 7 21
22 31 12 11 14 22
23 39 13 14 12 23
24 37 11 12 14 24
25 39 9 17 11 25
26 41 13 9 9 26
27 36 10 16 11 27
28 33 14 14 15 28
29 33 12 15 14 29
30 34 10 11 13 30
31 31 12 16 9 31
32 27 8 13 15 32
33 37 10 17 10 33
34 34 12 15 11 34
35 34 12 14 13 35
36 32 7 16 8 36
37 29 6 9 20 37
38 36 12 15 12 38
39 29 10 17 10 39
40 35 10 13 10 40
41 37 10 15 9 41
42 34 12 16 14 42
43 38 15 16 8 43
44 35 10 12 14 44
45 38 10 12 11 45
46 37 12 11 13 46
47 38 13 15 9 47
48 33 11 15 11 48
49 36 11 17 15 49
50 38 12 13 11 50
51 32 14 16 10 51
52 32 10 14 14 52
53 32 12 11 18 53
54 34 13 12 14 54
55 32 5 12 11 55
56 37 6 15 12 56
57 39 12 16 13 57
58 29 12 15 9 58
59 37 11 12 10 59
60 35 10 12 15 60
61 30 7 8 20 61
62 38 12 13 12 62
63 34 14 11 12 63
64 31 11 14 14 64
65 34 12 15 13 65
66 35 13 10 11 66
67 36 14 11 17 67
68 30 11 12 12 68
69 39 12 15 13 69
70 35 12 15 14 70
71 38 8 14 13 71
72 31 11 16 15 72
73 34 14 15 13 73
74 38 14 15 10 74
75 34 12 13 11 75
76 39 9 12 19 76
77 37 13 17 13 77
78 34 11 13 17 78
79 28 12 15 13 79
80 37 12 13 9 80
81 33 12 15 11 81
82 37 12 16 10 82
83 35 12 15 9 83
84 37 12 16 12 84
85 32 11 15 12 85
86 33 10 14 13 86
87 38 9 15 13 87
88 33 12 14 12 88
89 29 12 13 15 89
90 33 12 7 22 90
91 31 9 17 13 91
92 36 15 13 15 92
93 35 12 15 13 93
94 32 12 14 15 94
95 29 12 13 10 95
96 39 10 16 11 96
97 37 13 12 16 97
98 35 9 14 11 98
99 37 12 17 11 99
100 32 10 15 10 100
101 38 14 17 10 101
102 37 11 12 16 102
103 36 15 16 12 103
104 32 11 11 11 104
105 33 11 15 16 105
106 40 12 9 19 106
107 38 12 16 11 107
108 41 12 15 16 108
109 36 11 10 15 109
110 43 7 10 24 110
111 30 12 15 14 111
112 31 14 11 15 112
113 32 11 13 11 113
114 32 11 14 15 114
115 37 10 18 12 115
116 37 13 16 10 116
117 33 13 14 14 117
118 34 8 14 13 118
119 33 11 14 9 119
120 38 12 14 15 120
121 33 11 12 15 121
122 31 13 14 14 122
123 38 12 15 11 123
124 37 14 15 8 124
125 33 13 15 11 125
126 31 15 13 11 126
127 39 10 17 8 127
128 44 11 17 10 128
129 33 9 19 11 129
130 35 11 15 13 130
131 32 10 13 11 131
132 28 11 9 20 132
133 40 8 15 10 133
134 27 11 15 15 134
135 37 12 15 12 135
136 32 12 16 14 136
137 28 9 11 23 137
138 34 11 14 14 138
139 30 10 11 16 139
140 35 8 15 11 140
141 31 9 13 12 141
142 32 8 15 10 142
143 30 9 16 14 143
144 30 15 14 12 144
145 31 11 15 12 145
146 40 8 16 11 146
147 32 13 16 12 147
148 36 12 11 13 148
149 32 12 12 11 149
150 35 9 9 19 150
151 38 7 16 12 151
152 42 13 13 17 152
153 34 9 16 9 153
154 35 6 12 12 154
155 35 8 9 19 155
156 33 8 13 18 156
157 36 15 13 15 157
158 32 6 14 14 158
159 33 9 19 11 159
160 34 11 13 9 160
161 32 8 12 18 161
162 34 8 13 16 162
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Software Happiness Depression t
33.087572 0.053725 0.152393 -0.048718 -0.006967
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.5448 -2.3341 -0.1304 2.3411 9.9480
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 33.087572 3.268870 10.122 <2e-16 ***
Software 0.053725 0.125827 0.427 0.670
Happiness 0.152393 0.135081 1.128 0.261
Depression -0.048718 0.100588 -0.484 0.629
t -0.006967 0.005744 -1.213 0.227
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.359 on 157 degrees of freedom
Multiple R-squared: 0.03414, Adjusted R-squared: 0.009528
F-statistic: 1.387 on 4 and 157 DF, p-value: 0.2408
> 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.89624398 0.20751205 0.10375602
[2,] 0.84528901 0.30942197 0.15471099
[3,] 0.79171462 0.41657076 0.20828538
[4,] 0.70670504 0.58658991 0.29329496
[5,] 0.62659733 0.74680535 0.37340267
[6,] 0.68499428 0.63001145 0.31500572
[7,] 0.61383154 0.77233691 0.38616846
[8,] 0.63455636 0.73088728 0.36544364
[9,] 0.63453674 0.73092652 0.36546326
[10,] 0.55171114 0.89657771 0.44828886
[11,] 0.49665542 0.99331083 0.50334458
[12,] 0.49669753 0.99339506 0.50330247
[13,] 0.54045354 0.91909293 0.45954646
[14,] 0.55427590 0.89144819 0.44572410
[15,] 0.52691707 0.94616585 0.47308293
[16,] 0.59176759 0.81646483 0.40823241
[17,] 0.55082688 0.89834625 0.44917312
[18,] 0.52248539 0.95502923 0.47751461
[19,] 0.66543426 0.66913148 0.33456574
[20,] 0.60844977 0.78310046 0.39155023
[21,] 0.58324684 0.83350632 0.41675316
[22,] 0.55568452 0.88863097 0.44431548
[23,] 0.50812213 0.98375573 0.49187787
[24,] 0.54154652 0.91690697 0.45845348
[25,] 0.73645562 0.52708876 0.26354438
[26,] 0.71319722 0.57360556 0.28680278
[27,] 0.66246136 0.67507727 0.33753864
[28,] 0.60871891 0.78256218 0.39128109
[29,] 0.58184128 0.83631744 0.41815872
[30,] 0.57278761 0.85442477 0.42721239
[31,] 0.54102607 0.91794786 0.45897393
[32,] 0.60691669 0.78616662 0.39308331
[33,] 0.56593483 0.86813035 0.43406517
[34,] 0.55795518 0.88408963 0.44204482
[35,] 0.51088707 0.97822586 0.48911293
[36,] 0.49739844 0.99479689 0.50260156
[37,] 0.46047228 0.92094456 0.53952772
[38,] 0.48222337 0.96444674 0.51777663
[39,] 0.46643503 0.93287007 0.53356497
[40,] 0.45026379 0.90052757 0.54973621
[41,] 0.41044051 0.82088102 0.58955949
[42,] 0.38188029 0.76376058 0.61811971
[43,] 0.37745715 0.75491430 0.62254285
[44,] 0.37747987 0.75495975 0.62252013
[45,] 0.34714036 0.69428072 0.65285964
[46,] 0.31146382 0.62292763 0.68853618
[47,] 0.26893177 0.53786354 0.73106823
[48,] 0.23797533 0.47595065 0.76202467
[49,] 0.24437659 0.48875318 0.75562341
[50,] 0.27535450 0.55070901 0.72464550
[51,] 0.36866513 0.73733026 0.63133487
[52,] 0.34992226 0.69984452 0.65007774
[53,] 0.31241815 0.62483631 0.68758185
[54,] 0.29981504 0.59963008 0.70018496
[55,] 0.30391633 0.60783265 0.69608367
[56,] 0.26487450 0.52974899 0.73512550
[57,] 0.26264545 0.52529091 0.73735455
[58,] 0.22739164 0.45478328 0.77260836
[59,] 0.19459231 0.38918461 0.80540769
[60,] 0.17577349 0.35154699 0.82422651
[61,] 0.19469983 0.38939967 0.80530017
[62,] 0.22326547 0.44653095 0.77673453
[63,] 0.19135644 0.38271288 0.80864356
[64,] 0.20331190 0.40662380 0.79668810
[65,] 0.20899502 0.41799005 0.79100498
[66,] 0.17899374 0.35798748 0.82100626
[67,] 0.17171868 0.34343736 0.82828132
[68,] 0.14454691 0.28909382 0.85545309
[69,] 0.19023824 0.38047648 0.80976176
[70,] 0.16896266 0.33792532 0.83103734
[71,] 0.14168264 0.28336527 0.85831736
[72,] 0.23411956 0.46823911 0.76588044
[73,] 0.21612108 0.43224217 0.78387892
[74,] 0.19308682 0.38617363 0.80691318
[75,] 0.17298694 0.34597388 0.82701306
[76,] 0.14507916 0.29015831 0.85492084
[77,] 0.12925996 0.25851992 0.87074004
[78,] 0.12115388 0.24230776 0.87884612
[79,] 0.10400793 0.20801586 0.89599207
[80,] 0.10487660 0.20975321 0.89512340
[81,] 0.08983719 0.17967439 0.91016281
[82,] 0.12161262 0.24322525 0.87838738
[83,] 0.10071719 0.20143437 0.89928281
[84,] 0.11427752 0.22855503 0.88572248
[85,] 0.09719119 0.19438238 0.90280881
[86,] 0.07967334 0.15934669 0.92032666
[87,] 0.07492993 0.14985986 0.92507007
[88,] 0.11224764 0.22449527 0.88775236
[89,] 0.12012046 0.24024092 0.87987954
[90,] 0.11117457 0.22234914 0.88882543
[91,] 0.09262001 0.18524003 0.90737999
[92,] 0.07883297 0.15766594 0.92116703
[93,] 0.07933396 0.15866793 0.92066604
[94,] 0.07140963 0.14281927 0.92859037
[95,] 0.06499628 0.12999256 0.93500372
[96,] 0.05203554 0.10407108 0.94796446
[97,] 0.04763763 0.09527526 0.95236237
[98,] 0.04100461 0.08200922 0.95899539
[99,] 0.07051307 0.14102615 0.92948693
[100,] 0.06466871 0.12933742 0.93533129
[101,] 0.10957244 0.21914487 0.89042756
[102,] 0.09598802 0.19197604 0.90401198
[103,] 0.40282986 0.80565972 0.59717014
[104,] 0.42304631 0.84609261 0.57695369
[105,] 0.39843469 0.79686938 0.60156531
[106,] 0.37225142 0.74450285 0.62774858
[107,] 0.33916823 0.67833646 0.66083177
[108,] 0.30966402 0.61932804 0.69033598
[109,] 0.28182558 0.56365115 0.71817442
[110,] 0.24372296 0.48744592 0.75627704
[111,] 0.20494814 0.40989628 0.79505186
[112,] 0.18130010 0.36260019 0.81869990
[113,] 0.20982649 0.41965298 0.79017351
[114,] 0.17556802 0.35113605 0.82443198
[115,] 0.16132891 0.32265783 0.83867109
[116,] 0.16407927 0.32815854 0.83592073
[117,] 0.14379154 0.28758308 0.85620846
[118,] 0.11808100 0.23616200 0.88191900
[119,] 0.11182672 0.22365344 0.88817328
[120,] 0.11462111 0.22924222 0.88537889
[121,] 0.43314884 0.86629768 0.56685116
[122,] 0.38314610 0.76629219 0.61685390
[123,] 0.35969943 0.71939886 0.64030057
[124,] 0.31330631 0.62661263 0.68669369
[125,] 0.31883706 0.63767412 0.68116294
[126,] 0.50236367 0.99527266 0.49763633
[127,] 0.59771340 0.80457320 0.40228660
[128,] 0.64220538 0.71558925 0.35779462
[129,] 0.58384400 0.83231199 0.41615600
[130,] 0.61701911 0.76596177 0.38298089
[131,] 0.55609277 0.88781446 0.44390723
[132,] 0.55106450 0.89787099 0.44893550
[133,] 0.50297645 0.99404711 0.49702355
[134,] 0.46207210 0.92414421 0.53792790
[135,] 0.40104292 0.80208584 0.59895708
[136,] 0.45638810 0.91277619 0.54361190
[137,] 0.55495608 0.89008784 0.44504392
[138,] 0.68243024 0.63513951 0.31756976
[139,] 0.74921487 0.50157026 0.25078513
[140,] 0.86025614 0.27948771 0.13974386
[141,] 0.79674447 0.40651106 0.20325553
[142,] 0.92745221 0.14509559 0.07254779
[143,] 0.93769709 0.12460583 0.06230291
[144,] 0.91839495 0.16321011 0.08160505
[145,] 0.99409116 0.01181768 0.00590884
[146,] 0.98149741 0.03700519 0.01850259
[147,] 0.95681886 0.08636228 0.04318114
> postscript(file="/var/www/html/rcomp/tmp/10oto1290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/20oto1290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3bxs91290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4bxs91290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5bxs91290549883.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.725808645 3.128209694 -4.866816762 -3.626155402 -1.166373070 -0.741480103
7 8 9 10 11 12
4.254789780 -1.381591250 0.531714126 2.007184141 2.348311192 -0.154394028
13 14 15 16 17 18
3.565137310 3.662752047 -3.044838915 -3.072252831 1.042163716 2.338347325
19 20 21 22 23 24
3.807500471 -3.397889825 -3.934292530 -3.573272362 3.825354118 2.341993005
25 26 27 28 29 30
3.548289727 6.462066359 0.660891694 -2.047382532 -2.134077156 -0.458805996
31 32 33 34 35 36
-4.516126715 -7.544772902 1.501581522 -1.245397031 -0.988601014 -3.261386279
37 38 39 40 41 42
-4.549326328 0.831188315 -6.456617479 0.159921981 1.813384487 -1.195901481
43 44 45 46 47 48
2.357582700 0.535054525 3.395867317 2.545213621 2.694010916 -2.094136510
49 50 51 52 53 54
0.802916065 3.170858613 -3.435521751 -2.713997123 -2.162428479 -0.556451713
55 56 57 58 59 60
-2.265840067 2.278940453 3.859883003 -6.175629062 2.390960111 0.695241870
61 62 63 64 65 66
-3.283454032 3.303178625 -0.492517942 -3.684119982 -0.931989175 0.685782557
67 68 69 70 71 72
1.778939459 -4.448902363 4.095878157 0.151563004 3.477104407 -3.884453616
73 74 75 76 77 78
-0.983704224 2.877108569 -0.654970558 5.055308112 1.793101653 -0.288037119
79 80 81 82 83 84
-6.834453511 2.282427581 -1.917955872 1.887899791 -0.001458233 1.999269485
85 86 87 88 89 90
-2.787645669 -1.525842809 3.382455725 -1.668076869 -5.362562839 -0.100210970
91 92 93 94 95 96
-3.894463256 1.497163091 0.263082153 -2.480121829 -5.564351908 4.141603182
97 98 99 100 101 102
2.840558140 0.514048019 1.902660812 -2.726854342 2.760426751 2.982842020
103 104 105 106 107 108
0.970464745 -2.094421226 -1.453436951 6.560318007 3.110788634 6.513738692
109 110 111 112 113 114
2.287678152 9.948006535 -4.562796836 -3.004989076 -2.336506040 -2.287060309
115 116 117 118 119 120
2.017904713 2.071047262 -1.422327537 -0.195454434 -1.544534225 3.701015833
121 122 123 124 125 126
-0.933506164 -3.387493371 3.374651121 2.128014200 -1.665140069 -3.460836636
127 128 129 130 131 132
4.059027813 9.109705817 -2.031945936 0.574579838 -2.157378186 -5.156101461
133 134 135 136 137 138
5.610500866 -7.300116802 2.506971133 -2.541019163 -5.172449854 -0.168574327
139 140 141 142 143 144
-3.553267139 0.707986712 -2.985266984 -2.326797635 -4.331076761 -4.439108782
145 146 147 148 149 150
-3.369635678 5.597394555 -2.615544882 2.255830605 -1.987031746 2.028033236
151 152 153 154 155 156
3.734671591 8.120058822 -0.504998497 1.418869574 2.116592259 -0.534731548
157 158 159 160 161 162
1.950007247 -1.760613379 -1.822940941 -0.106500909 -1.347504226 0.409633424
> postscript(file="/var/www/html/rcomp/tmp/63orc1290549883.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.725808645 NA
1 3.128209694 5.725808645
2 -4.866816762 3.128209694
3 -3.626155402 -4.866816762
4 -1.166373070 -3.626155402
5 -0.741480103 -1.166373070
6 4.254789780 -0.741480103
7 -1.381591250 4.254789780
8 0.531714126 -1.381591250
9 2.007184141 0.531714126
10 2.348311192 2.007184141
11 -0.154394028 2.348311192
12 3.565137310 -0.154394028
13 3.662752047 3.565137310
14 -3.044838915 3.662752047
15 -3.072252831 -3.044838915
16 1.042163716 -3.072252831
17 2.338347325 1.042163716
18 3.807500471 2.338347325
19 -3.397889825 3.807500471
20 -3.934292530 -3.397889825
21 -3.573272362 -3.934292530
22 3.825354118 -3.573272362
23 2.341993005 3.825354118
24 3.548289727 2.341993005
25 6.462066359 3.548289727
26 0.660891694 6.462066359
27 -2.047382532 0.660891694
28 -2.134077156 -2.047382532
29 -0.458805996 -2.134077156
30 -4.516126715 -0.458805996
31 -7.544772902 -4.516126715
32 1.501581522 -7.544772902
33 -1.245397031 1.501581522
34 -0.988601014 -1.245397031
35 -3.261386279 -0.988601014
36 -4.549326328 -3.261386279
37 0.831188315 -4.549326328
38 -6.456617479 0.831188315
39 0.159921981 -6.456617479
40 1.813384487 0.159921981
41 -1.195901481 1.813384487
42 2.357582700 -1.195901481
43 0.535054525 2.357582700
44 3.395867317 0.535054525
45 2.545213621 3.395867317
46 2.694010916 2.545213621
47 -2.094136510 2.694010916
48 0.802916065 -2.094136510
49 3.170858613 0.802916065
50 -3.435521751 3.170858613
51 -2.713997123 -3.435521751
52 -2.162428479 -2.713997123
53 -0.556451713 -2.162428479
54 -2.265840067 -0.556451713
55 2.278940453 -2.265840067
56 3.859883003 2.278940453
57 -6.175629062 3.859883003
58 2.390960111 -6.175629062
59 0.695241870 2.390960111
60 -3.283454032 0.695241870
61 3.303178625 -3.283454032
62 -0.492517942 3.303178625
63 -3.684119982 -0.492517942
64 -0.931989175 -3.684119982
65 0.685782557 -0.931989175
66 1.778939459 0.685782557
67 -4.448902363 1.778939459
68 4.095878157 -4.448902363
69 0.151563004 4.095878157
70 3.477104407 0.151563004
71 -3.884453616 3.477104407
72 -0.983704224 -3.884453616
73 2.877108569 -0.983704224
74 -0.654970558 2.877108569
75 5.055308112 -0.654970558
76 1.793101653 5.055308112
77 -0.288037119 1.793101653
78 -6.834453511 -0.288037119
79 2.282427581 -6.834453511
80 -1.917955872 2.282427581
81 1.887899791 -1.917955872
82 -0.001458233 1.887899791
83 1.999269485 -0.001458233
84 -2.787645669 1.999269485
85 -1.525842809 -2.787645669
86 3.382455725 -1.525842809
87 -1.668076869 3.382455725
88 -5.362562839 -1.668076869
89 -0.100210970 -5.362562839
90 -3.894463256 -0.100210970
91 1.497163091 -3.894463256
92 0.263082153 1.497163091
93 -2.480121829 0.263082153
94 -5.564351908 -2.480121829
95 4.141603182 -5.564351908
96 2.840558140 4.141603182
97 0.514048019 2.840558140
98 1.902660812 0.514048019
99 -2.726854342 1.902660812
100 2.760426751 -2.726854342
101 2.982842020 2.760426751
102 0.970464745 2.982842020
103 -2.094421226 0.970464745
104 -1.453436951 -2.094421226
105 6.560318007 -1.453436951
106 3.110788634 6.560318007
107 6.513738692 3.110788634
108 2.287678152 6.513738692
109 9.948006535 2.287678152
110 -4.562796836 9.948006535
111 -3.004989076 -4.562796836
112 -2.336506040 -3.004989076
113 -2.287060309 -2.336506040
114 2.017904713 -2.287060309
115 2.071047262 2.017904713
116 -1.422327537 2.071047262
117 -0.195454434 -1.422327537
118 -1.544534225 -0.195454434
119 3.701015833 -1.544534225
120 -0.933506164 3.701015833
121 -3.387493371 -0.933506164
122 3.374651121 -3.387493371
123 2.128014200 3.374651121
124 -1.665140069 2.128014200
125 -3.460836636 -1.665140069
126 4.059027813 -3.460836636
127 9.109705817 4.059027813
128 -2.031945936 9.109705817
129 0.574579838 -2.031945936
130 -2.157378186 0.574579838
131 -5.156101461 -2.157378186
132 5.610500866 -5.156101461
133 -7.300116802 5.610500866
134 2.506971133 -7.300116802
135 -2.541019163 2.506971133
136 -5.172449854 -2.541019163
137 -0.168574327 -5.172449854
138 -3.553267139 -0.168574327
139 0.707986712 -3.553267139
140 -2.985266984 0.707986712
141 -2.326797635 -2.985266984
142 -4.331076761 -2.326797635
143 -4.439108782 -4.331076761
144 -3.369635678 -4.439108782
145 5.597394555 -3.369635678
146 -2.615544882 5.597394555
147 2.255830605 -2.615544882
148 -1.987031746 2.255830605
149 2.028033236 -1.987031746
150 3.734671591 2.028033236
151 8.120058822 3.734671591
152 -0.504998497 8.120058822
153 1.418869574 -0.504998497
154 2.116592259 1.418869574
155 -0.534731548 2.116592259
156 1.950007247 -0.534731548
157 -1.760613379 1.950007247
158 -1.822940941 -1.760613379
159 -0.106500909 -1.822940941
160 -1.347504226 -0.106500909
161 0.409633424 -1.347504226
162 NA 0.409633424
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.128209694 5.725808645
[2,] -4.866816762 3.128209694
[3,] -3.626155402 -4.866816762
[4,] -1.166373070 -3.626155402
[5,] -0.741480103 -1.166373070
[6,] 4.254789780 -0.741480103
[7,] -1.381591250 4.254789780
[8,] 0.531714126 -1.381591250
[9,] 2.007184141 0.531714126
[10,] 2.348311192 2.007184141
[11,] -0.154394028 2.348311192
[12,] 3.565137310 -0.154394028
[13,] 3.662752047 3.565137310
[14,] -3.044838915 3.662752047
[15,] -3.072252831 -3.044838915
[16,] 1.042163716 -3.072252831
[17,] 2.338347325 1.042163716
[18,] 3.807500471 2.338347325
[19,] -3.397889825 3.807500471
[20,] -3.934292530 -3.397889825
[21,] -3.573272362 -3.934292530
[22,] 3.825354118 -3.573272362
[23,] 2.341993005 3.825354118
[24,] 3.548289727 2.341993005
[25,] 6.462066359 3.548289727
[26,] 0.660891694 6.462066359
[27,] -2.047382532 0.660891694
[28,] -2.134077156 -2.047382532
[29,] -0.458805996 -2.134077156
[30,] -4.516126715 -0.458805996
[31,] -7.544772902 -4.516126715
[32,] 1.501581522 -7.544772902
[33,] -1.245397031 1.501581522
[34,] -0.988601014 -1.245397031
[35,] -3.261386279 -0.988601014
[36,] -4.549326328 -3.261386279
[37,] 0.831188315 -4.549326328
[38,] -6.456617479 0.831188315
[39,] 0.159921981 -6.456617479
[40,] 1.813384487 0.159921981
[41,] -1.195901481 1.813384487
[42,] 2.357582700 -1.195901481
[43,] 0.535054525 2.357582700
[44,] 3.395867317 0.535054525
[45,] 2.545213621 3.395867317
[46,] 2.694010916 2.545213621
[47,] -2.094136510 2.694010916
[48,] 0.802916065 -2.094136510
[49,] 3.170858613 0.802916065
[50,] -3.435521751 3.170858613
[51,] -2.713997123 -3.435521751
[52,] -2.162428479 -2.713997123
[53,] -0.556451713 -2.162428479
[54,] -2.265840067 -0.556451713
[55,] 2.278940453 -2.265840067
[56,] 3.859883003 2.278940453
[57,] -6.175629062 3.859883003
[58,] 2.390960111 -6.175629062
[59,] 0.695241870 2.390960111
[60,] -3.283454032 0.695241870
[61,] 3.303178625 -3.283454032
[62,] -0.492517942 3.303178625
[63,] -3.684119982 -0.492517942
[64,] -0.931989175 -3.684119982
[65,] 0.685782557 -0.931989175
[66,] 1.778939459 0.685782557
[67,] -4.448902363 1.778939459
[68,] 4.095878157 -4.448902363
[69,] 0.151563004 4.095878157
[70,] 3.477104407 0.151563004
[71,] -3.884453616 3.477104407
[72,] -0.983704224 -3.884453616
[73,] 2.877108569 -0.983704224
[74,] -0.654970558 2.877108569
[75,] 5.055308112 -0.654970558
[76,] 1.793101653 5.055308112
[77,] -0.288037119 1.793101653
[78,] -6.834453511 -0.288037119
[79,] 2.282427581 -6.834453511
[80,] -1.917955872 2.282427581
[81,] 1.887899791 -1.917955872
[82,] -0.001458233 1.887899791
[83,] 1.999269485 -0.001458233
[84,] -2.787645669 1.999269485
[85,] -1.525842809 -2.787645669
[86,] 3.382455725 -1.525842809
[87,] -1.668076869 3.382455725
[88,] -5.362562839 -1.668076869
[89,] -0.100210970 -5.362562839
[90,] -3.894463256 -0.100210970
[91,] 1.497163091 -3.894463256
[92,] 0.263082153 1.497163091
[93,] -2.480121829 0.263082153
[94,] -5.564351908 -2.480121829
[95,] 4.141603182 -5.564351908
[96,] 2.840558140 4.141603182
[97,] 0.514048019 2.840558140
[98,] 1.902660812 0.514048019
[99,] -2.726854342 1.902660812
[100,] 2.760426751 -2.726854342
[101,] 2.982842020 2.760426751
[102,] 0.970464745 2.982842020
[103,] -2.094421226 0.970464745
[104,] -1.453436951 -2.094421226
[105,] 6.560318007 -1.453436951
[106,] 3.110788634 6.560318007
[107,] 6.513738692 3.110788634
[108,] 2.287678152 6.513738692
[109,] 9.948006535 2.287678152
[110,] -4.562796836 9.948006535
[111,] -3.004989076 -4.562796836
[112,] -2.336506040 -3.004989076
[113,] -2.287060309 -2.336506040
[114,] 2.017904713 -2.287060309
[115,] 2.071047262 2.017904713
[116,] -1.422327537 2.071047262
[117,] -0.195454434 -1.422327537
[118,] -1.544534225 -0.195454434
[119,] 3.701015833 -1.544534225
[120,] -0.933506164 3.701015833
[121,] -3.387493371 -0.933506164
[122,] 3.374651121 -3.387493371
[123,] 2.128014200 3.374651121
[124,] -1.665140069 2.128014200
[125,] -3.460836636 -1.665140069
[126,] 4.059027813 -3.460836636
[127,] 9.109705817 4.059027813
[128,] -2.031945936 9.109705817
[129,] 0.574579838 -2.031945936
[130,] -2.157378186 0.574579838
[131,] -5.156101461 -2.157378186
[132,] 5.610500866 -5.156101461
[133,] -7.300116802 5.610500866
[134,] 2.506971133 -7.300116802
[135,] -2.541019163 2.506971133
[136,] -5.172449854 -2.541019163
[137,] -0.168574327 -5.172449854
[138,] -3.553267139 -0.168574327
[139,] 0.707986712 -3.553267139
[140,] -2.985266984 0.707986712
[141,] -2.326797635 -2.985266984
[142,] -4.331076761 -2.326797635
[143,] -4.439108782 -4.331076761
[144,] -3.369635678 -4.439108782
[145,] 5.597394555 -3.369635678
[146,] -2.615544882 5.597394555
[147,] 2.255830605 -2.615544882
[148,] -1.987031746 2.255830605
[149,] 2.028033236 -1.987031746
[150,] 3.734671591 2.028033236
[151,] 8.120058822 3.734671591
[152,] -0.504998497 8.120058822
[153,] 1.418869574 -0.504998497
[154,] 2.116592259 1.418869574
[155,] -0.534731548 2.116592259
[156,] 1.950007247 -0.534731548
[157,] -1.760613379 1.950007247
[158,] -1.822940941 -1.760613379
[159,] -0.106500909 -1.822940941
[160,] -1.347504226 -0.106500909
[161,] 0.409633424 -1.347504226
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.128209694 5.725808645
2 -4.866816762 3.128209694
3 -3.626155402 -4.866816762
4 -1.166373070 -3.626155402
5 -0.741480103 -1.166373070
6 4.254789780 -0.741480103
7 -1.381591250 4.254789780
8 0.531714126 -1.381591250
9 2.007184141 0.531714126
10 2.348311192 2.007184141
11 -0.154394028 2.348311192
12 3.565137310 -0.154394028
13 3.662752047 3.565137310
14 -3.044838915 3.662752047
15 -3.072252831 -3.044838915
16 1.042163716 -3.072252831
17 2.338347325 1.042163716
18 3.807500471 2.338347325
19 -3.397889825 3.807500471
20 -3.934292530 -3.397889825
21 -3.573272362 -3.934292530
22 3.825354118 -3.573272362
23 2.341993005 3.825354118
24 3.548289727 2.341993005
25 6.462066359 3.548289727
26 0.660891694 6.462066359
27 -2.047382532 0.660891694
28 -2.134077156 -2.047382532
29 -0.458805996 -2.134077156
30 -4.516126715 -0.458805996
31 -7.544772902 -4.516126715
32 1.501581522 -7.544772902
33 -1.245397031 1.501581522
34 -0.988601014 -1.245397031
35 -3.261386279 -0.988601014
36 -4.549326328 -3.261386279
37 0.831188315 -4.549326328
38 -6.456617479 0.831188315
39 0.159921981 -6.456617479
40 1.813384487 0.159921981
41 -1.195901481 1.813384487
42 2.357582700 -1.195901481
43 0.535054525 2.357582700
44 3.395867317 0.535054525
45 2.545213621 3.395867317
46 2.694010916 2.545213621
47 -2.094136510 2.694010916
48 0.802916065 -2.094136510
49 3.170858613 0.802916065
50 -3.435521751 3.170858613
51 -2.713997123 -3.435521751
52 -2.162428479 -2.713997123
53 -0.556451713 -2.162428479
54 -2.265840067 -0.556451713
55 2.278940453 -2.265840067
56 3.859883003 2.278940453
57 -6.175629062 3.859883003
58 2.390960111 -6.175629062
59 0.695241870 2.390960111
60 -3.283454032 0.695241870
61 3.303178625 -3.283454032
62 -0.492517942 3.303178625
63 -3.684119982 -0.492517942
64 -0.931989175 -3.684119982
65 0.685782557 -0.931989175
66 1.778939459 0.685782557
67 -4.448902363 1.778939459
68 4.095878157 -4.448902363
69 0.151563004 4.095878157
70 3.477104407 0.151563004
71 -3.884453616 3.477104407
72 -0.983704224 -3.884453616
73 2.877108569 -0.983704224
74 -0.654970558 2.877108569
75 5.055308112 -0.654970558
76 1.793101653 5.055308112
77 -0.288037119 1.793101653
78 -6.834453511 -0.288037119
79 2.282427581 -6.834453511
80 -1.917955872 2.282427581
81 1.887899791 -1.917955872
82 -0.001458233 1.887899791
83 1.999269485 -0.001458233
84 -2.787645669 1.999269485
85 -1.525842809 -2.787645669
86 3.382455725 -1.525842809
87 -1.668076869 3.382455725
88 -5.362562839 -1.668076869
89 -0.100210970 -5.362562839
90 -3.894463256 -0.100210970
91 1.497163091 -3.894463256
92 0.263082153 1.497163091
93 -2.480121829 0.263082153
94 -5.564351908 -2.480121829
95 4.141603182 -5.564351908
96 2.840558140 4.141603182
97 0.514048019 2.840558140
98 1.902660812 0.514048019
99 -2.726854342 1.902660812
100 2.760426751 -2.726854342
101 2.982842020 2.760426751
102 0.970464745 2.982842020
103 -2.094421226 0.970464745
104 -1.453436951 -2.094421226
105 6.560318007 -1.453436951
106 3.110788634 6.560318007
107 6.513738692 3.110788634
108 2.287678152 6.513738692
109 9.948006535 2.287678152
110 -4.562796836 9.948006535
111 -3.004989076 -4.562796836
112 -2.336506040 -3.004989076
113 -2.287060309 -2.336506040
114 2.017904713 -2.287060309
115 2.071047262 2.017904713
116 -1.422327537 2.071047262
117 -0.195454434 -1.422327537
118 -1.544534225 -0.195454434
119 3.701015833 -1.544534225
120 -0.933506164 3.701015833
121 -3.387493371 -0.933506164
122 3.374651121 -3.387493371
123 2.128014200 3.374651121
124 -1.665140069 2.128014200
125 -3.460836636 -1.665140069
126 4.059027813 -3.460836636
127 9.109705817 4.059027813
128 -2.031945936 9.109705817
129 0.574579838 -2.031945936
130 -2.157378186 0.574579838
131 -5.156101461 -2.157378186
132 5.610500866 -5.156101461
133 -7.300116802 5.610500866
134 2.506971133 -7.300116802
135 -2.541019163 2.506971133
136 -5.172449854 -2.541019163
137 -0.168574327 -5.172449854
138 -3.553267139 -0.168574327
139 0.707986712 -3.553267139
140 -2.985266984 0.707986712
141 -2.326797635 -2.985266984
142 -4.331076761 -2.326797635
143 -4.439108782 -4.331076761
144 -3.369635678 -4.439108782
145 5.597394555 -3.369635678
146 -2.615544882 5.597394555
147 2.255830605 -2.615544882
148 -1.987031746 2.255830605
149 2.028033236 -1.987031746
150 3.734671591 2.028033236
151 8.120058822 3.734671591
152 -0.504998497 8.120058822
153 1.418869574 -0.504998497
154 2.116592259 1.418869574
155 -0.534731548 2.116592259
156 1.950007247 -0.534731548
157 -1.760613379 1.950007247
158 -1.822940941 -1.760613379
159 -0.106500909 -1.822940941
160 -1.347504226 -0.106500909
161 0.409633424 -1.347504226
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7ex8f1290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8ex8f1290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9ex8f1290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/1077qi1290549883.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11lz9j1290549884.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/126hpp1290549884.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/1329ng1290549884.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/145al31290549884.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/159a2r1290549884.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16sn7p1290549884.tab")
+ }
>
> try(system("convert tmp/10oto1290549883.ps tmp/10oto1290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/20oto1290549883.ps tmp/20oto1290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bxs91290549883.ps tmp/3bxs91290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/4bxs91290549883.ps tmp/4bxs91290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/5bxs91290549883.ps tmp/5bxs91290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/63orc1290549883.ps tmp/63orc1290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ex8f1290549883.ps tmp/7ex8f1290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ex8f1290549883.ps tmp/8ex8f1290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ex8f1290549883.ps tmp/9ex8f1290549883.png",intern=TRUE))
character(0)
> try(system("convert tmp/1077qi1290549883.ps tmp/1077qi1290549883.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.036 1.728 9.329