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(9
+ ,26
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,9
+ ,23
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,9
+ ,25
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,9
+ ,23
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,9
+ ,19
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,9
+ ,29
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,10
+ ,25
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,10
+ ,21
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,10
+ ,22
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,10
+ ,25
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,10
+ ,24
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,10
+ ,18
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,10
+ ,22
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,10
+ ,15
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,10
+ ,22
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,10
+ ,28
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,10
+ ,20
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,10
+ ,12
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,10
+ ,24
+ ,20
+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 'Do not include Seasonal Dummies'
> par1 = '4'
> #'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
D M O CM PE PC PS t
1 14 9 26 24 11 12 24 1
2 11 9 23 25 7 8 25 2
3 6 9 25 17 17 8 30 3
4 12 9 23 18 10 8 19 4
5 8 9 19 18 12 9 22 5
6 10 9 29 16 12 7 22 6
7 10 10 25 20 11 4 25 7
8 11 10 21 16 11 11 23 8
9 16 10 22 18 12 7 17 9
10 11 10 25 17 13 7 21 10
11 13 10 24 23 14 12 19 11
12 12 10 18 30 16 10 19 12
13 8 10 22 23 11 10 15 13
14 12 10 15 18 10 8 16 14
15 11 10 22 15 11 8 23 15
16 4 10 28 12 15 4 27 16
17 9 10 20 21 9 9 22 17
18 8 10 12 15 11 8 14 18
19 8 10 24 20 17 7 22 19
20 14 10 20 31 17 11 23 20
21 15 10 21 27 11 9 23 21
22 16 10 20 34 18 11 21 22
23 9 10 21 21 14 13 19 23
24 14 10 23 31 10 8 18 24
25 11 10 28 19 11 8 20 25
26 8 10 24 16 15 9 23 26
27 9 10 24 20 15 6 25 27
28 9 10 24 21 13 9 19 28
29 9 10 23 22 16 9 24 29
30 9 10 23 17 13 6 22 30
31 10 10 29 24 9 6 25 31
32 16 10 24 25 18 16 26 32
33 11 10 18 26 18 5 29 33
34 8 10 25 25 12 7 32 34
35 9 10 21 17 17 9 25 35
36 16 10 26 32 9 6 29 36
37 11 10 22 33 9 6 28 37
38 16 10 22 13 12 5 17 38
39 12 10 22 32 18 12 28 39
40 12 10 23 25 12 7 29 40
41 14 10 30 29 18 10 26 41
42 9 10 23 22 14 9 25 42
43 10 10 17 18 15 8 14 43
44 9 10 23 17 16 5 25 44
45 10 10 23 20 10 8 26 45
46 12 10 25 15 11 8 20 46
47 14 10 24 20 14 10 18 47
48 14 10 24 33 9 6 32 48
49 10 10 23 29 12 8 25 49
50 14 10 21 23 17 7 25 50
51 16 10 24 26 5 4 23 51
52 9 10 24 18 12 8 21 52
53 10 10 28 20 12 8 20 53
54 6 10 16 11 6 4 15 54
55 8 10 20 28 24 20 30 55
56 13 10 29 26 12 8 24 56
57 10 10 27 22 12 8 26 57
58 8 10 22 17 14 6 24 58
59 7 10 28 12 7 4 22 59
60 15 10 16 14 13 8 14 60
61 9 10 25 17 12 9 24 61
62 10 10 24 21 13 6 24 62
63 12 10 28 19 14 7 24 63
64 13 10 24 18 8 9 24 64
65 10 10 23 10 11 5 19 65
66 11 10 30 29 9 5 31 66
67 8 10 24 31 11 8 22 67
68 9 10 21 19 13 8 27 68
69 13 10 25 9 10 6 19 69
70 11 10 25 20 11 8 25 70
71 8 10 22 28 12 7 20 71
72 9 10 23 19 9 7 21 72
73 9 10 26 30 15 9 27 73
74 15 10 23 29 18 11 23 74
75 9 10 25 26 15 6 25 75
76 10 10 21 23 12 8 20 76
77 14 10 25 13 13 6 21 77
78 12 10 24 21 14 9 22 78
79 12 10 29 19 10 8 23 79
80 11 10 22 28 13 6 25 80
81 14 10 27 23 13 10 25 81
82 6 10 26 18 11 8 17 82
83 12 10 22 21 13 8 19 83
84 8 10 24 20 16 10 25 84
85 14 10 27 23 8 5 19 85
86 11 10 24 21 16 7 20 86
87 10 10 24 21 11 5 26 87
88 14 10 29 15 9 8 23 88
89 12 10 22 28 16 14 27 89
90 10 10 21 19 12 7 17 90
91 14 10 24 26 14 8 17 91
92 5 10 24 10 8 6 19 92
93 11 10 23 16 9 5 17 93
94 10 10 20 22 15 6 22 94
95 9 10 27 19 11 10 21 95
96 10 10 26 31 21 12 32 96
97 16 10 25 31 14 9 21 97
98 13 10 21 29 18 12 21 98
99 9 10 21 19 12 7 18 99
100 10 10 19 22 13 8 18 100
101 10 10 21 23 15 10 23 101
102 7 10 21 15 12 6 19 102
103 9 10 16 20 19 10 20 103
104 8 10 22 18 15 10 21 104
105 14 10 29 23 11 10 20 105
106 14 10 15 25 11 5 17 106
107 8 10 17 21 10 7 18 107
108 9 10 15 24 13 10 19 108
109 14 10 21 25 15 11 22 109
110 14 10 21 17 12 6 15 110
111 8 10 19 13 12 7 14 111
112 8 10 24 28 16 12 18 112
113 8 10 20 21 9 11 24 113
114 7 10 17 25 18 11 35 114
115 6 10 23 9 8 11 29 115
116 8 10 24 16 13 5 21 116
117 6 10 14 19 17 8 25 117
118 11 10 19 17 9 6 20 118
119 14 10 24 25 15 9 22 119
120 11 10 13 20 8 4 13 120
121 11 10 22 29 7 4 26 121
122 11 10 16 14 12 7 17 122
123 14 10 19 22 14 11 25 123
124 8 10 25 15 6 6 20 124
125 20 10 25 19 8 7 19 125
126 11 10 23 20 17 8 21 126
127 8 10 24 15 10 4 22 127
128 11 10 26 20 11 8 24 128
129 10 10 26 18 14 9 21 129
130 14 10 25 33 11 8 26 130
131 11 10 18 22 13 11 24 131
132 9 10 21 16 12 8 16 132
133 9 10 26 17 11 5 23 133
134 8 10 23 16 9 4 18 134
135 10 10 23 21 12 8 16 135
136 13 10 22 26 20 10 26 136
137 13 10 20 18 12 6 19 137
138 12 10 13 18 13 9 21 138
139 8 10 24 17 12 9 21 139
140 13 10 15 22 12 13 22 140
141 14 10 14 30 9 9 23 141
142 12 10 22 30 15 10 29 142
143 14 10 10 24 24 20 21 143
144 15 10 24 21 7 5 21 144
145 13 10 22 21 17 11 23 145
146 16 10 24 29 11 6 27 146
147 9 10 19 31 17 9 25 147
148 9 10 20 20 11 7 21 148
149 9 10 13 16 12 9 10 149
150 8 10 20 22 14 10 20 150
151 7 10 22 20 11 9 26 151
152 16 10 24 28 16 8 24 152
153 11 10 29 38 21 7 29 153
154 9 10 12 22 14 6 19 154
155 11 10 20 20 20 13 24 155
156 9 10 21 17 13 6 19 156
157 14 10 24 28 11 8 24 157
158 13 10 22 22 15 10 22 158
159 16 10 20 31 19 16 17 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M O CM PE PC
4.0984846 0.3226781 0.1133295 0.2468958 -0.1092443 0.1515472
PS t
-0.1897569 0.0009941
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.7246 -1.7244 -0.2130 1.6843 8.4447
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.0984846 11.1416904 0.368 0.71350
M 0.3226781 1.1151524 0.289 0.77270
O 0.1133295 0.0580930 1.951 0.05293 .
CM 0.2468958 0.0405380 6.090 8.93e-09 ***
PE -0.1092443 0.0749021 -1.458 0.14678
PC 0.1515472 0.0941785 1.609 0.10967
PS -0.1897569 0.0573959 -3.306 0.00118 **
t 0.0009941 0.0046932 0.212 0.83253
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.497 on 151 degrees of freedom
Multiple R-squared: 0.2405, Adjusted R-squared: 0.2053
F-statistic: 6.83 on 7 and 151 DF, p-value: 4.752e-07
> 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.08580382 0.17160763 0.9141962
[2,] 0.03113883 0.06227767 0.9688612
[3,] 0.30462570 0.60925139 0.6953743
[4,] 0.49232974 0.98465948 0.5076703
[5,] 0.65261475 0.69477051 0.3473853
[6,] 0.58138324 0.83723352 0.4186168
[7,] 0.48860591 0.97721182 0.5113941
[8,] 0.41543369 0.83086739 0.5845663
[9,] 0.38167334 0.76334669 0.6183267
[10,] 0.56914655 0.86170691 0.4308535
[11,] 0.65537920 0.68924159 0.3446208
[12,] 0.64084594 0.71830812 0.3591541
[13,] 0.60841978 0.78316044 0.3915802
[14,] 0.53484064 0.93031872 0.4651594
[15,] 0.46975214 0.93950428 0.5302479
[16,] 0.40308146 0.80616292 0.5969185
[17,] 0.34219519 0.68439038 0.6578048
[18,] 0.29974719 0.59949438 0.7002528
[19,] 0.24487082 0.48974165 0.7551292
[20,] 0.20791082 0.41582164 0.7920892
[21,] 0.17036143 0.34072286 0.8296386
[22,] 0.28306725 0.56613449 0.7169328
[23,] 0.27031664 0.54063327 0.7296834
[24,] 0.25714934 0.51429869 0.7428507
[25,] 0.21676523 0.43353046 0.7832348
[26,] 0.25198665 0.50397329 0.7480134
[27,] 0.23792955 0.47585911 0.7620704
[28,] 0.65044165 0.69911670 0.3495583
[29,] 0.60170840 0.79658320 0.3982916
[30,] 0.56110032 0.87779936 0.4388997
[31,] 0.51521617 0.96956766 0.4847838
[32,] 0.49239698 0.98479397 0.5076030
[33,] 0.45030692 0.90061384 0.5496931
[34,] 0.39760738 0.79521475 0.6023926
[35,] 0.34631922 0.69263845 0.6536808
[36,] 0.31707973 0.63415947 0.6829203
[37,] 0.29598153 0.59196305 0.7040185
[38,] 0.26811709 0.53623418 0.7318829
[39,] 0.28259204 0.56518407 0.7174080
[40,] 0.33677590 0.67355179 0.6632241
[41,] 0.37079277 0.74158554 0.6292072
[42,] 0.36110471 0.72220942 0.6388953
[43,] 0.34741281 0.69482563 0.6525872
[44,] 0.37523922 0.75047845 0.6247608
[45,] 0.39433616 0.78867232 0.6056638
[46,] 0.34904108 0.69808216 0.6509589
[47,] 0.30847498 0.61694996 0.6915250
[48,] 0.26983920 0.53967840 0.7301608
[49,] 0.25360709 0.50721419 0.7463929
[50,] 0.40250649 0.80501297 0.5974935
[51,] 0.35846444 0.71692887 0.6415356
[52,] 0.31587345 0.63174689 0.6841266
[53,] 0.29385977 0.58771954 0.7061402
[54,] 0.30298233 0.60596466 0.6970177
[55,] 0.27719467 0.55438934 0.7228053
[56,] 0.24518360 0.49036720 0.7548164
[57,] 0.42881131 0.85762262 0.5711887
[58,] 0.38274528 0.76549056 0.6172547
[59,] 0.47990336 0.95980671 0.5200966
[60,] 0.43747822 0.87495644 0.5625218
[61,] 0.55059668 0.89880664 0.4494033
[62,] 0.52211393 0.95577215 0.4778861
[63,] 0.54206998 0.91586005 0.4579300
[64,] 0.55364336 0.89271327 0.4463566
[65,] 0.53276212 0.93447576 0.4672379
[66,] 0.49779206 0.99558412 0.5022079
[67,] 0.66349795 0.67300411 0.3365021
[68,] 0.63251032 0.73497936 0.3674897
[69,] 0.59607959 0.80784083 0.4039204
[70,] 0.55005656 0.89988689 0.4499434
[71,] 0.55992594 0.88014812 0.4400741
[72,] 0.71160707 0.57678585 0.2883929
[73,] 0.67793224 0.64413552 0.3220678
[74,] 0.65343547 0.69312906 0.3465645
[75,] 0.63092699 0.73814601 0.3690730
[76,] 0.58988048 0.82023903 0.4101195
[77,] 0.54633799 0.90732402 0.4536620
[78,] 0.63273325 0.73453349 0.3672667
[79,] 0.58744814 0.82510372 0.4125519
[80,] 0.54396854 0.91206292 0.4560315
[81,] 0.51125764 0.97748472 0.4887424
[82,] 0.55448516 0.89102968 0.4455148
[83,] 0.51722296 0.96555409 0.4827770
[84,] 0.47265371 0.94530742 0.5273463
[85,] 0.45451350 0.90902699 0.5454865
[86,] 0.41243576 0.82487151 0.5875642
[87,] 0.41372041 0.82744082 0.5862796
[88,] 0.36989172 0.73978344 0.6301083
[89,] 0.33560735 0.67121471 0.6643926
[90,] 0.29657800 0.59315600 0.7034220
[91,] 0.25645365 0.51290730 0.7435464
[92,] 0.23755610 0.47511221 0.7624439
[93,] 0.20094300 0.40188600 0.7990570
[94,] 0.18159548 0.36319096 0.8184045
[95,] 0.15870755 0.31741510 0.8412924
[96,] 0.16704678 0.33409355 0.8329532
[97,] 0.16638040 0.33276079 0.8336196
[98,] 0.15884760 0.31769520 0.8411524
[99,] 0.15639908 0.31279815 0.8436009
[100,] 0.19963046 0.39926092 0.8003695
[101,] 0.17152191 0.34304383 0.8284781
[102,] 0.34576432 0.69152864 0.6542357
[103,] 0.40546546 0.81093092 0.5945345
[104,] 0.37433018 0.74866036 0.6256698
[105,] 0.36788874 0.73577748 0.6321113
[106,] 0.32724697 0.65449394 0.6727530
[107,] 0.32900867 0.65801735 0.6709913
[108,] 0.28787760 0.57575519 0.7121224
[109,] 0.26028310 0.52056619 0.7397169
[110,] 0.21701266 0.43402532 0.7829873
[111,] 0.20310068 0.40620137 0.7968993
[112,] 0.18124098 0.36248195 0.8187590
[113,] 0.18509044 0.37018089 0.8149096
[114,] 0.20020907 0.40041814 0.7997909
[115,] 0.72394749 0.55210503 0.2760525
[116,] 0.68092969 0.63814062 0.3190703
[117,] 0.62527507 0.74944986 0.3747249
[118,] 0.56234801 0.87530398 0.4376520
[119,] 0.49771660 0.99543320 0.5022834
[120,] 0.43431999 0.86863998 0.5656800
[121,] 0.37913411 0.75826823 0.6208659
[122,] 0.32686024 0.65372047 0.6731398
[123,] 0.26952094 0.53904188 0.7304791
[124,] 0.23864371 0.47728743 0.7613563
[125,] 0.23882935 0.47765870 0.7611706
[126,] 0.19788762 0.39577524 0.8021124
[127,] 0.20397183 0.40794366 0.7960282
[128,] 0.20833590 0.41667180 0.7916641
[129,] 0.23203763 0.46407526 0.7679624
[130,] 0.17717986 0.35435973 0.8228201
[131,] 0.12992500 0.25985000 0.8700750
[132,] 0.09495521 0.18991042 0.9050448
[133,] 0.09669682 0.19339364 0.9033032
[134,] 0.08692161 0.17384321 0.9130784
[135,] 0.09598637 0.19197275 0.9040136
[136,] 0.30586783 0.61173565 0.6941322
[137,] 0.20299821 0.40599641 0.7970018
[138,] 0.12298064 0.24596127 0.8770194
> postscript(file="/var/www/html/freestat/rcomp/tmp/1y2fb1290172895.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/2rtfw1290172895.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/3rtfw1290172895.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/4rtfw1290172895.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/512wh1290172895.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
2.06163906 -0.48729388 -1.69855357 1.42817992 -1.48328419 0.17931265
7 8 9 10 11 12
0.23604321 1.23560623 5.20438276 0.97856774 0.58152309 -0.94618160
13 14 15 16 17 18
-4.97747214 1.43292607 1.81685526 -3.32123516 -1.99964126 -1.76064402
19 20 21 22 23 24
-2.03100311 1.28903536 2.80992355 2.27609031 -2.74817337 -0.31378239
25 26 27 28 29 30
-0.42991658 -1.38220480 -0.53662675 -2.59618799 -1.45423116 -0.47335144
31 32 33 34 35 36
-1.75029946 4.22594176 1.89431840 -2.04237578 0.29994323 3.36857974
37 38 39 40 41 42
-1.61574904 6.71312680 -0.29692603 1.60904791 1.45871771 -1.49588628
43 44 45 46 47 48
-0.65585451 0.56128165 -0.10075011 1.87677869 2.39975990 1.90568426
49 50 51 52 53 54
-2.29805690 4.10675123 3.78927771 -1.45754266 -1.59540320 -3.01244270
55 56 57 58 59 60
-3.27598766 0.56593781 -0.84130043 -0.89909901 -2.18672055 5.20966967
61 62 63 64 65 66
-0.91519992 -0.22656185 1.77061472 2.51127435 1.58391312 -0.84281330
67 68 69 70 71 72
-5.60158687 -0.13257018 4.33938201 0.56722552 -4.75693929 -1.78717683
73 74 75 76 77 78
-3.35310042 2.49840071 -2.17904826 -1.56564862 5.05109260 1.03262137
79 80 81 82 83 84
0.86309828 -0.55631044 2.50433817 -5.58229678 0.72734207 -2.09023550
85 86 87 88 89 90
1.57333494 0.16673763 0.06115775 3.73249013 -0.07038824 -1.00970651
91 92 93 94 95 96
0.98798181 -4.03553738 0.47670102 -0.21297640 -2.49951233 -1.47325221
97 98 99 100 101 102
2.24168908 0.17014011 -1.82889663 -1.38622199 -0.99659227 -2.50299179
103 104 105 106 107 108
-0.82353920 -2.25793896 1.08654757 2.36684007 -3.09581166 -2.54798593
109 110 111 112 113 114
2.16035922 3.23623624 -1.89181981 -5.72462935 -3.01865651 -1.59672109
115 116 117 118 119 120
-1.55834375 -1.46348841 -2.33051179 1.07599391 2.11352398 -0.12115276
121 122 123 124 125 126
-1.00657922 1.75960831 3.57381436 -2.44388901 8.44471826 0.63465245
127 128 129 130 131 132
-1.21395663 0.20648070 -0.69380682 0.48769059 0.38018981 -1.65207589
133 134 135 136 137 138
-0.79291786 -2.22275348 -2.11619612 2.23008903 2.83485648 2.66128535
139 140 141 142 143 144
-2.44868172 1.91937891 1.52476080 0.25959049 3.04959674 3.61873191
145 146 147 148 149 150
2.40707029 4.06554866 -3.04127914 -1.55114800 -2.05242826 -3.36359335
151 152 153 154 155 156
-3.13509928 3.98033618 -2.40971025 -1.04450201 1.08507931 -0.94122107
157 158 159
1.42914423 1.89055280 1.47306533
> postscript(file="/var/www/html/freestat/rcomp/tmp/612wh1290172895.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 2.06163906 NA
1 -0.48729388 2.06163906
2 -1.69855357 -0.48729388
3 1.42817992 -1.69855357
4 -1.48328419 1.42817992
5 0.17931265 -1.48328419
6 0.23604321 0.17931265
7 1.23560623 0.23604321
8 5.20438276 1.23560623
9 0.97856774 5.20438276
10 0.58152309 0.97856774
11 -0.94618160 0.58152309
12 -4.97747214 -0.94618160
13 1.43292607 -4.97747214
14 1.81685526 1.43292607
15 -3.32123516 1.81685526
16 -1.99964126 -3.32123516
17 -1.76064402 -1.99964126
18 -2.03100311 -1.76064402
19 1.28903536 -2.03100311
20 2.80992355 1.28903536
21 2.27609031 2.80992355
22 -2.74817337 2.27609031
23 -0.31378239 -2.74817337
24 -0.42991658 -0.31378239
25 -1.38220480 -0.42991658
26 -0.53662675 -1.38220480
27 -2.59618799 -0.53662675
28 -1.45423116 -2.59618799
29 -0.47335144 -1.45423116
30 -1.75029946 -0.47335144
31 4.22594176 -1.75029946
32 1.89431840 4.22594176
33 -2.04237578 1.89431840
34 0.29994323 -2.04237578
35 3.36857974 0.29994323
36 -1.61574904 3.36857974
37 6.71312680 -1.61574904
38 -0.29692603 6.71312680
39 1.60904791 -0.29692603
40 1.45871771 1.60904791
41 -1.49588628 1.45871771
42 -0.65585451 -1.49588628
43 0.56128165 -0.65585451
44 -0.10075011 0.56128165
45 1.87677869 -0.10075011
46 2.39975990 1.87677869
47 1.90568426 2.39975990
48 -2.29805690 1.90568426
49 4.10675123 -2.29805690
50 3.78927771 4.10675123
51 -1.45754266 3.78927771
52 -1.59540320 -1.45754266
53 -3.01244270 -1.59540320
54 -3.27598766 -3.01244270
55 0.56593781 -3.27598766
56 -0.84130043 0.56593781
57 -0.89909901 -0.84130043
58 -2.18672055 -0.89909901
59 5.20966967 -2.18672055
60 -0.91519992 5.20966967
61 -0.22656185 -0.91519992
62 1.77061472 -0.22656185
63 2.51127435 1.77061472
64 1.58391312 2.51127435
65 -0.84281330 1.58391312
66 -5.60158687 -0.84281330
67 -0.13257018 -5.60158687
68 4.33938201 -0.13257018
69 0.56722552 4.33938201
70 -4.75693929 0.56722552
71 -1.78717683 -4.75693929
72 -3.35310042 -1.78717683
73 2.49840071 -3.35310042
74 -2.17904826 2.49840071
75 -1.56564862 -2.17904826
76 5.05109260 -1.56564862
77 1.03262137 5.05109260
78 0.86309828 1.03262137
79 -0.55631044 0.86309828
80 2.50433817 -0.55631044
81 -5.58229678 2.50433817
82 0.72734207 -5.58229678
83 -2.09023550 0.72734207
84 1.57333494 -2.09023550
85 0.16673763 1.57333494
86 0.06115775 0.16673763
87 3.73249013 0.06115775
88 -0.07038824 3.73249013
89 -1.00970651 -0.07038824
90 0.98798181 -1.00970651
91 -4.03553738 0.98798181
92 0.47670102 -4.03553738
93 -0.21297640 0.47670102
94 -2.49951233 -0.21297640
95 -1.47325221 -2.49951233
96 2.24168908 -1.47325221
97 0.17014011 2.24168908
98 -1.82889663 0.17014011
99 -1.38622199 -1.82889663
100 -0.99659227 -1.38622199
101 -2.50299179 -0.99659227
102 -0.82353920 -2.50299179
103 -2.25793896 -0.82353920
104 1.08654757 -2.25793896
105 2.36684007 1.08654757
106 -3.09581166 2.36684007
107 -2.54798593 -3.09581166
108 2.16035922 -2.54798593
109 3.23623624 2.16035922
110 -1.89181981 3.23623624
111 -5.72462935 -1.89181981
112 -3.01865651 -5.72462935
113 -1.59672109 -3.01865651
114 -1.55834375 -1.59672109
115 -1.46348841 -1.55834375
116 -2.33051179 -1.46348841
117 1.07599391 -2.33051179
118 2.11352398 1.07599391
119 -0.12115276 2.11352398
120 -1.00657922 -0.12115276
121 1.75960831 -1.00657922
122 3.57381436 1.75960831
123 -2.44388901 3.57381436
124 8.44471826 -2.44388901
125 0.63465245 8.44471826
126 -1.21395663 0.63465245
127 0.20648070 -1.21395663
128 -0.69380682 0.20648070
129 0.48769059 -0.69380682
130 0.38018981 0.48769059
131 -1.65207589 0.38018981
132 -0.79291786 -1.65207589
133 -2.22275348 -0.79291786
134 -2.11619612 -2.22275348
135 2.23008903 -2.11619612
136 2.83485648 2.23008903
137 2.66128535 2.83485648
138 -2.44868172 2.66128535
139 1.91937891 -2.44868172
140 1.52476080 1.91937891
141 0.25959049 1.52476080
142 3.04959674 0.25959049
143 3.61873191 3.04959674
144 2.40707029 3.61873191
145 4.06554866 2.40707029
146 -3.04127914 4.06554866
147 -1.55114800 -3.04127914
148 -2.05242826 -1.55114800
149 -3.36359335 -2.05242826
150 -3.13509928 -3.36359335
151 3.98033618 -3.13509928
152 -2.40971025 3.98033618
153 -1.04450201 -2.40971025
154 1.08507931 -1.04450201
155 -0.94122107 1.08507931
156 1.42914423 -0.94122107
157 1.89055280 1.42914423
158 1.47306533 1.89055280
159 NA 1.47306533
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.48729388 2.06163906
[2,] -1.69855357 -0.48729388
[3,] 1.42817992 -1.69855357
[4,] -1.48328419 1.42817992
[5,] 0.17931265 -1.48328419
[6,] 0.23604321 0.17931265
[7,] 1.23560623 0.23604321
[8,] 5.20438276 1.23560623
[9,] 0.97856774 5.20438276
[10,] 0.58152309 0.97856774
[11,] -0.94618160 0.58152309
[12,] -4.97747214 -0.94618160
[13,] 1.43292607 -4.97747214
[14,] 1.81685526 1.43292607
[15,] -3.32123516 1.81685526
[16,] -1.99964126 -3.32123516
[17,] -1.76064402 -1.99964126
[18,] -2.03100311 -1.76064402
[19,] 1.28903536 -2.03100311
[20,] 2.80992355 1.28903536
[21,] 2.27609031 2.80992355
[22,] -2.74817337 2.27609031
[23,] -0.31378239 -2.74817337
[24,] -0.42991658 -0.31378239
[25,] -1.38220480 -0.42991658
[26,] -0.53662675 -1.38220480
[27,] -2.59618799 -0.53662675
[28,] -1.45423116 -2.59618799
[29,] -0.47335144 -1.45423116
[30,] -1.75029946 -0.47335144
[31,] 4.22594176 -1.75029946
[32,] 1.89431840 4.22594176
[33,] -2.04237578 1.89431840
[34,] 0.29994323 -2.04237578
[35,] 3.36857974 0.29994323
[36,] -1.61574904 3.36857974
[37,] 6.71312680 -1.61574904
[38,] -0.29692603 6.71312680
[39,] 1.60904791 -0.29692603
[40,] 1.45871771 1.60904791
[41,] -1.49588628 1.45871771
[42,] -0.65585451 -1.49588628
[43,] 0.56128165 -0.65585451
[44,] -0.10075011 0.56128165
[45,] 1.87677869 -0.10075011
[46,] 2.39975990 1.87677869
[47,] 1.90568426 2.39975990
[48,] -2.29805690 1.90568426
[49,] 4.10675123 -2.29805690
[50,] 3.78927771 4.10675123
[51,] -1.45754266 3.78927771
[52,] -1.59540320 -1.45754266
[53,] -3.01244270 -1.59540320
[54,] -3.27598766 -3.01244270
[55,] 0.56593781 -3.27598766
[56,] -0.84130043 0.56593781
[57,] -0.89909901 -0.84130043
[58,] -2.18672055 -0.89909901
[59,] 5.20966967 -2.18672055
[60,] -0.91519992 5.20966967
[61,] -0.22656185 -0.91519992
[62,] 1.77061472 -0.22656185
[63,] 2.51127435 1.77061472
[64,] 1.58391312 2.51127435
[65,] -0.84281330 1.58391312
[66,] -5.60158687 -0.84281330
[67,] -0.13257018 -5.60158687
[68,] 4.33938201 -0.13257018
[69,] 0.56722552 4.33938201
[70,] -4.75693929 0.56722552
[71,] -1.78717683 -4.75693929
[72,] -3.35310042 -1.78717683
[73,] 2.49840071 -3.35310042
[74,] -2.17904826 2.49840071
[75,] -1.56564862 -2.17904826
[76,] 5.05109260 -1.56564862
[77,] 1.03262137 5.05109260
[78,] 0.86309828 1.03262137
[79,] -0.55631044 0.86309828
[80,] 2.50433817 -0.55631044
[81,] -5.58229678 2.50433817
[82,] 0.72734207 -5.58229678
[83,] -2.09023550 0.72734207
[84,] 1.57333494 -2.09023550
[85,] 0.16673763 1.57333494
[86,] 0.06115775 0.16673763
[87,] 3.73249013 0.06115775
[88,] -0.07038824 3.73249013
[89,] -1.00970651 -0.07038824
[90,] 0.98798181 -1.00970651
[91,] -4.03553738 0.98798181
[92,] 0.47670102 -4.03553738
[93,] -0.21297640 0.47670102
[94,] -2.49951233 -0.21297640
[95,] -1.47325221 -2.49951233
[96,] 2.24168908 -1.47325221
[97,] 0.17014011 2.24168908
[98,] -1.82889663 0.17014011
[99,] -1.38622199 -1.82889663
[100,] -0.99659227 -1.38622199
[101,] -2.50299179 -0.99659227
[102,] -0.82353920 -2.50299179
[103,] -2.25793896 -0.82353920
[104,] 1.08654757 -2.25793896
[105,] 2.36684007 1.08654757
[106,] -3.09581166 2.36684007
[107,] -2.54798593 -3.09581166
[108,] 2.16035922 -2.54798593
[109,] 3.23623624 2.16035922
[110,] -1.89181981 3.23623624
[111,] -5.72462935 -1.89181981
[112,] -3.01865651 -5.72462935
[113,] -1.59672109 -3.01865651
[114,] -1.55834375 -1.59672109
[115,] -1.46348841 -1.55834375
[116,] -2.33051179 -1.46348841
[117,] 1.07599391 -2.33051179
[118,] 2.11352398 1.07599391
[119,] -0.12115276 2.11352398
[120,] -1.00657922 -0.12115276
[121,] 1.75960831 -1.00657922
[122,] 3.57381436 1.75960831
[123,] -2.44388901 3.57381436
[124,] 8.44471826 -2.44388901
[125,] 0.63465245 8.44471826
[126,] -1.21395663 0.63465245
[127,] 0.20648070 -1.21395663
[128,] -0.69380682 0.20648070
[129,] 0.48769059 -0.69380682
[130,] 0.38018981 0.48769059
[131,] -1.65207589 0.38018981
[132,] -0.79291786 -1.65207589
[133,] -2.22275348 -0.79291786
[134,] -2.11619612 -2.22275348
[135,] 2.23008903 -2.11619612
[136,] 2.83485648 2.23008903
[137,] 2.66128535 2.83485648
[138,] -2.44868172 2.66128535
[139,] 1.91937891 -2.44868172
[140,] 1.52476080 1.91937891
[141,] 0.25959049 1.52476080
[142,] 3.04959674 0.25959049
[143,] 3.61873191 3.04959674
[144,] 2.40707029 3.61873191
[145,] 4.06554866 2.40707029
[146,] -3.04127914 4.06554866
[147,] -1.55114800 -3.04127914
[148,] -2.05242826 -1.55114800
[149,] -3.36359335 -2.05242826
[150,] -3.13509928 -3.36359335
[151,] 3.98033618 -3.13509928
[152,] -2.40971025 3.98033618
[153,] -1.04450201 -2.40971025
[154,] 1.08507931 -1.04450201
[155,] -0.94122107 1.08507931
[156,] 1.42914423 -0.94122107
[157,] 1.89055280 1.42914423
[158,] 1.47306533 1.89055280
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.48729388 2.06163906
2 -1.69855357 -0.48729388
3 1.42817992 -1.69855357
4 -1.48328419 1.42817992
5 0.17931265 -1.48328419
6 0.23604321 0.17931265
7 1.23560623 0.23604321
8 5.20438276 1.23560623
9 0.97856774 5.20438276
10 0.58152309 0.97856774
11 -0.94618160 0.58152309
12 -4.97747214 -0.94618160
13 1.43292607 -4.97747214
14 1.81685526 1.43292607
15 -3.32123516 1.81685526
16 -1.99964126 -3.32123516
17 -1.76064402 -1.99964126
18 -2.03100311 -1.76064402
19 1.28903536 -2.03100311
20 2.80992355 1.28903536
21 2.27609031 2.80992355
22 -2.74817337 2.27609031
23 -0.31378239 -2.74817337
24 -0.42991658 -0.31378239
25 -1.38220480 -0.42991658
26 -0.53662675 -1.38220480
27 -2.59618799 -0.53662675
28 -1.45423116 -2.59618799
29 -0.47335144 -1.45423116
30 -1.75029946 -0.47335144
31 4.22594176 -1.75029946
32 1.89431840 4.22594176
33 -2.04237578 1.89431840
34 0.29994323 -2.04237578
35 3.36857974 0.29994323
36 -1.61574904 3.36857974
37 6.71312680 -1.61574904
38 -0.29692603 6.71312680
39 1.60904791 -0.29692603
40 1.45871771 1.60904791
41 -1.49588628 1.45871771
42 -0.65585451 -1.49588628
43 0.56128165 -0.65585451
44 -0.10075011 0.56128165
45 1.87677869 -0.10075011
46 2.39975990 1.87677869
47 1.90568426 2.39975990
48 -2.29805690 1.90568426
49 4.10675123 -2.29805690
50 3.78927771 4.10675123
51 -1.45754266 3.78927771
52 -1.59540320 -1.45754266
53 -3.01244270 -1.59540320
54 -3.27598766 -3.01244270
55 0.56593781 -3.27598766
56 -0.84130043 0.56593781
57 -0.89909901 -0.84130043
58 -2.18672055 -0.89909901
59 5.20966967 -2.18672055
60 -0.91519992 5.20966967
61 -0.22656185 -0.91519992
62 1.77061472 -0.22656185
63 2.51127435 1.77061472
64 1.58391312 2.51127435
65 -0.84281330 1.58391312
66 -5.60158687 -0.84281330
67 -0.13257018 -5.60158687
68 4.33938201 -0.13257018
69 0.56722552 4.33938201
70 -4.75693929 0.56722552
71 -1.78717683 -4.75693929
72 -3.35310042 -1.78717683
73 2.49840071 -3.35310042
74 -2.17904826 2.49840071
75 -1.56564862 -2.17904826
76 5.05109260 -1.56564862
77 1.03262137 5.05109260
78 0.86309828 1.03262137
79 -0.55631044 0.86309828
80 2.50433817 -0.55631044
81 -5.58229678 2.50433817
82 0.72734207 -5.58229678
83 -2.09023550 0.72734207
84 1.57333494 -2.09023550
85 0.16673763 1.57333494
86 0.06115775 0.16673763
87 3.73249013 0.06115775
88 -0.07038824 3.73249013
89 -1.00970651 -0.07038824
90 0.98798181 -1.00970651
91 -4.03553738 0.98798181
92 0.47670102 -4.03553738
93 -0.21297640 0.47670102
94 -2.49951233 -0.21297640
95 -1.47325221 -2.49951233
96 2.24168908 -1.47325221
97 0.17014011 2.24168908
98 -1.82889663 0.17014011
99 -1.38622199 -1.82889663
100 -0.99659227 -1.38622199
101 -2.50299179 -0.99659227
102 -0.82353920 -2.50299179
103 -2.25793896 -0.82353920
104 1.08654757 -2.25793896
105 2.36684007 1.08654757
106 -3.09581166 2.36684007
107 -2.54798593 -3.09581166
108 2.16035922 -2.54798593
109 3.23623624 2.16035922
110 -1.89181981 3.23623624
111 -5.72462935 -1.89181981
112 -3.01865651 -5.72462935
113 -1.59672109 -3.01865651
114 -1.55834375 -1.59672109
115 -1.46348841 -1.55834375
116 -2.33051179 -1.46348841
117 1.07599391 -2.33051179
118 2.11352398 1.07599391
119 -0.12115276 2.11352398
120 -1.00657922 -0.12115276
121 1.75960831 -1.00657922
122 3.57381436 1.75960831
123 -2.44388901 3.57381436
124 8.44471826 -2.44388901
125 0.63465245 8.44471826
126 -1.21395663 0.63465245
127 0.20648070 -1.21395663
128 -0.69380682 0.20648070
129 0.48769059 -0.69380682
130 0.38018981 0.48769059
131 -1.65207589 0.38018981
132 -0.79291786 -1.65207589
133 -2.22275348 -0.79291786
134 -2.11619612 -2.22275348
135 2.23008903 -2.11619612
136 2.83485648 2.23008903
137 2.66128535 2.83485648
138 -2.44868172 2.66128535
139 1.91937891 -2.44868172
140 1.52476080 1.91937891
141 0.25959049 1.52476080
142 3.04959674 0.25959049
143 3.61873191 3.04959674
144 2.40707029 3.61873191
145 4.06554866 2.40707029
146 -3.04127914 4.06554866
147 -1.55114800 -3.04127914
148 -2.05242826 -1.55114800
149 -3.36359335 -2.05242826
150 -3.13509928 -3.36359335
151 3.98033618 -3.13509928
152 -2.40971025 3.98033618
153 -1.04450201 -2.40971025
154 1.08507931 -1.04450201
155 -0.94122107 1.08507931
156 1.42914423 -0.94122107
157 1.89055280 1.42914423
158 1.47306533 1.89055280
> 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/7cuvk1290172895.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/8cuvk1290172895.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/953u51290172895.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/1053u51290172895.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/1184bb1290172895.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/12um9z1290172895.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/13in6a1290172895.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/14bwov1290172895.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/15wx411290172895.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/16bp2a1290172895.tab")
+ }
> try(system("convert tmp/1y2fb1290172895.ps tmp/1y2fb1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/2rtfw1290172895.ps tmp/2rtfw1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/3rtfw1290172895.ps tmp/3rtfw1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rtfw1290172895.ps tmp/4rtfw1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/512wh1290172895.ps tmp/512wh1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/612wh1290172895.ps tmp/612wh1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/7cuvk1290172895.ps tmp/7cuvk1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/8cuvk1290172895.ps tmp/8cuvk1290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/953u51290172895.ps tmp/953u51290172895.png",intern=TRUE))
character(0)
> try(system("convert tmp/1053u51290172895.ps tmp/1053u51290172895.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.123 2.780 34.194