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(26
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,23
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,25
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,23
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,19
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,29
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,25
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,21
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,22
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,25
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,24
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,18
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,22
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,15
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,22
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,28
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,20
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,12
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,24
+ ,20
+ ,8
+ ,17
+ ,7
+ ,22
+ ,20
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,21
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,20
+ ,34
+ ,16
+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)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'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
CM M D PE PC PS t
1 24 26 14 11 12 24 1
2 25 23 11 7 8 25 2
3 17 25 6 17 8 30 3
4 18 23 12 10 8 19 4
5 18 19 8 12 9 22 5
6 16 29 10 12 7 22 6
7 20 25 10 11 4 25 7
8 16 21 11 11 11 23 8
9 18 22 16 12 7 17 9
10 17 25 11 13 7 21 10
11 23 24 13 14 12 19 11
12 30 18 12 16 10 19 12
13 23 22 8 11 10 15 13
14 18 15 12 10 8 16 14
15 15 22 11 11 8 23 15
16 12 28 4 15 4 27 16
17 21 20 9 9 9 22 17
18 15 12 8 11 8 14 18
19 20 24 8 17 7 22 19
20 31 20 14 17 11 23 20
21 27 21 15 11 9 23 21
22 34 20 16 18 11 21 22
23 21 21 9 14 13 19 23
24 31 23 14 10 8 18 24
25 19 28 11 11 8 20 25
26 16 24 8 15 9 23 26
27 20 24 9 15 6 25 27
28 21 24 9 13 9 19 28
29 22 23 9 16 9 24 29
30 17 23 9 13 6 22 30
31 24 29 10 9 6 25 31
32 25 24 16 18 16 26 32
33 26 18 11 18 5 29 33
34 25 25 8 12 7 32 34
35 17 21 9 17 9 25 35
36 32 26 16 9 6 29 36
37 33 22 11 9 6 28 37
38 13 22 16 12 5 17 38
39 32 22 12 18 12 28 39
40 25 23 12 12 7 29 40
41 29 30 14 18 10 26 41
42 22 23 9 14 9 25 42
43 18 17 10 15 8 14 43
44 17 23 9 16 5 25 44
45 20 23 10 10 8 26 45
46 15 25 12 11 8 20 46
47 20 24 14 14 10 18 47
48 33 24 14 9 6 32 48
49 29 23 10 12 8 25 49
50 23 21 14 17 7 25 50
51 26 24 16 5 4 23 51
52 18 24 9 12 8 21 52
53 20 28 10 12 8 20 53
54 11 16 6 6 4 15 54
55 28 20 8 24 20 30 55
56 26 29 13 12 8 24 56
57 22 27 10 12 8 26 57
58 17 22 8 14 6 24 58
59 12 28 7 7 4 22 59
60 14 16 15 13 8 14 60
61 17 25 9 12 9 24 61
62 21 24 10 13 6 24 62
63 19 28 12 14 7 24 63
64 18 24 13 8 9 24 64
65 10 23 10 11 5 19 65
66 29 30 11 9 5 31 66
67 31 24 8 11 8 22 67
68 19 21 9 13 8 27 68
69 9 25 13 10 6 19 69
70 20 25 11 11 8 25 70
71 28 22 8 12 7 20 71
72 19 23 9 9 7 21 72
73 30 26 9 15 9 27 73
74 29 23 15 18 11 23 74
75 26 25 9 15 6 25 75
76 23 21 10 12 8 20 76
77 13 25 14 13 6 21 77
78 21 24 12 14 9 22 78
79 19 29 12 10 8 23 79
80 28 22 11 13 6 25 80
81 23 27 14 13 10 25 81
82 18 26 6 11 8 17 82
83 21 22 12 13 8 19 83
84 20 24 8 16 10 25 84
85 23 27 14 8 5 19 85
86 21 24 11 16 7 20 86
87 21 24 10 11 5 26 87
88 15 29 14 9 8 23 88
89 28 22 12 16 14 27 89
90 19 21 10 12 7 17 90
91 26 24 14 14 8 17 91
92 10 24 5 8 6 19 92
93 16 23 11 9 5 17 93
94 22 20 10 15 6 22 94
95 19 27 9 11 10 21 95
96 31 26 10 21 12 32 96
97 31 25 16 14 9 21 97
98 29 21 13 18 12 21 98
99 19 21 9 12 7 18 99
100 22 19 10 13 8 18 100
101 23 21 10 15 10 23 101
102 15 21 7 12 6 19 102
103 20 16 9 19 10 20 103
104 18 22 8 15 10 21 104
105 23 29 14 11 10 20 105
106 25 15 14 11 5 17 106
107 21 17 8 10 7 18 107
108 24 15 9 13 10 19 108
109 25 21 14 15 11 22 109
110 17 21 14 12 6 15 110
111 13 19 8 12 7 14 111
112 28 24 8 16 12 18 112
113 21 20 8 9 11 24 113
114 25 17 7 18 11 35 114
115 9 23 6 8 11 29 115
116 16 24 8 13 5 21 116
117 19 14 6 17 8 25 117
118 17 19 11 9 6 20 118
119 25 24 14 15 9 22 119
120 20 13 11 8 4 13 120
121 29 22 11 7 4 26 121
122 14 16 11 12 7 17 122
123 22 19 14 14 11 25 123
124 15 25 8 6 6 20 124
125 19 25 20 8 7 19 125
126 20 23 11 17 8 21 126
127 15 24 8 10 4 22 127
128 20 26 11 11 8 24 128
129 18 26 10 14 9 21 129
130 33 25 14 11 8 26 130
131 22 18 11 13 11 24 131
132 16 21 9 12 8 16 132
133 17 26 9 11 5 23 133
134 16 23 8 9 4 18 134
135 21 23 10 12 8 16 135
136 26 22 13 20 10 26 136
137 18 20 13 12 6 19 137
138 18 13 12 13 9 21 138
139 17 24 8 12 9 21 139
140 22 15 13 12 13 22 140
141 30 14 14 9 9 23 141
142 30 22 12 15 10 29 142
143 24 10 14 24 20 21 143
144 21 24 15 7 5 21 144
145 21 22 13 17 11 23 145
146 29 24 16 11 6 27 146
147 31 19 9 17 9 25 147
148 20 20 9 11 7 21 148
149 16 13 9 12 9 10 149
150 22 20 8 14 10 20 150
151 20 22 7 11 9 26 151
152 28 24 16 16 8 24 152
153 38 29 11 21 7 29 153
154 22 12 9 14 6 19 154
155 20 20 11 20 13 24 155
156 17 21 9 13 6 19 156
157 28 24 14 11 8 24 157
158 22 22 13 15 10 22 158
159 31 20 16 19 16 17 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M D PE PC PS
-2.706768 -0.100757 0.804826 0.246619 0.190858 0.568213
t
0.005644
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-12.0044 -2.6222 -0.3906 2.8105 12.5678
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.706768 3.230753 -0.838 0.4035
M -0.100757 0.105352 -0.956 0.3404
D 0.804826 0.130765 6.155 6.39e-09 ***
PE 0.246619 0.133141 1.852 0.0659 .
PC 0.190858 0.168568 1.132 0.2593
PS 0.568213 0.096019 5.918 2.09e-08 ***
t 0.005644 0.008004 0.705 0.4817
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.485 on 152 degrees of freedom
Multiple R-squared: 0.4091, Adjusted R-squared: 0.3858
F-statistic: 17.54 on 6 and 152 DF, p-value: 2.250e-15
> 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.09861377 0.19722753 0.90138623
[2,] 0.35497557 0.70995114 0.64502443
[3,] 0.74920567 0.50158865 0.25079433
[4,] 0.74399427 0.51201145 0.25600573
[5,] 0.72714235 0.54571530 0.27285765
[6,] 0.68980603 0.62038794 0.31019397
[7,] 0.60752052 0.78495895 0.39247948
[8,] 0.55296398 0.89407205 0.44703602
[9,] 0.52448930 0.95102141 0.47551070
[10,] 0.46970512 0.93941024 0.53029488
[11,] 0.49868932 0.99737864 0.50131068
[12,] 0.43117618 0.86235236 0.56882382
[13,] 0.41945109 0.83890219 0.58054891
[14,] 0.37693748 0.75387497 0.62306252
[15,] 0.53093435 0.93813130 0.46906565
[16,] 0.48877827 0.97755654 0.51122173
[17,] 0.50572430 0.98855139 0.49427570
[18,] 0.43839346 0.87678692 0.56160654
[19,] 0.37935932 0.75871863 0.62064068
[20,] 0.31782325 0.63564650 0.68217675
[21,] 0.27807511 0.55615022 0.72192489
[22,] 0.26960411 0.53920822 0.73039589
[23,] 0.39900659 0.79801318 0.60099341
[24,] 0.34322207 0.68644414 0.65677793
[25,] 0.31364172 0.62728343 0.68635828
[26,] 0.35677341 0.71354681 0.64322659
[27,] 0.32399828 0.64799655 0.67600172
[28,] 0.43855519 0.87711039 0.56144481
[29,] 0.74562444 0.50875112 0.25437556
[30,] 0.72998173 0.54003653 0.27001827
[31,] 0.69393408 0.61213183 0.30606592
[32,] 0.65672299 0.68655402 0.34327701
[33,] 0.60963549 0.78072903 0.39036451
[34,] 0.55943235 0.88113530 0.44056765
[35,] 0.55279891 0.89440218 0.44720109
[36,] 0.54019325 0.91961350 0.45980675
[37,] 0.58417501 0.83164998 0.41582499
[38,] 0.54711759 0.90576482 0.45288241
[39,] 0.53701162 0.92597675 0.46298838
[40,] 0.58966964 0.82066073 0.41033036
[41,] 0.56842203 0.86315593 0.43157797
[42,] 0.53817823 0.92364355 0.46182177
[43,] 0.49105798 0.98211597 0.50894202
[44,] 0.44553697 0.89107395 0.55446303
[45,] 0.40493521 0.80987042 0.59506479
[46,] 0.36654463 0.73308926 0.63345537
[47,] 0.33576261 0.67152521 0.66423739
[48,] 0.29273382 0.58546764 0.70726618
[49,] 0.26737154 0.53474308 0.73262846
[50,] 0.24951050 0.49902100 0.75048950
[51,] 0.30867088 0.61734176 0.69132912
[52,] 0.29409771 0.58819543 0.70590229
[53,] 0.25509958 0.51019916 0.74490042
[54,] 0.23943007 0.47886013 0.76056993
[55,] 0.26564423 0.53128845 0.73435577
[56,] 0.33036433 0.66072866 0.66963567
[57,] 0.33896684 0.67793369 0.66103316
[58,] 0.68380050 0.63239900 0.31619950
[59,] 0.67331548 0.65336904 0.32668452
[60,] 0.84119016 0.31761968 0.15880984
[61,] 0.81913833 0.36172334 0.18086167
[62,] 0.93085174 0.13829652 0.06914826
[63,] 0.91465690 0.17068620 0.08534310
[64,] 0.93828293 0.12343413 0.06171707
[65,] 0.92638610 0.14722779 0.07361390
[66,] 0.92762810 0.14474379 0.07237190
[67,] 0.92153290 0.15693419 0.07846710
[68,] 0.96932878 0.06134244 0.03067122
[69,] 0.96166734 0.07666532 0.03833266
[70,] 0.95410749 0.09178503 0.04589251
[71,] 0.95660195 0.08679610 0.04339805
[72,] 0.94866640 0.10266720 0.05133360
[73,] 0.94767456 0.10465089 0.05232544
[74,] 0.93387686 0.13224627 0.06612314
[75,] 0.92077846 0.15844307 0.07922154
[76,] 0.91125584 0.17748831 0.08874416
[77,] 0.89368596 0.21262809 0.10631404
[78,] 0.87164729 0.25670542 0.12835271
[79,] 0.91937978 0.16124045 0.08062022
[80,] 0.90261156 0.19477687 0.09738844
[81,] 0.88176524 0.23646951 0.11823476
[82,] 0.88139741 0.23720517 0.11860259
[83,] 0.87139804 0.25720392 0.12860196
[84,] 0.84913248 0.30173503 0.15086752
[85,] 0.82042235 0.35915530 0.17957765
[86,] 0.78701774 0.42596451 0.21298226
[87,] 0.75571572 0.48856856 0.24428428
[88,] 0.77322150 0.45355700 0.22677850
[89,] 0.76999162 0.46001675 0.23000838
[90,] 0.73436003 0.53127995 0.26563997
[91,] 0.71228534 0.57542931 0.28771466
[92,] 0.67380418 0.65239164 0.32619582
[93,] 0.63288070 0.73423861 0.36711930
[94,] 0.59179549 0.81640902 0.40820451
[95,] 0.54863122 0.90273756 0.45136878
[96,] 0.50634049 0.98731902 0.49365951
[97,] 0.49269163 0.98538327 0.50730837
[98,] 0.50000209 0.99999582 0.49999791
[99,] 0.53930362 0.92139276 0.46069638
[100,] 0.50186534 0.99626931 0.49813466
[101,] 0.46070429 0.92140858 0.53929571
[102,] 0.41374391 0.82748783 0.58625609
[103,] 0.74061884 0.51876232 0.25938116
[104,] 0.77557916 0.44884168 0.22442084
[105,] 0.75119249 0.49761501 0.24880751
[106,] 0.87545986 0.24908027 0.12454014
[107,] 0.84709319 0.30581363 0.15290681
[108,] 0.81763053 0.36473895 0.18236947
[109,] 0.78416978 0.43166044 0.21583022
[110,] 0.75623962 0.48752076 0.24376038
[111,] 0.80497058 0.39005885 0.19502942
[112,] 0.88405952 0.23188096 0.11594048
[113,] 0.86524974 0.26950052 0.13475026
[114,] 0.84491032 0.31017935 0.15508968
[115,] 0.80690013 0.38619974 0.19309987
[116,] 0.81156418 0.37687164 0.18843582
[117,] 0.76821223 0.46357554 0.23178777
[118,] 0.73686741 0.52626518 0.26313259
[119,] 0.69033076 0.61933849 0.30966924
[120,] 0.64501592 0.70996815 0.35498408
[121,] 0.76589394 0.46821213 0.23410606
[122,] 0.71358028 0.57283943 0.28641972
[123,] 0.65340743 0.69318514 0.34659257
[124,] 0.61538019 0.76923962 0.38461981
[125,] 0.54569034 0.90861932 0.45430966
[126,] 0.57100071 0.85799859 0.42899929
[127,] 0.50053575 0.99892851 0.49946425
[128,] 0.45340849 0.90681699 0.54659151
[129,] 0.47018663 0.94037326 0.52981337
[130,] 0.39628127 0.79256253 0.60371873
[131,] 0.32283780 0.64567559 0.67716220
[132,] 0.42594053 0.85188107 0.57405947
[133,] 0.37594693 0.75189386 0.62405307
[134,] 0.30335049 0.60670098 0.69664951
[135,] 0.22718590 0.45437179 0.77281410
[136,] 0.33352554 0.66705109 0.66647446
[137,] 0.25415057 0.50830115 0.74584943
[138,] 0.25287062 0.50574125 0.74712938
[139,] 0.15961230 0.31922460 0.84038770
[140,] 0.08634341 0.17268683 0.91365659
> postscript(file="/var/www/html/freestat/rcomp/tmp/1m6e71290179369.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/2wyvs1290179369.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/3wyvs1290179369.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/4wyvs1290179369.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/5wyvs1290179369.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 = 159
Frequency = 1
1 2 3 4 5 6
-0.58697514 3.70128184 -5.38597267 -1.44541094 -1.02351424 -3.24952574
7 8 9 10 11 12
-0.54364296 -5.95672141 -3.95964568 -3.15836182 1.06110202 8.14422146
13 14 15 16 17 18
8.26685262 -0.60326998 -6.32290065 -5.58611855 1.94454071 0.18099219
19 20 21 22 23 24
0.54987130 4.98059995 2.13231543 7.24946705 1.71954391 10.40026339
25 26 27 28 29 30
-0.07016460 -3.94633107 -1.32065258 3.00364387 0.31632164 -2.24046607
31 32 33 34 35 36
3.83544064 -5.19930511 -0.39056084 1.11692659 -5.73388982 4.40314238
37 38 39 40 41 42
9.58681230 -8.74161587 4.40598027 -0.63311703 2.10923677 0.16796943
43 44 45 46 47 48
0.94754076 -4.57312410 -2.04466923 -5.29579229 -1.99699142 5.03890891
49 50 51 52 53 54
7.00772883 -3.46096741 2.89443247 -0.83076988 1.33000021 -0.58121293
55 56 57 58 59 60
-0.80954401 2.72649493 -0.20261188 -3.07748400 -3.42928849 -6.78006121
61 62 63 64 65 66
-3.67630943 -0.26158052 -3.91132601 -5.02682716 -7.85410990 4.71539937
67 68 69 70 71 72
12.56779614 -3.87924663 -11.03389028 -2.46749616 10.42437049 0.88630045
73 74 75 76 77 78
6.91221988 1.92663032 4.50917481 3.49488232 -9.76015303 -1.64430900
79 80 81 82 83 84
-2.53704927 5.06226870 -2.61750146 4.13536055 0.26807143 -1.84760695
85 86 87 88 89 90
2.95658344 0.14026661 -0.85501990 -7.95088119 0.80349626 1.31135834
91 92 93 94 95 96
4.70458593 -3.33262437 -1.18731433 0.79796119 0.09369532 2.08422207
97 98 99 100 101 102
5.69811509 4.14487121 1.49717180 3.04771125 0.52756180 -1.28746471
103 104 105 106 107 108
-1.46452120 -1.64253715 0.78284977 4.02554006 4.34705289 4.45442557
109 110 111 112 113 114
-0.35954108 -2.69354759 -1.69439655 9.59012539 0.68936532 -3.28363505
115 116 117 118 119 120
-12.00444777 -2.06122762 -2.29668984 -2.62694765 0.26800201 4.36304876
121 122 123 124 125 126
7.12406560 -5.17787092 -5.09809592 -0.90193978 -6.68137516 -2.19195456
127 128 129 130 131 132
-2.76081421 -2.12589942 -2.55279354 7.21115202 -2.01469882 -0.74352439
133 134 135 136 137 138
-2.40368237 0.61838909 3.63623042 -1.92144378 -3.41472837 -5.27646376
139 140 141 142 143 144
-1.70786189 -2.97609150 5.04775754 2.37797049 -6.02885325 -1.37333724
145 146 147 148 149 150
-4.71860608 1.22393739 7.43242799 0.66182105 1.57288679 2.71114030
151 152 153 154 155 156
-0.76672826 0.27990013 10.91886784 2.40932845 -6.05669741 -1.44853041
157 158 159
3.09442339 -2.53967419 4.54813171
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ppvd1290179369.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.58697514 NA
1 3.70128184 -0.58697514
2 -5.38597267 3.70128184
3 -1.44541094 -5.38597267
4 -1.02351424 -1.44541094
5 -3.24952574 -1.02351424
6 -0.54364296 -3.24952574
7 -5.95672141 -0.54364296
8 -3.95964568 -5.95672141
9 -3.15836182 -3.95964568
10 1.06110202 -3.15836182
11 8.14422146 1.06110202
12 8.26685262 8.14422146
13 -0.60326998 8.26685262
14 -6.32290065 -0.60326998
15 -5.58611855 -6.32290065
16 1.94454071 -5.58611855
17 0.18099219 1.94454071
18 0.54987130 0.18099219
19 4.98059995 0.54987130
20 2.13231543 4.98059995
21 7.24946705 2.13231543
22 1.71954391 7.24946705
23 10.40026339 1.71954391
24 -0.07016460 10.40026339
25 -3.94633107 -0.07016460
26 -1.32065258 -3.94633107
27 3.00364387 -1.32065258
28 0.31632164 3.00364387
29 -2.24046607 0.31632164
30 3.83544064 -2.24046607
31 -5.19930511 3.83544064
32 -0.39056084 -5.19930511
33 1.11692659 -0.39056084
34 -5.73388982 1.11692659
35 4.40314238 -5.73388982
36 9.58681230 4.40314238
37 -8.74161587 9.58681230
38 4.40598027 -8.74161587
39 -0.63311703 4.40598027
40 2.10923677 -0.63311703
41 0.16796943 2.10923677
42 0.94754076 0.16796943
43 -4.57312410 0.94754076
44 -2.04466923 -4.57312410
45 -5.29579229 -2.04466923
46 -1.99699142 -5.29579229
47 5.03890891 -1.99699142
48 7.00772883 5.03890891
49 -3.46096741 7.00772883
50 2.89443247 -3.46096741
51 -0.83076988 2.89443247
52 1.33000021 -0.83076988
53 -0.58121293 1.33000021
54 -0.80954401 -0.58121293
55 2.72649493 -0.80954401
56 -0.20261188 2.72649493
57 -3.07748400 -0.20261188
58 -3.42928849 -3.07748400
59 -6.78006121 -3.42928849
60 -3.67630943 -6.78006121
61 -0.26158052 -3.67630943
62 -3.91132601 -0.26158052
63 -5.02682716 -3.91132601
64 -7.85410990 -5.02682716
65 4.71539937 -7.85410990
66 12.56779614 4.71539937
67 -3.87924663 12.56779614
68 -11.03389028 -3.87924663
69 -2.46749616 -11.03389028
70 10.42437049 -2.46749616
71 0.88630045 10.42437049
72 6.91221988 0.88630045
73 1.92663032 6.91221988
74 4.50917481 1.92663032
75 3.49488232 4.50917481
76 -9.76015303 3.49488232
77 -1.64430900 -9.76015303
78 -2.53704927 -1.64430900
79 5.06226870 -2.53704927
80 -2.61750146 5.06226870
81 4.13536055 -2.61750146
82 0.26807143 4.13536055
83 -1.84760695 0.26807143
84 2.95658344 -1.84760695
85 0.14026661 2.95658344
86 -0.85501990 0.14026661
87 -7.95088119 -0.85501990
88 0.80349626 -7.95088119
89 1.31135834 0.80349626
90 4.70458593 1.31135834
91 -3.33262437 4.70458593
92 -1.18731433 -3.33262437
93 0.79796119 -1.18731433
94 0.09369532 0.79796119
95 2.08422207 0.09369532
96 5.69811509 2.08422207
97 4.14487121 5.69811509
98 1.49717180 4.14487121
99 3.04771125 1.49717180
100 0.52756180 3.04771125
101 -1.28746471 0.52756180
102 -1.46452120 -1.28746471
103 -1.64253715 -1.46452120
104 0.78284977 -1.64253715
105 4.02554006 0.78284977
106 4.34705289 4.02554006
107 4.45442557 4.34705289
108 -0.35954108 4.45442557
109 -2.69354759 -0.35954108
110 -1.69439655 -2.69354759
111 9.59012539 -1.69439655
112 0.68936532 9.59012539
113 -3.28363505 0.68936532
114 -12.00444777 -3.28363505
115 -2.06122762 -12.00444777
116 -2.29668984 -2.06122762
117 -2.62694765 -2.29668984
118 0.26800201 -2.62694765
119 4.36304876 0.26800201
120 7.12406560 4.36304876
121 -5.17787092 7.12406560
122 -5.09809592 -5.17787092
123 -0.90193978 -5.09809592
124 -6.68137516 -0.90193978
125 -2.19195456 -6.68137516
126 -2.76081421 -2.19195456
127 -2.12589942 -2.76081421
128 -2.55279354 -2.12589942
129 7.21115202 -2.55279354
130 -2.01469882 7.21115202
131 -0.74352439 -2.01469882
132 -2.40368237 -0.74352439
133 0.61838909 -2.40368237
134 3.63623042 0.61838909
135 -1.92144378 3.63623042
136 -3.41472837 -1.92144378
137 -5.27646376 -3.41472837
138 -1.70786189 -5.27646376
139 -2.97609150 -1.70786189
140 5.04775754 -2.97609150
141 2.37797049 5.04775754
142 -6.02885325 2.37797049
143 -1.37333724 -6.02885325
144 -4.71860608 -1.37333724
145 1.22393739 -4.71860608
146 7.43242799 1.22393739
147 0.66182105 7.43242799
148 1.57288679 0.66182105
149 2.71114030 1.57288679
150 -0.76672826 2.71114030
151 0.27990013 -0.76672826
152 10.91886784 0.27990013
153 2.40932845 10.91886784
154 -6.05669741 2.40932845
155 -1.44853041 -6.05669741
156 3.09442339 -1.44853041
157 -2.53967419 3.09442339
158 4.54813171 -2.53967419
159 NA 4.54813171
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.70128184 -0.58697514
[2,] -5.38597267 3.70128184
[3,] -1.44541094 -5.38597267
[4,] -1.02351424 -1.44541094
[5,] -3.24952574 -1.02351424
[6,] -0.54364296 -3.24952574
[7,] -5.95672141 -0.54364296
[8,] -3.95964568 -5.95672141
[9,] -3.15836182 -3.95964568
[10,] 1.06110202 -3.15836182
[11,] 8.14422146 1.06110202
[12,] 8.26685262 8.14422146
[13,] -0.60326998 8.26685262
[14,] -6.32290065 -0.60326998
[15,] -5.58611855 -6.32290065
[16,] 1.94454071 -5.58611855
[17,] 0.18099219 1.94454071
[18,] 0.54987130 0.18099219
[19,] 4.98059995 0.54987130
[20,] 2.13231543 4.98059995
[21,] 7.24946705 2.13231543
[22,] 1.71954391 7.24946705
[23,] 10.40026339 1.71954391
[24,] -0.07016460 10.40026339
[25,] -3.94633107 -0.07016460
[26,] -1.32065258 -3.94633107
[27,] 3.00364387 -1.32065258
[28,] 0.31632164 3.00364387
[29,] -2.24046607 0.31632164
[30,] 3.83544064 -2.24046607
[31,] -5.19930511 3.83544064
[32,] -0.39056084 -5.19930511
[33,] 1.11692659 -0.39056084
[34,] -5.73388982 1.11692659
[35,] 4.40314238 -5.73388982
[36,] 9.58681230 4.40314238
[37,] -8.74161587 9.58681230
[38,] 4.40598027 -8.74161587
[39,] -0.63311703 4.40598027
[40,] 2.10923677 -0.63311703
[41,] 0.16796943 2.10923677
[42,] 0.94754076 0.16796943
[43,] -4.57312410 0.94754076
[44,] -2.04466923 -4.57312410
[45,] -5.29579229 -2.04466923
[46,] -1.99699142 -5.29579229
[47,] 5.03890891 -1.99699142
[48,] 7.00772883 5.03890891
[49,] -3.46096741 7.00772883
[50,] 2.89443247 -3.46096741
[51,] -0.83076988 2.89443247
[52,] 1.33000021 -0.83076988
[53,] -0.58121293 1.33000021
[54,] -0.80954401 -0.58121293
[55,] 2.72649493 -0.80954401
[56,] -0.20261188 2.72649493
[57,] -3.07748400 -0.20261188
[58,] -3.42928849 -3.07748400
[59,] -6.78006121 -3.42928849
[60,] -3.67630943 -6.78006121
[61,] -0.26158052 -3.67630943
[62,] -3.91132601 -0.26158052
[63,] -5.02682716 -3.91132601
[64,] -7.85410990 -5.02682716
[65,] 4.71539937 -7.85410990
[66,] 12.56779614 4.71539937
[67,] -3.87924663 12.56779614
[68,] -11.03389028 -3.87924663
[69,] -2.46749616 -11.03389028
[70,] 10.42437049 -2.46749616
[71,] 0.88630045 10.42437049
[72,] 6.91221988 0.88630045
[73,] 1.92663032 6.91221988
[74,] 4.50917481 1.92663032
[75,] 3.49488232 4.50917481
[76,] -9.76015303 3.49488232
[77,] -1.64430900 -9.76015303
[78,] -2.53704927 -1.64430900
[79,] 5.06226870 -2.53704927
[80,] -2.61750146 5.06226870
[81,] 4.13536055 -2.61750146
[82,] 0.26807143 4.13536055
[83,] -1.84760695 0.26807143
[84,] 2.95658344 -1.84760695
[85,] 0.14026661 2.95658344
[86,] -0.85501990 0.14026661
[87,] -7.95088119 -0.85501990
[88,] 0.80349626 -7.95088119
[89,] 1.31135834 0.80349626
[90,] 4.70458593 1.31135834
[91,] -3.33262437 4.70458593
[92,] -1.18731433 -3.33262437
[93,] 0.79796119 -1.18731433
[94,] 0.09369532 0.79796119
[95,] 2.08422207 0.09369532
[96,] 5.69811509 2.08422207
[97,] 4.14487121 5.69811509
[98,] 1.49717180 4.14487121
[99,] 3.04771125 1.49717180
[100,] 0.52756180 3.04771125
[101,] -1.28746471 0.52756180
[102,] -1.46452120 -1.28746471
[103,] -1.64253715 -1.46452120
[104,] 0.78284977 -1.64253715
[105,] 4.02554006 0.78284977
[106,] 4.34705289 4.02554006
[107,] 4.45442557 4.34705289
[108,] -0.35954108 4.45442557
[109,] -2.69354759 -0.35954108
[110,] -1.69439655 -2.69354759
[111,] 9.59012539 -1.69439655
[112,] 0.68936532 9.59012539
[113,] -3.28363505 0.68936532
[114,] -12.00444777 -3.28363505
[115,] -2.06122762 -12.00444777
[116,] -2.29668984 -2.06122762
[117,] -2.62694765 -2.29668984
[118,] 0.26800201 -2.62694765
[119,] 4.36304876 0.26800201
[120,] 7.12406560 4.36304876
[121,] -5.17787092 7.12406560
[122,] -5.09809592 -5.17787092
[123,] -0.90193978 -5.09809592
[124,] -6.68137516 -0.90193978
[125,] -2.19195456 -6.68137516
[126,] -2.76081421 -2.19195456
[127,] -2.12589942 -2.76081421
[128,] -2.55279354 -2.12589942
[129,] 7.21115202 -2.55279354
[130,] -2.01469882 7.21115202
[131,] -0.74352439 -2.01469882
[132,] -2.40368237 -0.74352439
[133,] 0.61838909 -2.40368237
[134,] 3.63623042 0.61838909
[135,] -1.92144378 3.63623042
[136,] -3.41472837 -1.92144378
[137,] -5.27646376 -3.41472837
[138,] -1.70786189 -5.27646376
[139,] -2.97609150 -1.70786189
[140,] 5.04775754 -2.97609150
[141,] 2.37797049 5.04775754
[142,] -6.02885325 2.37797049
[143,] -1.37333724 -6.02885325
[144,] -4.71860608 -1.37333724
[145,] 1.22393739 -4.71860608
[146,] 7.43242799 1.22393739
[147,] 0.66182105 7.43242799
[148,] 1.57288679 0.66182105
[149,] 2.71114030 1.57288679
[150,] -0.76672826 2.71114030
[151,] 0.27990013 -0.76672826
[152,] 10.91886784 0.27990013
[153,] 2.40932845 10.91886784
[154,] -6.05669741 2.40932845
[155,] -1.44853041 -6.05669741
[156,] 3.09442339 -1.44853041
[157,] -2.53967419 3.09442339
[158,] 4.54813171 -2.53967419
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.70128184 -0.58697514
2 -5.38597267 3.70128184
3 -1.44541094 -5.38597267
4 -1.02351424 -1.44541094
5 -3.24952574 -1.02351424
6 -0.54364296 -3.24952574
7 -5.95672141 -0.54364296
8 -3.95964568 -5.95672141
9 -3.15836182 -3.95964568
10 1.06110202 -3.15836182
11 8.14422146 1.06110202
12 8.26685262 8.14422146
13 -0.60326998 8.26685262
14 -6.32290065 -0.60326998
15 -5.58611855 -6.32290065
16 1.94454071 -5.58611855
17 0.18099219 1.94454071
18 0.54987130 0.18099219
19 4.98059995 0.54987130
20 2.13231543 4.98059995
21 7.24946705 2.13231543
22 1.71954391 7.24946705
23 10.40026339 1.71954391
24 -0.07016460 10.40026339
25 -3.94633107 -0.07016460
26 -1.32065258 -3.94633107
27 3.00364387 -1.32065258
28 0.31632164 3.00364387
29 -2.24046607 0.31632164
30 3.83544064 -2.24046607
31 -5.19930511 3.83544064
32 -0.39056084 -5.19930511
33 1.11692659 -0.39056084
34 -5.73388982 1.11692659
35 4.40314238 -5.73388982
36 9.58681230 4.40314238
37 -8.74161587 9.58681230
38 4.40598027 -8.74161587
39 -0.63311703 4.40598027
40 2.10923677 -0.63311703
41 0.16796943 2.10923677
42 0.94754076 0.16796943
43 -4.57312410 0.94754076
44 -2.04466923 -4.57312410
45 -5.29579229 -2.04466923
46 -1.99699142 -5.29579229
47 5.03890891 -1.99699142
48 7.00772883 5.03890891
49 -3.46096741 7.00772883
50 2.89443247 -3.46096741
51 -0.83076988 2.89443247
52 1.33000021 -0.83076988
53 -0.58121293 1.33000021
54 -0.80954401 -0.58121293
55 2.72649493 -0.80954401
56 -0.20261188 2.72649493
57 -3.07748400 -0.20261188
58 -3.42928849 -3.07748400
59 -6.78006121 -3.42928849
60 -3.67630943 -6.78006121
61 -0.26158052 -3.67630943
62 -3.91132601 -0.26158052
63 -5.02682716 -3.91132601
64 -7.85410990 -5.02682716
65 4.71539937 -7.85410990
66 12.56779614 4.71539937
67 -3.87924663 12.56779614
68 -11.03389028 -3.87924663
69 -2.46749616 -11.03389028
70 10.42437049 -2.46749616
71 0.88630045 10.42437049
72 6.91221988 0.88630045
73 1.92663032 6.91221988
74 4.50917481 1.92663032
75 3.49488232 4.50917481
76 -9.76015303 3.49488232
77 -1.64430900 -9.76015303
78 -2.53704927 -1.64430900
79 5.06226870 -2.53704927
80 -2.61750146 5.06226870
81 4.13536055 -2.61750146
82 0.26807143 4.13536055
83 -1.84760695 0.26807143
84 2.95658344 -1.84760695
85 0.14026661 2.95658344
86 -0.85501990 0.14026661
87 -7.95088119 -0.85501990
88 0.80349626 -7.95088119
89 1.31135834 0.80349626
90 4.70458593 1.31135834
91 -3.33262437 4.70458593
92 -1.18731433 -3.33262437
93 0.79796119 -1.18731433
94 0.09369532 0.79796119
95 2.08422207 0.09369532
96 5.69811509 2.08422207
97 4.14487121 5.69811509
98 1.49717180 4.14487121
99 3.04771125 1.49717180
100 0.52756180 3.04771125
101 -1.28746471 0.52756180
102 -1.46452120 -1.28746471
103 -1.64253715 -1.46452120
104 0.78284977 -1.64253715
105 4.02554006 0.78284977
106 4.34705289 4.02554006
107 4.45442557 4.34705289
108 -0.35954108 4.45442557
109 -2.69354759 -0.35954108
110 -1.69439655 -2.69354759
111 9.59012539 -1.69439655
112 0.68936532 9.59012539
113 -3.28363505 0.68936532
114 -12.00444777 -3.28363505
115 -2.06122762 -12.00444777
116 -2.29668984 -2.06122762
117 -2.62694765 -2.29668984
118 0.26800201 -2.62694765
119 4.36304876 0.26800201
120 7.12406560 4.36304876
121 -5.17787092 7.12406560
122 -5.09809592 -5.17787092
123 -0.90193978 -5.09809592
124 -6.68137516 -0.90193978
125 -2.19195456 -6.68137516
126 -2.76081421 -2.19195456
127 -2.12589942 -2.76081421
128 -2.55279354 -2.12589942
129 7.21115202 -2.55279354
130 -2.01469882 7.21115202
131 -0.74352439 -2.01469882
132 -2.40368237 -0.74352439
133 0.61838909 -2.40368237
134 3.63623042 0.61838909
135 -1.92144378 3.63623042
136 -3.41472837 -1.92144378
137 -5.27646376 -3.41472837
138 -1.70786189 -5.27646376
139 -2.97609150 -1.70786189
140 5.04775754 -2.97609150
141 2.37797049 5.04775754
142 -6.02885325 2.37797049
143 -1.37333724 -6.02885325
144 -4.71860608 -1.37333724
145 1.22393739 -4.71860608
146 7.43242799 1.22393739
147 0.66182105 7.43242799
148 1.57288679 0.66182105
149 2.71114030 1.57288679
150 -0.76672826 2.71114030
151 0.27990013 -0.76672826
152 10.91886784 0.27990013
153 2.40932845 10.91886784
154 -6.05669741 2.40932845
155 -1.44853041 -6.05669741
156 3.09442339 -1.44853041
157 -2.53967419 3.09442339
158 4.54813171 -2.53967419
> 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/70yug1290179369.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/80yug1290179369.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/9apb11290179369.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/10apb11290179369.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/11e8a71290179369.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/12z98d1290179369.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/1369no1290179369.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/14zjmr1290179369.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/15kjlx1290179369.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/16gt1o1290179369.tab")
+ }
>
> try(system("convert tmp/1m6e71290179369.ps tmp/1m6e71290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wyvs1290179369.ps tmp/2wyvs1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wyvs1290179369.ps tmp/3wyvs1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wyvs1290179369.ps tmp/4wyvs1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wyvs1290179369.ps tmp/5wyvs1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ppvd1290179369.ps tmp/6ppvd1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/70yug1290179369.ps tmp/70yug1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/80yug1290179369.ps tmp/80yug1290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/9apb11290179369.ps tmp/9apb11290179369.png",intern=TRUE))
character(0)
> try(system("convert tmp/10apb11290179369.ps tmp/10apb11290179369.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.972 2.798 51.315