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(0
+ ,255202
+ ,64
+ ,92
+ ,34
+ ,0
+ ,135248
+ ,59
+ ,58
+ ,30
+ ,0
+ ,207223
+ ,64
+ ,62
+ ,42
+ ,1
+ ,189326
+ ,95
+ ,108
+ ,34
+ ,1
+ ,141365
+ ,46
+ ,55
+ ,25
+ ,0
+ ,65295
+ ,27
+ ,8
+ ,31
+ ,0
+ ,439387
+ ,103
+ ,134
+ ,29
+ ,0
+ ,33186
+ ,19
+ ,1
+ ,18
+ ,0
+ ,183696
+ ,51
+ ,64
+ ,30
+ ,0
+ ,186657
+ ,38
+ ,77
+ ,29
+ ,1
+ ,276696
+ ,99
+ ,86
+ ,42
+ ,1
+ ,194414
+ ,98
+ ,96
+ ,50
+ ,0
+ ,141409
+ ,59
+ ,44
+ ,33
+ ,1
+ ,306730
+ ,68
+ ,108
+ ,46
+ ,1
+ ,192691
+ ,74
+ ,63
+ ,38
+ ,1
+ ,333497
+ ,164
+ ,160
+ ,52
+ ,0
+ ,261835
+ ,59
+ ,109
+ ,32
+ ,1
+ ,263451
+ ,130
+ ,86
+ ,35
+ ,1
+ ,157448
+ ,49
+ ,93
+ ,25
+ ,1
+ ,232190
+ ,73
+ ,126
+ ,42
+ ,0
+ ,245725
+ ,64
+ ,110
+ ,40
+ ,0
+ ,388603
+ ,92
+ ,86
+ ,35
+ ,0
+ ,156540
+ ,34
+ ,50
+ ,25
+ ,0
+ ,156189
+ ,47
+ ,92
+ ,46
+ ,0
+ ,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 ,0
+ ,0
+ ,0
+ ,203
+ ,4
+ ,0
+ ,0
+ ,0
+ ,7199
+ ,5
+ ,7
+ ,0
+ ,1
+ ,46660
+ ,20
+ ,12
+ ,5
+ ,1
+ ,17547
+ ,5
+ ,0
+ ,1
+ ,0
+ ,107465
+ ,38
+ ,37
+ ,38
+ ,1
+ ,969
+ ,2
+ ,0
+ ,0
+ ,1
+ ,179994
+ ,58
+ ,47
+ ,28)
+ ,dim=c(5
+ ,164)
+ ,dimnames=list(c('Geslacht'
+ ,'Time_in_RFC'
+ ,'Logins'
+ ,'Blogged_computations'
+ ,'Reviewed_compendiums')
+ ,1:164))
> y <- array(NA,dim=c(5,164),dimnames=list(c('Geslacht','Time_in_RFC','Logins','Blogged_computations','Reviewed_compendiums'),1:164))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- 'No 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, 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
Geslacht Time_in_RFC Logins Blogged_computations Reviewed_compendiums
1 0 255202 64 92 34
2 0 135248 59 58 30
3 0 207223 64 62 42
4 1 189326 95 108 34
5 1 141365 46 55 25
6 0 65295 27 8 31
7 0 439387 103 134 29
8 0 33186 19 1 18
9 0 183696 51 64 30
10 0 186657 38 77 29
11 1 276696 99 86 42
12 1 194414 98 96 50
13 0 141409 59 44 33
14 1 306730 68 108 46
15 1 192691 74 63 38
16 1 333497 164 160 52
17 0 261835 59 109 32
18 1 263451 130 86 35
19 1 157448 49 93 25
20 1 232190 73 126 42
21 0 245725 64 110 40
22 0 388603 92 86 35
23 0 156540 34 50 25
24 0 156189 47 92 46
25 0 189726 106 123 39
26 0 192167 106 81 35
27 1 249893 122 93 38
28 1 236812 76 113 35
29 1 143160 47 52 28
30 0 259667 54 113 37
31 0 243020 68 113 40
32 0 176062 67 44 42
33 0 286683 79 123 44
34 1 87485 33 38 33
35 0 329737 88 111 38
36 1 247082 51 77 37
37 0 378463 108 102 41
38 1 191653 75 74 32
39 0 114673 31 33 17
40 0 301596 167 107 39
41 0 284195 73 108 33
42 1 155568 60 66 35
43 1 177306 67 69 32
44 1 144595 51 62 35
45 0 140319 73 50 45
46 1 405267 135 91 38
47 1 78800 42 20 26
48 1 201970 69 101 45
49 1 302705 101 129 44
50 1 164733 50 93 40
51 1 194221 68 89 33
52 0 24188 24 8 4
53 0 346142 288 80 41
54 0 65029 17 21 18
55 0 101097 64 30 14
56 1 253745 51 86 36
57 0 273513 77 116 49
58 1 282220 160 106 32
59 1 280928 120 132 37
60 1 214872 74 75 32
61 0 342048 127 139 43
62 0 273924 108 121 25
63 1 195726 92 57 42
64 1 231162 80 67 37
65 0 209798 61 45 33
66 1 201345 60 88 28
67 0 180231 118 79 31
68 1 204441 129 75 40
69 0 197813 67 114 32
70 1 136421 60 127 25
71 1 216092 59 86 42
72 1 73566 32 22 23
73 0 213998 70 67 42
74 1 181728 50 77 38
75 0 148758 51 105 34
76 0 308343 71 121 39
77 1 251437 78 88 32
78 0 202388 102 78 37
79 0 173286 56 122 34
80 0 155529 58 66 33
81 0 132672 41 58 25
82 1 390163 102 134 45
83 0 145905 66 30 26
84 0 228012 88 103 40
85 1 80953 25 49 8
86 0 130805 47 26 27
87 1 135163 49 67 32
88 1 333790 168 59 37
89 1 271806 95 95 50
90 1 164235 99 156 41
91 1 234092 80 74 37
92 0 207158 69 137 38
93 0 156583 57 37 28
94 0 242395 68 111 36
95 1 261601 70 58 32
96 1 178489 35 78 32
97 0 204221 44 88 33
98 1 268066 69 152 35
99 1 327622 133 130 58
100 1 361799 101 145 27
101 0 247131 107 108 45
102 1 265849 58 138 37
103 0 162336 162 62 32
104 1 43287 14 13 19
105 0 172244 68 89 22
106 0 189021 121 86 35
107 0 227681 43 116 36
108 0 269329 81 157 36
109 0 106503 56 28 23
110 1 117891 77 83 40
111 1 287201 59 72 40
112 0 266805 78 134 42
113 0 23623 11 12 1
114 1 174954 69 120 36
115 0 61857 25 23 11
116 1 144889 43 83 40
117 1 347988 103 126 34
118 0 21054 16 4 0
119 1 224051 46 71 27
120 1 31414 19 18 8
121 1 278660 107 98 35
122 0 209481 58 68 44
123 0 156870 75 44 40
124 1 112933 46 29 28
125 0 38214 34 16 8
126 0 166011 35 61 36
127 1 316044 73 117 47
128 1 181578 56 46 48
129 1 358903 72 129 45
130 1 275578 91 139 48
131 1 368796 106 136 49
132 1 172464 31 66 35
133 1 94381 35 42 32
134 1 250563 290 75 36
135 1 382499 154 97 42
136 1 118010 42 49 35
137 1 365575 122 127 42
138 1 147989 72 55 34
139 1 231681 46 101 41
140 0 193119 77 80 36
141 0 189020 108 29 32
142 0 341958 106 95 33
143 1 222060 79 120 35
144 0 173260 63 41 21
145 0 274787 91 128 42
146 1 130908 52 142 49
147 0 204009 75 88 33
148 0 262412 94 170 39
149 0 1 0 0 0
150 0 14688 10 4 0
151 0 98 1 0 0
152 0 455 2 0 0
153 1 0 0 0 0
154 0 0 0 0 0
155 1 195765 75 56 33
156 0 334258 129 121 47
157 0 0 0 0 0
158 0 203 4 0 0
159 0 7199 5 7 0
160 1 46660 20 12 5
161 1 17547 5 0 1
162 0 107465 38 37 38
163 1 969 2 0 0
164 1 179994 58 47 28
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Time_in_RFC Logins
2.515e-01 -1.760e-07 -1.899e-04
Blogged_computations Reviewed_compendiums
2.700e-04 8.641e-03
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.64349 -0.51140 0.02463 0.46718 0.74903
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.515e-01 1.040e-01 2.419 0.0167 *
Time_in_RFC -1.760e-07 8.058e-07 -0.218 0.8274
Logins -1.899e-04 1.267e-03 -0.150 0.8810
Blogged_computations 2.700e-04 1.631e-03 0.166 0.8688
Reviewed_compendiums 8.641e-03 4.890e-03 1.767 0.0791 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.497 on 159 degrees of freedom
Multiple R-squared: 0.0421, Adjusted R-squared: 0.018
F-statistic: 1.747 on 4 and 159 DF, p-value: 0.1423
> 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.5464957 0.9070087 0.4535043
[2,] 0.4168327 0.8336653 0.5831673
[3,] 0.3062774 0.6125548 0.6937226
[4,] 0.3767013 0.7534026 0.6232987
[5,] 0.2680332 0.5360663 0.7319668
[6,] 0.2411647 0.4823293 0.7588353
[7,] 0.3819712 0.7639423 0.6180288
[8,] 0.3968483 0.7936967 0.6031517
[9,] 0.3801995 0.7603990 0.6198005
[10,] 0.3330565 0.6661130 0.6669435
[11,] 0.2780567 0.5561134 0.7219433
[12,] 0.3340444 0.6680888 0.6659556
[13,] 0.2773613 0.5547226 0.7226387
[14,] 0.2971584 0.5943168 0.7028416
[15,] 0.2418876 0.4837751 0.7581124
[16,] 0.1932613 0.3865226 0.8067387
[17,] 0.2111471 0.4222941 0.7888529
[18,] 0.3831194 0.7662389 0.6168806
[19,] 0.4323001 0.8646001 0.5676999
[20,] 0.3984158 0.7968316 0.6015842
[21,] 0.4078618 0.8157236 0.5921382
[22,] 0.4771746 0.9543491 0.5228254
[23,] 0.4485756 0.8971512 0.5514244
[24,] 0.4379691 0.8759383 0.5620309
[25,] 0.4196648 0.8393296 0.5803352
[26,] 0.4097691 0.8195383 0.5902309
[27,] 0.4669991 0.9339982 0.5330009
[28,] 0.4433740 0.8867480 0.5566260
[29,] 0.5257825 0.9484350 0.4742175
[30,] 0.5094211 0.9811577 0.4905789
[31,] 0.5144784 0.9710433 0.4855216
[32,] 0.4799782 0.9599563 0.5200218
[33,] 0.5425815 0.9148369 0.4574185
[34,] 0.5223086 0.9553828 0.4776914
[35,] 0.5292575 0.9414850 0.4707425
[36,] 0.5406891 0.9186218 0.4593109
[37,] 0.5432662 0.9134677 0.4567338
[38,] 0.5637363 0.8725273 0.4362637
[39,] 0.5965463 0.8069074 0.4034537
[40,] 0.6053809 0.7892382 0.3946191
[41,] 0.5962949 0.8074102 0.4037051
[42,] 0.5857653 0.8284693 0.4142347
[43,] 0.5766236 0.8467527 0.4233764
[44,] 0.5727157 0.8545687 0.4272843
[45,] 0.5421110 0.9157779 0.4578890
[46,] 0.5656465 0.8687070 0.4343535
[47,] 0.5403947 0.9192106 0.4596053
[48,] 0.5081295 0.9837411 0.4918705
[49,] 0.5144811 0.9710378 0.4855189
[50,] 0.5491685 0.9016629 0.4508315
[51,] 0.5524585 0.8950830 0.4475415
[52,] 0.5369866 0.9260268 0.4630134
[53,] 0.5439556 0.9120888 0.4560444
[54,] 0.5640735 0.8718530 0.4359265
[55,] 0.5564865 0.8870269 0.4435135
[56,] 0.5473385 0.9053229 0.4526615
[57,] 0.5480104 0.9039792 0.4519896
[58,] 0.5410506 0.9178988 0.4589494
[59,] 0.5479645 0.9040710 0.4520355
[60,] 0.5486354 0.9027292 0.4513646
[61,] 0.5371640 0.9256721 0.4628360
[62,] 0.5425938 0.9148124 0.4574062
[63,] 0.5435583 0.9128834 0.4564417
[64,] 0.5288421 0.9423158 0.4711579
[65,] 0.5450624 0.9098752 0.4549376
[66,] 0.5591483 0.8817035 0.4408517
[67,] 0.5487441 0.9025118 0.4512559
[68,] 0.5623658 0.8752683 0.4376342
[69,] 0.5743646 0.8512708 0.4256354
[70,] 0.5777066 0.8445868 0.4222934
[71,] 0.5852986 0.8294028 0.4147014
[72,] 0.5942359 0.8115282 0.4057641
[73,] 0.5967970 0.8064060 0.4032030
[74,] 0.5880184 0.8239632 0.4119816
[75,] 0.5741915 0.8516171 0.4258085
[76,] 0.5644900 0.8710200 0.4355100
[77,] 0.5804548 0.8390903 0.4195452
[78,] 0.6216458 0.7567085 0.3783542
[79,] 0.6179497 0.7641005 0.3820503
[80,] 0.6145065 0.7709870 0.3854935
[81,] 0.6119987 0.7760026 0.3880013
[82,] 0.5879121 0.8241757 0.4120879
[83,] 0.5813757 0.8372486 0.4186243
[84,] 0.5717428 0.8565144 0.4282572
[85,] 0.5805096 0.8389808 0.4194904
[86,] 0.5795952 0.8408096 0.4204048
[87,] 0.5901826 0.8196348 0.4098174
[88,] 0.5857542 0.8284915 0.4142458
[89,] 0.5805996 0.8388007 0.4194004
[90,] 0.5893981 0.8212039 0.4106019
[91,] 0.5827283 0.8345434 0.4172717
[92,] 0.5492618 0.9014764 0.4507382
[93,] 0.5574375 0.8851250 0.4425625
[94,] 0.5815580 0.8368840 0.4184420
[95,] 0.5730627 0.8538746 0.4269373
[96,] 0.5703924 0.8592152 0.4296076
[97,] 0.5822872 0.8354256 0.4177128
[98,] 0.5665601 0.8668798 0.4334399
[99,] 0.5753873 0.8492253 0.4246127
[100,] 0.5866693 0.8266613 0.4133307
[101,] 0.6012239 0.7975521 0.3987761
[102,] 0.5951765 0.8096471 0.4048235
[103,] 0.5747804 0.8504392 0.4252196
[104,] 0.5542924 0.8914151 0.4457076
[105,] 0.5910987 0.8178025 0.4089013
[106,] 0.5571878 0.8856243 0.4428122
[107,] 0.5371157 0.9257686 0.4628843
[108,] 0.5139055 0.9721890 0.4860945
[109,] 0.4921576 0.9843152 0.5078424
[110,] 0.4760364 0.9520728 0.5239636
[111,] 0.4411594 0.8823188 0.5588406
[112,] 0.4392057 0.8784114 0.5607943
[113,] 0.4754895 0.9509790 0.5245105
[114,] 0.4627747 0.9255495 0.5372253
[115,] 0.5012310 0.9975380 0.4987690
[116,] 0.5502923 0.8994153 0.4497077
[117,] 0.5356781 0.9286437 0.4643219
[118,] 0.5064667 0.9870665 0.4935333
[119,] 0.5466422 0.9067156 0.4533578
[120,] 0.5106891 0.9786217 0.4893109
[121,] 0.4627661 0.9255321 0.5372339
[122,] 0.4405040 0.8810080 0.5594960
[123,] 0.4093377 0.8186754 0.5906623
[124,] 0.3912535 0.7825069 0.6087465
[125,] 0.3755350 0.7510699 0.6244650
[126,] 0.3538371 0.7076742 0.6461629
[127,] 0.3697899 0.7395798 0.6302101
[128,] 0.4309036 0.8618072 0.5690964
[129,] 0.3979989 0.7959979 0.6020011
[130,] 0.4544220 0.9088440 0.5455780
[131,] 0.4951715 0.9903430 0.5048285
[132,] 0.4441137 0.8882275 0.5558863
[133,] 0.4127185 0.8254369 0.5872815
[134,] 0.3554752 0.7109504 0.6445248
[135,] 0.3050648 0.6101295 0.6949352
[136,] 0.3524754 0.7049508 0.6475246
[137,] 0.3060441 0.6120882 0.6939559
[138,] 0.2869137 0.5738274 0.7130863
[139,] 0.5847735 0.8304529 0.4152265
[140,] 0.5374685 0.9250629 0.4625315
[141,] 0.7140733 0.5718534 0.2859267
[142,] 0.6583108 0.6833784 0.3416892
[143,] 0.6479510 0.7040979 0.3520490
[144,] 0.6024191 0.7951618 0.3975809
[145,] 0.5791090 0.8417821 0.4208910
[146,] 0.6909761 0.6180478 0.3090239
[147,] 0.6295064 0.7409872 0.3704936
[148,] 0.5148602 0.9702796 0.4851398
[149,] 0.3694248 0.7388497 0.6305752
> postscript(file="/var/fisher/rcomp/tmp/1bhgg1355065323.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/2f3wo1355065323.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/3tdsy1355065323.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/43alr1355065323.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/5rrgk1355065323.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 = 164
Frequency = 1
1 2 3 4 5 6 7
-0.5130816 -0.4914017 -0.5825564 0.4768902 0.5512218 -0.5049340 -0.4413876
8 9 10 11 12 13 14
-0.3978805 -0.4860130 -0.4828296 0.4298400 0.3433372 -0.5124607 0.3887346
15 16 17 18 19 20 21
0.4510794 0.3457921 -0.5001713 0.4938841 0.5443627 0.4062679 -0.5714566
22 23 24 25 26 27 28
-0.4913031 -0.4470361 -0.6374328 -0.5682059 -0.5218718 0.4621648 0.4716493
29 30 31 32 33 34 35
0.5266142 -0.5457883 -0.5719831 -0.5826118 -0.5994727 0.4747293 -0.5350980
36 37 38 39 40 41 42
0.4611466 -0.5462160 0.4999635 -0.3812564 -0.5326088 -0.5019477 0.4669994
43 44 45 46 47 48 49
0.4972687 0.4644385 -0.6153073 0.4925235 0.5402578 0.3810153 0.4059059
50 51 52 53 54 55 56
0.4162178 0.4863950 -0.2794287 -0.5117793 -0.3980551 -0.3506453 0.4685306
57 58 59 60 61 62 63
-0.6434865 0.5234091 0.4653591 0.5035907 -0.5762896 -0.4314891 0.4220877
64 65 66 67 68 69 70
0.4665520 -0.5003127 0.5296053 -0.4865892 0.4430712 -0.5112714 0.5335707
71 72 73 74 75 76 77
0.4115752 0.5628207 -0.5815743 0.4408116 -0.5377974 -0.5534337 0.5072768
78 79 80 81 82 83 84
-0.5373046 -0.5371202 -0.5161051 -0.4520680 0.4114995 -0.4460718 -0.5681264
85 86 87 88 89 90 91
0.6851188 -0.4598995 0.4869719 0.5034902 0.3566604 0.3997854 0.4651777
92 93 94 95 96 97 98
-0.5673034 -0.4650738 -0.5369885 0.5156465 0.4889694 -0.5161329 0.4652914
99 100 101 102 103 104 105
0.2951234 0.5588874 -0.6057082 0.4493097 -0.4854338 0.5910668 -0.4224209
106 107 108 109 110 111 112
-0.5209267 -0.5456766 -0.5421983 -0.4284434 0.4158003 0.4451544 -0.5888493
113 114 115 116 117 118 119
-0.2571537 0.4489001 -0.3371461 0.4140952 0.5014781 -0.2458552 0.5441743
120 121 122 123 124 125 126
0.6836291 0.4889531 -0.6022007 -0.5671884 0.5273135 -0.3117851 -0.5432016
127 128 129 130 131 132 133
0.3802526 0.3638831 0.4016492 0.3619671 0.3733935 0.4644657 0.4838842
134 135 136 137 138 139 140
0.5163320 0.4559397 0.4615596 0.4387832 0.4795555 0.4164415 -0.5355831
141 142 143 144 145 146 147
-0.4820826 -0.4820025 0.4677323 -0.4015907 -0.5833553 0.3196434 -0.5102826
148 149 150 151 152 153 154
-0.5703803 -0.2515198 -0.2481153 -0.2513128 -0.2510601 0.7484800 -0.2515200
155 156 157 158 159 160 161
0.4969061 -0.6069856 -0.2515200 -0.2507246 -0.2511932 0.7140461 0.7438772
162 163 164
-0.5637398 0.7490304 0.5365371
> postscript(file="/var/fisher/rcomp/tmp/6qo1y1355065323.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 = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.5130816 NA
1 -0.4914017 -0.5130816
2 -0.5825564 -0.4914017
3 0.4768902 -0.5825564
4 0.5512218 0.4768902
5 -0.5049340 0.5512218
6 -0.4413876 -0.5049340
7 -0.3978805 -0.4413876
8 -0.4860130 -0.3978805
9 -0.4828296 -0.4860130
10 0.4298400 -0.4828296
11 0.3433372 0.4298400
12 -0.5124607 0.3433372
13 0.3887346 -0.5124607
14 0.4510794 0.3887346
15 0.3457921 0.4510794
16 -0.5001713 0.3457921
17 0.4938841 -0.5001713
18 0.5443627 0.4938841
19 0.4062679 0.5443627
20 -0.5714566 0.4062679
21 -0.4913031 -0.5714566
22 -0.4470361 -0.4913031
23 -0.6374328 -0.4470361
24 -0.5682059 -0.6374328
25 -0.5218718 -0.5682059
26 0.4621648 -0.5218718
27 0.4716493 0.4621648
28 0.5266142 0.4716493
29 -0.5457883 0.5266142
30 -0.5719831 -0.5457883
31 -0.5826118 -0.5719831
32 -0.5994727 -0.5826118
33 0.4747293 -0.5994727
34 -0.5350980 0.4747293
35 0.4611466 -0.5350980
36 -0.5462160 0.4611466
37 0.4999635 -0.5462160
38 -0.3812564 0.4999635
39 -0.5326088 -0.3812564
40 -0.5019477 -0.5326088
41 0.4669994 -0.5019477
42 0.4972687 0.4669994
43 0.4644385 0.4972687
44 -0.6153073 0.4644385
45 0.4925235 -0.6153073
46 0.5402578 0.4925235
47 0.3810153 0.5402578
48 0.4059059 0.3810153
49 0.4162178 0.4059059
50 0.4863950 0.4162178
51 -0.2794287 0.4863950
52 -0.5117793 -0.2794287
53 -0.3980551 -0.5117793
54 -0.3506453 -0.3980551
55 0.4685306 -0.3506453
56 -0.6434865 0.4685306
57 0.5234091 -0.6434865
58 0.4653591 0.5234091
59 0.5035907 0.4653591
60 -0.5762896 0.5035907
61 -0.4314891 -0.5762896
62 0.4220877 -0.4314891
63 0.4665520 0.4220877
64 -0.5003127 0.4665520
65 0.5296053 -0.5003127
66 -0.4865892 0.5296053
67 0.4430712 -0.4865892
68 -0.5112714 0.4430712
69 0.5335707 -0.5112714
70 0.4115752 0.5335707
71 0.5628207 0.4115752
72 -0.5815743 0.5628207
73 0.4408116 -0.5815743
74 -0.5377974 0.4408116
75 -0.5534337 -0.5377974
76 0.5072768 -0.5534337
77 -0.5373046 0.5072768
78 -0.5371202 -0.5373046
79 -0.5161051 -0.5371202
80 -0.4520680 -0.5161051
81 0.4114995 -0.4520680
82 -0.4460718 0.4114995
83 -0.5681264 -0.4460718
84 0.6851188 -0.5681264
85 -0.4598995 0.6851188
86 0.4869719 -0.4598995
87 0.5034902 0.4869719
88 0.3566604 0.5034902
89 0.3997854 0.3566604
90 0.4651777 0.3997854
91 -0.5673034 0.4651777
92 -0.4650738 -0.5673034
93 -0.5369885 -0.4650738
94 0.5156465 -0.5369885
95 0.4889694 0.5156465
96 -0.5161329 0.4889694
97 0.4652914 -0.5161329
98 0.2951234 0.4652914
99 0.5588874 0.2951234
100 -0.6057082 0.5588874
101 0.4493097 -0.6057082
102 -0.4854338 0.4493097
103 0.5910668 -0.4854338
104 -0.4224209 0.5910668
105 -0.5209267 -0.4224209
106 -0.5456766 -0.5209267
107 -0.5421983 -0.5456766
108 -0.4284434 -0.5421983
109 0.4158003 -0.4284434
110 0.4451544 0.4158003
111 -0.5888493 0.4451544
112 -0.2571537 -0.5888493
113 0.4489001 -0.2571537
114 -0.3371461 0.4489001
115 0.4140952 -0.3371461
116 0.5014781 0.4140952
117 -0.2458552 0.5014781
118 0.5441743 -0.2458552
119 0.6836291 0.5441743
120 0.4889531 0.6836291
121 -0.6022007 0.4889531
122 -0.5671884 -0.6022007
123 0.5273135 -0.5671884
124 -0.3117851 0.5273135
125 -0.5432016 -0.3117851
126 0.3802526 -0.5432016
127 0.3638831 0.3802526
128 0.4016492 0.3638831
129 0.3619671 0.4016492
130 0.3733935 0.3619671
131 0.4644657 0.3733935
132 0.4838842 0.4644657
133 0.5163320 0.4838842
134 0.4559397 0.5163320
135 0.4615596 0.4559397
136 0.4387832 0.4615596
137 0.4795555 0.4387832
138 0.4164415 0.4795555
139 -0.5355831 0.4164415
140 -0.4820826 -0.5355831
141 -0.4820025 -0.4820826
142 0.4677323 -0.4820025
143 -0.4015907 0.4677323
144 -0.5833553 -0.4015907
145 0.3196434 -0.5833553
146 -0.5102826 0.3196434
147 -0.5703803 -0.5102826
148 -0.2515198 -0.5703803
149 -0.2481153 -0.2515198
150 -0.2513128 -0.2481153
151 -0.2510601 -0.2513128
152 0.7484800 -0.2510601
153 -0.2515200 0.7484800
154 0.4969061 -0.2515200
155 -0.6069856 0.4969061
156 -0.2515200 -0.6069856
157 -0.2507246 -0.2515200
158 -0.2511932 -0.2507246
159 0.7140461 -0.2511932
160 0.7438772 0.7140461
161 -0.5637398 0.7438772
162 0.7490304 -0.5637398
163 0.5365371 0.7490304
164 NA 0.5365371
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.4914017 -0.5130816
[2,] -0.5825564 -0.4914017
[3,] 0.4768902 -0.5825564
[4,] 0.5512218 0.4768902
[5,] -0.5049340 0.5512218
[6,] -0.4413876 -0.5049340
[7,] -0.3978805 -0.4413876
[8,] -0.4860130 -0.3978805
[9,] -0.4828296 -0.4860130
[10,] 0.4298400 -0.4828296
[11,] 0.3433372 0.4298400
[12,] -0.5124607 0.3433372
[13,] 0.3887346 -0.5124607
[14,] 0.4510794 0.3887346
[15,] 0.3457921 0.4510794
[16,] -0.5001713 0.3457921
[17,] 0.4938841 -0.5001713
[18,] 0.5443627 0.4938841
[19,] 0.4062679 0.5443627
[20,] -0.5714566 0.4062679
[21,] -0.4913031 -0.5714566
[22,] -0.4470361 -0.4913031
[23,] -0.6374328 -0.4470361
[24,] -0.5682059 -0.6374328
[25,] -0.5218718 -0.5682059
[26,] 0.4621648 -0.5218718
[27,] 0.4716493 0.4621648
[28,] 0.5266142 0.4716493
[29,] -0.5457883 0.5266142
[30,] -0.5719831 -0.5457883
[31,] -0.5826118 -0.5719831
[32,] -0.5994727 -0.5826118
[33,] 0.4747293 -0.5994727
[34,] -0.5350980 0.4747293
[35,] 0.4611466 -0.5350980
[36,] -0.5462160 0.4611466
[37,] 0.4999635 -0.5462160
[38,] -0.3812564 0.4999635
[39,] -0.5326088 -0.3812564
[40,] -0.5019477 -0.5326088
[41,] 0.4669994 -0.5019477
[42,] 0.4972687 0.4669994
[43,] 0.4644385 0.4972687
[44,] -0.6153073 0.4644385
[45,] 0.4925235 -0.6153073
[46,] 0.5402578 0.4925235
[47,] 0.3810153 0.5402578
[48,] 0.4059059 0.3810153
[49,] 0.4162178 0.4059059
[50,] 0.4863950 0.4162178
[51,] -0.2794287 0.4863950
[52,] -0.5117793 -0.2794287
[53,] -0.3980551 -0.5117793
[54,] -0.3506453 -0.3980551
[55,] 0.4685306 -0.3506453
[56,] -0.6434865 0.4685306
[57,] 0.5234091 -0.6434865
[58,] 0.4653591 0.5234091
[59,] 0.5035907 0.4653591
[60,] -0.5762896 0.5035907
[61,] -0.4314891 -0.5762896
[62,] 0.4220877 -0.4314891
[63,] 0.4665520 0.4220877
[64,] -0.5003127 0.4665520
[65,] 0.5296053 -0.5003127
[66,] -0.4865892 0.5296053
[67,] 0.4430712 -0.4865892
[68,] -0.5112714 0.4430712
[69,] 0.5335707 -0.5112714
[70,] 0.4115752 0.5335707
[71,] 0.5628207 0.4115752
[72,] -0.5815743 0.5628207
[73,] 0.4408116 -0.5815743
[74,] -0.5377974 0.4408116
[75,] -0.5534337 -0.5377974
[76,] 0.5072768 -0.5534337
[77,] -0.5373046 0.5072768
[78,] -0.5371202 -0.5373046
[79,] -0.5161051 -0.5371202
[80,] -0.4520680 -0.5161051
[81,] 0.4114995 -0.4520680
[82,] -0.4460718 0.4114995
[83,] -0.5681264 -0.4460718
[84,] 0.6851188 -0.5681264
[85,] -0.4598995 0.6851188
[86,] 0.4869719 -0.4598995
[87,] 0.5034902 0.4869719
[88,] 0.3566604 0.5034902
[89,] 0.3997854 0.3566604
[90,] 0.4651777 0.3997854
[91,] -0.5673034 0.4651777
[92,] -0.4650738 -0.5673034
[93,] -0.5369885 -0.4650738
[94,] 0.5156465 -0.5369885
[95,] 0.4889694 0.5156465
[96,] -0.5161329 0.4889694
[97,] 0.4652914 -0.5161329
[98,] 0.2951234 0.4652914
[99,] 0.5588874 0.2951234
[100,] -0.6057082 0.5588874
[101,] 0.4493097 -0.6057082
[102,] -0.4854338 0.4493097
[103,] 0.5910668 -0.4854338
[104,] -0.4224209 0.5910668
[105,] -0.5209267 -0.4224209
[106,] -0.5456766 -0.5209267
[107,] -0.5421983 -0.5456766
[108,] -0.4284434 -0.5421983
[109,] 0.4158003 -0.4284434
[110,] 0.4451544 0.4158003
[111,] -0.5888493 0.4451544
[112,] -0.2571537 -0.5888493
[113,] 0.4489001 -0.2571537
[114,] -0.3371461 0.4489001
[115,] 0.4140952 -0.3371461
[116,] 0.5014781 0.4140952
[117,] -0.2458552 0.5014781
[118,] 0.5441743 -0.2458552
[119,] 0.6836291 0.5441743
[120,] 0.4889531 0.6836291
[121,] -0.6022007 0.4889531
[122,] -0.5671884 -0.6022007
[123,] 0.5273135 -0.5671884
[124,] -0.3117851 0.5273135
[125,] -0.5432016 -0.3117851
[126,] 0.3802526 -0.5432016
[127,] 0.3638831 0.3802526
[128,] 0.4016492 0.3638831
[129,] 0.3619671 0.4016492
[130,] 0.3733935 0.3619671
[131,] 0.4644657 0.3733935
[132,] 0.4838842 0.4644657
[133,] 0.5163320 0.4838842
[134,] 0.4559397 0.5163320
[135,] 0.4615596 0.4559397
[136,] 0.4387832 0.4615596
[137,] 0.4795555 0.4387832
[138,] 0.4164415 0.4795555
[139,] -0.5355831 0.4164415
[140,] -0.4820826 -0.5355831
[141,] -0.4820025 -0.4820826
[142,] 0.4677323 -0.4820025
[143,] -0.4015907 0.4677323
[144,] -0.5833553 -0.4015907
[145,] 0.3196434 -0.5833553
[146,] -0.5102826 0.3196434
[147,] -0.5703803 -0.5102826
[148,] -0.2515198 -0.5703803
[149,] -0.2481153 -0.2515198
[150,] -0.2513128 -0.2481153
[151,] -0.2510601 -0.2513128
[152,] 0.7484800 -0.2510601
[153,] -0.2515200 0.7484800
[154,] 0.4969061 -0.2515200
[155,] -0.6069856 0.4969061
[156,] -0.2515200 -0.6069856
[157,] -0.2507246 -0.2515200
[158,] -0.2511932 -0.2507246
[159,] 0.7140461 -0.2511932
[160,] 0.7438772 0.7140461
[161,] -0.5637398 0.7438772
[162,] 0.7490304 -0.5637398
[163,] 0.5365371 0.7490304
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.4914017 -0.5130816
2 -0.5825564 -0.4914017
3 0.4768902 -0.5825564
4 0.5512218 0.4768902
5 -0.5049340 0.5512218
6 -0.4413876 -0.5049340
7 -0.3978805 -0.4413876
8 -0.4860130 -0.3978805
9 -0.4828296 -0.4860130
10 0.4298400 -0.4828296
11 0.3433372 0.4298400
12 -0.5124607 0.3433372
13 0.3887346 -0.5124607
14 0.4510794 0.3887346
15 0.3457921 0.4510794
16 -0.5001713 0.3457921
17 0.4938841 -0.5001713
18 0.5443627 0.4938841
19 0.4062679 0.5443627
20 -0.5714566 0.4062679
21 -0.4913031 -0.5714566
22 -0.4470361 -0.4913031
23 -0.6374328 -0.4470361
24 -0.5682059 -0.6374328
25 -0.5218718 -0.5682059
26 0.4621648 -0.5218718
27 0.4716493 0.4621648
28 0.5266142 0.4716493
29 -0.5457883 0.5266142
30 -0.5719831 -0.5457883
31 -0.5826118 -0.5719831
32 -0.5994727 -0.5826118
33 0.4747293 -0.5994727
34 -0.5350980 0.4747293
35 0.4611466 -0.5350980
36 -0.5462160 0.4611466
37 0.4999635 -0.5462160
38 -0.3812564 0.4999635
39 -0.5326088 -0.3812564
40 -0.5019477 -0.5326088
41 0.4669994 -0.5019477
42 0.4972687 0.4669994
43 0.4644385 0.4972687
44 -0.6153073 0.4644385
45 0.4925235 -0.6153073
46 0.5402578 0.4925235
47 0.3810153 0.5402578
48 0.4059059 0.3810153
49 0.4162178 0.4059059
50 0.4863950 0.4162178
51 -0.2794287 0.4863950
52 -0.5117793 -0.2794287
53 -0.3980551 -0.5117793
54 -0.3506453 -0.3980551
55 0.4685306 -0.3506453
56 -0.6434865 0.4685306
57 0.5234091 -0.6434865
58 0.4653591 0.5234091
59 0.5035907 0.4653591
60 -0.5762896 0.5035907
61 -0.4314891 -0.5762896
62 0.4220877 -0.4314891
63 0.4665520 0.4220877
64 -0.5003127 0.4665520
65 0.5296053 -0.5003127
66 -0.4865892 0.5296053
67 0.4430712 -0.4865892
68 -0.5112714 0.4430712
69 0.5335707 -0.5112714
70 0.4115752 0.5335707
71 0.5628207 0.4115752
72 -0.5815743 0.5628207
73 0.4408116 -0.5815743
74 -0.5377974 0.4408116
75 -0.5534337 -0.5377974
76 0.5072768 -0.5534337
77 -0.5373046 0.5072768
78 -0.5371202 -0.5373046
79 -0.5161051 -0.5371202
80 -0.4520680 -0.5161051
81 0.4114995 -0.4520680
82 -0.4460718 0.4114995
83 -0.5681264 -0.4460718
84 0.6851188 -0.5681264
85 -0.4598995 0.6851188
86 0.4869719 -0.4598995
87 0.5034902 0.4869719
88 0.3566604 0.5034902
89 0.3997854 0.3566604
90 0.4651777 0.3997854
91 -0.5673034 0.4651777
92 -0.4650738 -0.5673034
93 -0.5369885 -0.4650738
94 0.5156465 -0.5369885
95 0.4889694 0.5156465
96 -0.5161329 0.4889694
97 0.4652914 -0.5161329
98 0.2951234 0.4652914
99 0.5588874 0.2951234
100 -0.6057082 0.5588874
101 0.4493097 -0.6057082
102 -0.4854338 0.4493097
103 0.5910668 -0.4854338
104 -0.4224209 0.5910668
105 -0.5209267 -0.4224209
106 -0.5456766 -0.5209267
107 -0.5421983 -0.5456766
108 -0.4284434 -0.5421983
109 0.4158003 -0.4284434
110 0.4451544 0.4158003
111 -0.5888493 0.4451544
112 -0.2571537 -0.5888493
113 0.4489001 -0.2571537
114 -0.3371461 0.4489001
115 0.4140952 -0.3371461
116 0.5014781 0.4140952
117 -0.2458552 0.5014781
118 0.5441743 -0.2458552
119 0.6836291 0.5441743
120 0.4889531 0.6836291
121 -0.6022007 0.4889531
122 -0.5671884 -0.6022007
123 0.5273135 -0.5671884
124 -0.3117851 0.5273135
125 -0.5432016 -0.3117851
126 0.3802526 -0.5432016
127 0.3638831 0.3802526
128 0.4016492 0.3638831
129 0.3619671 0.4016492
130 0.3733935 0.3619671
131 0.4644657 0.3733935
132 0.4838842 0.4644657
133 0.5163320 0.4838842
134 0.4559397 0.5163320
135 0.4615596 0.4559397
136 0.4387832 0.4615596
137 0.4795555 0.4387832
138 0.4164415 0.4795555
139 -0.5355831 0.4164415
140 -0.4820826 -0.5355831
141 -0.4820025 -0.4820826
142 0.4677323 -0.4820025
143 -0.4015907 0.4677323
144 -0.5833553 -0.4015907
145 0.3196434 -0.5833553
146 -0.5102826 0.3196434
147 -0.5703803 -0.5102826
148 -0.2515198 -0.5703803
149 -0.2481153 -0.2515198
150 -0.2513128 -0.2481153
151 -0.2510601 -0.2513128
152 0.7484800 -0.2510601
153 -0.2515200 0.7484800
154 0.4969061 -0.2515200
155 -0.6069856 0.4969061
156 -0.2515200 -0.6069856
157 -0.2507246 -0.2515200
158 -0.2511932 -0.2507246
159 0.7140461 -0.2511932
160 0.7438772 0.7140461
161 -0.5637398 0.7438772
162 0.7490304 -0.5637398
163 0.5365371 0.7490304
> 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/7vtyy1355065323.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/8pggk1355065323.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/9lk3g1355065323.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/10az2o1355065323.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/11r6ld1355065323.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/12a87g1355065323.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/13zrf31355065323.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/14cyjc1355065323.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/152hrc1355065323.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/16b0jp1355065323.tab")
+ }
>
> try(system("convert tmp/1bhgg1355065323.ps tmp/1bhgg1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/2f3wo1355065323.ps tmp/2f3wo1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/3tdsy1355065323.ps tmp/3tdsy1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/43alr1355065323.ps tmp/43alr1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/5rrgk1355065323.ps tmp/5rrgk1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qo1y1355065323.ps tmp/6qo1y1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/7vtyy1355065323.ps tmp/7vtyy1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/8pggk1355065323.ps tmp/8pggk1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/9lk3g1355065323.ps tmp/9lk3g1355065323.png",intern=TRUE))
character(0)
> try(system("convert tmp/10az2o1355065323.ps tmp/10az2o1355065323.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.225 1.638 9.863