R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,0
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,0
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,0
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,0
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,0
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,0
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,0
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,0
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,0
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,0
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,0
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,0
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,0
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,0
+ ,21
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,0
+ ,16
+ ,8
+ ,15
+ ,9
+ ,23
+ ,24
+ ,0
+ ,20
+ ,9
+ ,15
+ ,6
+ ,25
+ ,24
+ ,0
+ ,17
+ ,9
+ ,13
+ ,6
+ ,22
+ ,23
+ ,0
+ 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'No Linear Trend'
> par2 = '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
> 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
PE Gender CM D PC PS O
1 7 0 25 11 8 25 23
2 17 0 17 6 8 30 25
3 12 0 18 8 9 22 19
4 12 0 16 10 7 22 29
5 11 0 20 10 4 25 25
6 11 0 16 11 11 23 21
7 12 0 18 16 7 17 22
8 13 0 17 11 7 21 25
9 16 0 30 12 10 19 18
10 11 0 23 8 10 15 22
11 10 0 18 12 8 16 15
12 9 0 21 9 9 22 20
13 17 0 31 14 11 23 20
14 11 0 27 15 9 23 21
15 14 0 21 9 13 19 21
16 15 0 16 8 9 23 24
17 15 0 20 9 6 25 24
18 13 0 17 9 6 22 23
19 18 0 25 16 16 26 24
20 18 0 26 11 5 29 18
21 12 0 25 8 7 32 25
22 17 0 17 9 9 25 21
23 18 0 32 12 12 28 22
24 14 0 22 9 9 25 23
25 16 0 17 9 5 25 23
26 14 0 20 14 10 18 24
27 12 0 29 10 8 25 23
28 17 0 23 14 7 25 21
29 12 0 20 10 8 20 28
30 6 0 11 6 4 15 16
31 12 0 26 13 8 24 29
32 12 0 22 10 8 26 27
33 13 0 14 15 8 14 16
34 14 0 19 12 7 24 28
35 11 0 20 11 8 25 25
36 12 0 28 8 7 20 22
37 9 0 19 9 7 21 23
38 15 0 30 9 9 27 26
39 18 0 29 15 11 23 23
40 15 0 26 9 6 25 25
41 12 0 23 10 8 20 21
42 14 0 21 12 9 22 24
43 13 0 28 11 6 25 22
44 13 0 23 14 10 25 27
45 11 0 18 6 8 17 26
46 16 0 20 8 10 25 24
47 11 0 21 10 5 26 24
48 16 0 28 12 14 27 22
49 8 0 10 5 6 19 24
50 15 0 22 10 6 22 20
51 21 0 31 10 12 32 26
52 18 0 29 13 12 21 21
53 13 0 22 10 8 18 19
54 15 0 23 10 10 23 21
55 19 0 20 9 10 20 16
56 15 0 18 8 10 21 22
57 11 0 25 14 5 17 15
58 10 0 21 8 7 18 17
59 13 0 24 9 10 19 15
60 15 0 25 14 11 22 21
61 12 0 13 8 7 14 19
62 16 0 28 8 12 18 24
63 18 0 25 7 11 35 17
64 8 0 9 6 11 29 23
65 13 0 16 8 5 21 24
66 17 0 19 6 8 25 14
67 7 0 29 11 4 26 22
68 12 0 14 11 7 17 16
69 14 0 22 14 11 25 19
70 6 0 15 8 6 20 25
71 10 0 15 8 4 22 24
72 11 0 20 11 8 24 26
73 14 0 18 10 9 21 26
74 11 0 33 14 8 26 25
75 13 0 22 11 11 24 18
76 12 0 16 9 8 16 21
77 9 0 16 8 4 18 23
78 12 0 18 13 6 19 20
79 13 0 18 12 9 21 13
80 12 0 22 13 13 22 15
81 9 0 30 14 9 23 14
82 15 0 30 12 10 29 22
83 24 0 24 14 20 21 10
84 17 0 21 13 11 23 22
85 11 0 29 16 6 27 24
86 17 0 31 9 9 25 19
87 11 0 20 9 7 21 20
88 12 0 16 9 9 10 13
89 14 0 22 8 10 20 20
90 11 0 20 7 9 26 22
91 16 0 28 16 8 24 24
92 21 0 38 11 7 29 29
93 14 0 22 9 6 19 12
94 20 0 20 11 13 24 20
95 13 0 17 9 6 19 21
96 15 0 22 13 10 22 22
97 19 0 31 16 16 17 20
98 11 1 24 14 12 24 26
99 10 1 18 12 8 19 23
100 14 1 23 13 12 19 24
101 11 1 15 11 8 23 22
102 15 1 12 4 4 27 28
103 11 1 15 8 8 14 12
104 17 1 20 8 7 22 24
105 18 1 34 16 11 21 20
106 10 1 31 14 8 18 23
107 11 1 19 11 8 20 28
108 13 1 21 9 9 19 24
109 16 1 22 9 9 24 23
110 9 1 24 10 6 25 29
111 9 1 32 16 6 29 26
112 9 1 33 11 6 28 22
113 12 1 13 16 5 17 22
114 12 1 25 12 7 29 23
115 18 1 29 14 10 26 30
116 15 1 18 10 8 14 17
117 10 1 20 10 8 26 23
118 11 1 15 12 8 20 25
119 9 1 33 14 6 32 24
120 5 1 26 16 4 23 24
121 12 1 18 9 8 21 24
122 24 1 28 8 20 30 20
123 14 1 17 8 6 24 22
124 7 1 12 7 4 22 28
125 12 1 17 9 9 24 25
126 13 1 21 10 6 24 24
127 8 1 18 13 9 24 24
128 11 1 10 10 5 19 23
129 9 1 29 11 5 31 30
130 11 1 31 8 8 22 24
131 13 1 19 9 8 27 21
132 10 1 9 13 6 19 25
133 13 1 13 14 6 21 25
134 10 1 19 12 8 23 29
135 13 1 21 12 8 19 22
136 8 1 23 14 5 19 27
137 16 1 21 11 7 20 24
138 9 1 15 14 8 23 29
139 12 1 19 10 7 17 21
140 14 1 26 14 8 17 24
141 9 1 16 11 5 17 23
142 11 1 19 9 10 21 27
143 14 1 31 16 9 21 25
144 12 1 19 9 7 18 21
145 12 1 15 7 6 19 21
146 11 1 23 14 10 20 29
147 12 1 17 14 6 15 21
148 9 1 21 8 11 24 20
149 9 1 17 11 6 20 19
150 15 1 25 14 9 22 24
151 8 1 20 11 4 13 13
152 8 1 19 20 7 19 25
153 17 1 20 11 8 21 23
154 11 1 17 9 5 23 26
155 12 1 21 10 8 16 23
156 20 1 26 13 10 26 22
157 12 1 17 8 9 21 24
158 7 1 21 15 5 21 24
159 11 1 28 14 8 24 24
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gender CM D PC PS
6.09930 -0.57237 0.08667 -0.10619 0.65421 0.10828
O
-0.06782
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.0190 -1.7988 0.0488 1.7996 7.0222
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.09930 1.76962 3.447 0.000734 ***
Gender -0.57237 0.47354 -1.209 0.228654
CM 0.08667 0.04817 1.799 0.073946 .
D -0.10619 0.08847 -1.200 0.231884
PC 0.65421 0.08667 7.548 3.79e-12 ***
PS 0.10828 0.06350 1.705 0.090183 .
O -0.06782 0.06406 -1.059 0.291481
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.691 on 152 degrees of freedom
Multiple R-squared: 0.413, Adjusted R-squared: 0.3899
F-statistic: 17.83 on 6 and 152 DF, p-value: 1.382e-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.96677941 0.06644118 0.03322059
[2,] 0.94016909 0.11966182 0.05983091
[3,] 0.93996502 0.12006996 0.06003498
[4,] 0.93342368 0.13315263 0.06657632
[5,] 0.91853923 0.16292154 0.08146077
[6,] 0.87682165 0.24635671 0.12317835
[7,] 0.85593779 0.28812441 0.14406221
[8,] 0.85207239 0.29585523 0.14792761
[9,] 0.80867605 0.38264790 0.19132395
[10,] 0.75737077 0.48525845 0.24262923
[11,] 0.83588332 0.32823336 0.16411668
[12,] 0.85525863 0.28948274 0.14474137
[13,] 0.86342207 0.27315586 0.13657793
[14,] 0.83219871 0.33560257 0.16780129
[15,] 0.78271853 0.43456294 0.21728147
[16,] 0.81853844 0.36292313 0.18146156
[17,] 0.78552597 0.42894805 0.21447403
[18,] 0.75371796 0.49256408 0.24628204
[19,] 0.76862131 0.46275737 0.23137869
[20,] 0.71744017 0.56511966 0.28255983
[21,] 0.72182444 0.55635111 0.27817556
[22,] 0.68398208 0.63203583 0.31601792
[23,] 0.64863575 0.70272850 0.35136425
[24,] 0.60414835 0.79170329 0.39585165
[25,] 0.56039153 0.87921694 0.43960847
[26,] 0.55910543 0.88178913 0.44089457
[27,] 0.51324887 0.97350226 0.48675113
[28,] 0.51595506 0.96808988 0.48404494
[29,] 0.46503132 0.93006263 0.53496868
[30,] 0.47055757 0.94111515 0.52944243
[31,] 0.46307772 0.92615543 0.53692228
[32,] 0.40998839 0.81997678 0.59001161
[33,] 0.35973877 0.71947754 0.64026123
[34,] 0.31222477 0.62444953 0.68777523
[35,] 0.28723852 0.57447704 0.71276148
[36,] 0.25935906 0.51871812 0.74064094
[37,] 0.23999578 0.47999157 0.76000422
[38,] 0.21625317 0.43250634 0.78374683
[39,] 0.18923586 0.37847173 0.81076414
[40,] 0.17693539 0.35387077 0.82306461
[41,] 0.18486245 0.36972490 0.81513755
[42,] 0.21633452 0.43266905 0.78366548
[43,] 0.21924233 0.43848467 0.78075767
[44,] 0.18757792 0.37515584 0.81242208
[45,] 0.15685515 0.31371031 0.84314485
[46,] 0.25127856 0.50255713 0.74872144
[47,] 0.22570058 0.45140116 0.77429942
[48,] 0.19287549 0.38575098 0.80712451
[49,] 0.18012938 0.36025875 0.81987062
[50,] 0.15811084 0.31622167 0.84188916
[51,] 0.13025459 0.26050918 0.86974541
[52,] 0.11908219 0.23816438 0.88091781
[53,] 0.11215534 0.22431069 0.88784466
[54,] 0.09731479 0.19462959 0.90268521
[55,] 0.25249449 0.50498898 0.74750551
[56,] 0.24596631 0.49193261 0.75403369
[57,] 0.26256772 0.52513543 0.73743228
[58,] 0.39371983 0.78743966 0.60628017
[59,] 0.35036129 0.70072258 0.64963871
[60,] 0.31925604 0.63851208 0.68074396
[61,] 0.42461730 0.84923461 0.57538270
[62,] 0.37870488 0.75740976 0.62129512
[63,] 0.35694265 0.71388530 0.64305735
[64,] 0.32393751 0.64787501 0.67606249
[65,] 0.34849462 0.69698924 0.65150538
[66,] 0.34166137 0.68332274 0.65833863
[67,] 0.30711006 0.61422013 0.69288994
[68,] 0.27645271 0.55290543 0.72354729
[69,] 0.24070644 0.48141289 0.75929356
[70,] 0.20856788 0.41713577 0.79143212
[71,] 0.27222844 0.54445689 0.72777156
[72,] 0.43073919 0.86147839 0.56926081
[73,] 0.39184198 0.78368396 0.60815802
[74,] 0.40561052 0.81122105 0.59438948
[75,] 0.38104018 0.76208036 0.61895982
[76,] 0.35413539 0.70827078 0.64586461
[77,] 0.32610169 0.65220339 0.67389831
[78,] 0.30977154 0.61954308 0.69022846
[79,] 0.29726014 0.59452027 0.70273986
[80,] 0.28259397 0.56518794 0.71740603
[81,] 0.38036264 0.76072529 0.61963736
[82,] 0.35618323 0.71236646 0.64381677
[83,] 0.54981091 0.90037817 0.45018909
[84,] 0.51352153 0.97295693 0.48647847
[85,] 0.52338553 0.95322894 0.47661447
[86,] 0.48800748 0.97601497 0.51199252
[87,] 0.44209337 0.88418674 0.55790663
[88,] 0.39749615 0.79499230 0.60250385
[89,] 0.40629243 0.81258485 0.59370757
[90,] 0.38558861 0.77117722 0.61441139
[91,] 0.35629447 0.71258894 0.64370553
[92,] 0.32104985 0.64209970 0.67895015
[93,] 0.49965982 0.99931965 0.50034018
[94,] 0.49333258 0.98666516 0.50666742
[95,] 0.64104961 0.71790078 0.35895039
[96,] 0.63411163 0.73177674 0.36588837
[97,] 0.63551034 0.72897932 0.36448966
[98,] 0.59036101 0.81927799 0.40963899
[99,] 0.54087472 0.91825057 0.45912528
[100,] 0.53572714 0.92854573 0.46427286
[101,] 0.50879087 0.98241827 0.49120913
[102,] 0.49538618 0.99077236 0.50461382
[103,] 0.49822553 0.99645106 0.50177447
[104,] 0.51416586 0.97166828 0.48583414
[105,] 0.46629073 0.93258145 0.53370927
[106,] 0.58188757 0.83622486 0.41811243
[107,] 0.56450354 0.87099292 0.43549646
[108,] 0.55364767 0.89270467 0.44635233
[109,] 0.50035312 0.99929376 0.49964688
[110,] 0.48944004 0.97888009 0.51055996
[111,] 0.56345747 0.87308507 0.43654253
[112,] 0.50619540 0.98760921 0.49380460
[113,] 0.47691276 0.95382553 0.52308724
[114,] 0.48320707 0.96641413 0.51679293
[115,] 0.44411520 0.88823040 0.55588480
[116,] 0.38704269 0.77408538 0.61295731
[117,] 0.36118940 0.72237880 0.63881060
[118,] 0.45837443 0.91674885 0.54162557
[119,] 0.41810238 0.83620477 0.58189762
[120,] 0.37508452 0.75016904 0.62491548
[121,] 0.35779092 0.71558184 0.64220908
[122,] 0.29850715 0.59701429 0.70149285
[123,] 0.25183413 0.50366826 0.74816587
[124,] 0.31249173 0.62498347 0.68750827
[125,] 0.26428672 0.52857344 0.73571328
[126,] 0.21592663 0.43185325 0.78407337
[127,] 0.20888191 0.41776383 0.79111809
[128,] 0.27348584 0.54697168 0.72651416
[129,] 0.22046048 0.44092096 0.77953952
[130,] 0.17059784 0.34119567 0.82940216
[131,] 0.13779291 0.27558581 0.86220709
[132,] 0.09711575 0.19423151 0.90288425
[133,] 0.07724996 0.15449993 0.92275004
[134,] 0.05010222 0.10020444 0.94989778
[135,] 0.03091096 0.06182192 0.96908904
[136,] 0.02008999 0.04017999 0.97991001
[137,] 0.01622642 0.03245284 0.98377358
[138,] 0.01420331 0.02840662 0.98579669
[139,] 0.20917325 0.41834650 0.79082675
[140,] 0.18030409 0.36060819 0.81969591
> postscript(file="/var/www/rcomp/tmp/1um431292342161.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/www/rcomp/tmp/25v3o1292342161.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/www/rcomp/tmp/35v3o1292342161.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/www/rcomp/tmp/45v3o1292342161.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/www/rcomp/tmp/5g5391292342161.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 = 159
Frequency = 1
1 2 3 4 5 6
-6.47902156 3.27765149 -1.79151077 0.58080220 0.60064540 -3.58068055
7 8 9 10 11 12
1.11127090 1.43733216 1.19597768 -2.91767198 -2.33412633 -4.87752537
13 14 15 16 17 18
1.36997345 -2.80090304 -2.10172325 1.61263570 3.11821293 1.63525811
19 20 21 22 23 24
-0.22226516 5.62474240 -1.76570386 3.21213876 1.01093906 -0.08559221
25 26 27 28 29 30
4.96462919 0.79025937 -1.93189985 4.53146732 -0.27135744 -3.57158547
31 32 33 34 35 36
-0.83814021 -1.16220600 1.61550511 2.24877982 -1.91002494 -0.92979810
37 38 39 40 41 42
-3.08402071 0.20791275 2.85295546 2.66599279 -1.00609060 0.71230206
43 44 45 46 47 48
0.50157256 -1.02427741 -1.33355047 1.39516806 -0.31633928 -1.84251761
49 50 51 52 53 54
-2.79012190 3.10463234 3.72337851 2.06729592 0.16151155 0.36063728
55 56 57 58 59 60
4.50022955 0.86600517 0.12590098 -2.44560864 -1.80599679 0.06610751
61 62 63 64 65 66
0.81653068 0.15132493 0.64387665 -7.01896137 2.44605552 2.89973097
67 68 69 70 71 72
-4.38495250 0.52012715 -1.13435035 -4.94538860 0.07866158 -1.73392742
73 74 75 76 77 78
1.00385975 -2.82649012 -2.41244745 -0.07244413 -0.64270317 1.09472848
79 80 81 82 83 84
-0.66537909 -4.49538875 -5.64182347 -0.61556773 2.62715123 2.26614659
85 86 87 88 89 90
-1.13509328 1.86308732 -1.37414270 -0.61950319 -0.50803758 -3.30071874
91 92 93 94 95 96
2.96799399 7.02222103 1.78075710 3.58810209 1.82446860 0.94196934
97 98 99 100 101 102
0.96096260 -3.80654429 -1.54406836 -0.42028608 -0.89117818 5.21616092
103 104 105 106 107 108
-0.91337413 5.25502457 3.11126190 -2.35015859 -0.50612742 0.29095359
109 110 111 112 113 114
2.59505889 -2.21083879 -2.90367095 -3.68426456 3.42543349 -0.57937433
115 116 117 118 119 120
4.12322416 3.37806418 -2.68775614 -0.25669837 -3.66319438 -4.56115178
121 122 123 124 125 126
-0.01137594 1.91934078 2.81706221 -1.92387177 -0.83594449 1.81837853
127 128 129 130 131 132
-4.56568462 1.89958239 -2.46567115 -2.35259017 0.04881542 0.78623536
133 134 135 136 137 138
3.32916937 -1.65696707 1.12809695 -1.53114877 4.70347581 -2.09790151
139 140 141 142 143 144
0.89202815 2.25930272 -0.29770469 -2.20302827 1.01879104 0.67755978
145 146 147 148 149 150
1.35780959 -1.77486906 2.36089933 -5.93633366 -1.63470081 2.15035555
151 152 153 154 155 156
-1.23522101 -1.99139580 4.95983665 0.95701063 0.30838216 5.73452388
157 158 159
-0.68510485 -2.67162744 -1.67201054
> postscript(file="/var/www/rcomp/tmp/6g5391292342161.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -6.47902156 NA
1 3.27765149 -6.47902156
2 -1.79151077 3.27765149
3 0.58080220 -1.79151077
4 0.60064540 0.58080220
5 -3.58068055 0.60064540
6 1.11127090 -3.58068055
7 1.43733216 1.11127090
8 1.19597768 1.43733216
9 -2.91767198 1.19597768
10 -2.33412633 -2.91767198
11 -4.87752537 -2.33412633
12 1.36997345 -4.87752537
13 -2.80090304 1.36997345
14 -2.10172325 -2.80090304
15 1.61263570 -2.10172325
16 3.11821293 1.61263570
17 1.63525811 3.11821293
18 -0.22226516 1.63525811
19 5.62474240 -0.22226516
20 -1.76570386 5.62474240
21 3.21213876 -1.76570386
22 1.01093906 3.21213876
23 -0.08559221 1.01093906
24 4.96462919 -0.08559221
25 0.79025937 4.96462919
26 -1.93189985 0.79025937
27 4.53146732 -1.93189985
28 -0.27135744 4.53146732
29 -3.57158547 -0.27135744
30 -0.83814021 -3.57158547
31 -1.16220600 -0.83814021
32 1.61550511 -1.16220600
33 2.24877982 1.61550511
34 -1.91002494 2.24877982
35 -0.92979810 -1.91002494
36 -3.08402071 -0.92979810
37 0.20791275 -3.08402071
38 2.85295546 0.20791275
39 2.66599279 2.85295546
40 -1.00609060 2.66599279
41 0.71230206 -1.00609060
42 0.50157256 0.71230206
43 -1.02427741 0.50157256
44 -1.33355047 -1.02427741
45 1.39516806 -1.33355047
46 -0.31633928 1.39516806
47 -1.84251761 -0.31633928
48 -2.79012190 -1.84251761
49 3.10463234 -2.79012190
50 3.72337851 3.10463234
51 2.06729592 3.72337851
52 0.16151155 2.06729592
53 0.36063728 0.16151155
54 4.50022955 0.36063728
55 0.86600517 4.50022955
56 0.12590098 0.86600517
57 -2.44560864 0.12590098
58 -1.80599679 -2.44560864
59 0.06610751 -1.80599679
60 0.81653068 0.06610751
61 0.15132493 0.81653068
62 0.64387665 0.15132493
63 -7.01896137 0.64387665
64 2.44605552 -7.01896137
65 2.89973097 2.44605552
66 -4.38495250 2.89973097
67 0.52012715 -4.38495250
68 -1.13435035 0.52012715
69 -4.94538860 -1.13435035
70 0.07866158 -4.94538860
71 -1.73392742 0.07866158
72 1.00385975 -1.73392742
73 -2.82649012 1.00385975
74 -2.41244745 -2.82649012
75 -0.07244413 -2.41244745
76 -0.64270317 -0.07244413
77 1.09472848 -0.64270317
78 -0.66537909 1.09472848
79 -4.49538875 -0.66537909
80 -5.64182347 -4.49538875
81 -0.61556773 -5.64182347
82 2.62715123 -0.61556773
83 2.26614659 2.62715123
84 -1.13509328 2.26614659
85 1.86308732 -1.13509328
86 -1.37414270 1.86308732
87 -0.61950319 -1.37414270
88 -0.50803758 -0.61950319
89 -3.30071874 -0.50803758
90 2.96799399 -3.30071874
91 7.02222103 2.96799399
92 1.78075710 7.02222103
93 3.58810209 1.78075710
94 1.82446860 3.58810209
95 0.94196934 1.82446860
96 0.96096260 0.94196934
97 -3.80654429 0.96096260
98 -1.54406836 -3.80654429
99 -0.42028608 -1.54406836
100 -0.89117818 -0.42028608
101 5.21616092 -0.89117818
102 -0.91337413 5.21616092
103 5.25502457 -0.91337413
104 3.11126190 5.25502457
105 -2.35015859 3.11126190
106 -0.50612742 -2.35015859
107 0.29095359 -0.50612742
108 2.59505889 0.29095359
109 -2.21083879 2.59505889
110 -2.90367095 -2.21083879
111 -3.68426456 -2.90367095
112 3.42543349 -3.68426456
113 -0.57937433 3.42543349
114 4.12322416 -0.57937433
115 3.37806418 4.12322416
116 -2.68775614 3.37806418
117 -0.25669837 -2.68775614
118 -3.66319438 -0.25669837
119 -4.56115178 -3.66319438
120 -0.01137594 -4.56115178
121 1.91934078 -0.01137594
122 2.81706221 1.91934078
123 -1.92387177 2.81706221
124 -0.83594449 -1.92387177
125 1.81837853 -0.83594449
126 -4.56568462 1.81837853
127 1.89958239 -4.56568462
128 -2.46567115 1.89958239
129 -2.35259017 -2.46567115
130 0.04881542 -2.35259017
131 0.78623536 0.04881542
132 3.32916937 0.78623536
133 -1.65696707 3.32916937
134 1.12809695 -1.65696707
135 -1.53114877 1.12809695
136 4.70347581 -1.53114877
137 -2.09790151 4.70347581
138 0.89202815 -2.09790151
139 2.25930272 0.89202815
140 -0.29770469 2.25930272
141 -2.20302827 -0.29770469
142 1.01879104 -2.20302827
143 0.67755978 1.01879104
144 1.35780959 0.67755978
145 -1.77486906 1.35780959
146 2.36089933 -1.77486906
147 -5.93633366 2.36089933
148 -1.63470081 -5.93633366
149 2.15035555 -1.63470081
150 -1.23522101 2.15035555
151 -1.99139580 -1.23522101
152 4.95983665 -1.99139580
153 0.95701063 4.95983665
154 0.30838216 0.95701063
155 5.73452388 0.30838216
156 -0.68510485 5.73452388
157 -2.67162744 -0.68510485
158 -1.67201054 -2.67162744
159 NA -1.67201054
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.27765149 -6.47902156
[2,] -1.79151077 3.27765149
[3,] 0.58080220 -1.79151077
[4,] 0.60064540 0.58080220
[5,] -3.58068055 0.60064540
[6,] 1.11127090 -3.58068055
[7,] 1.43733216 1.11127090
[8,] 1.19597768 1.43733216
[9,] -2.91767198 1.19597768
[10,] -2.33412633 -2.91767198
[11,] -4.87752537 -2.33412633
[12,] 1.36997345 -4.87752537
[13,] -2.80090304 1.36997345
[14,] -2.10172325 -2.80090304
[15,] 1.61263570 -2.10172325
[16,] 3.11821293 1.61263570
[17,] 1.63525811 3.11821293
[18,] -0.22226516 1.63525811
[19,] 5.62474240 -0.22226516
[20,] -1.76570386 5.62474240
[21,] 3.21213876 -1.76570386
[22,] 1.01093906 3.21213876
[23,] -0.08559221 1.01093906
[24,] 4.96462919 -0.08559221
[25,] 0.79025937 4.96462919
[26,] -1.93189985 0.79025937
[27,] 4.53146732 -1.93189985
[28,] -0.27135744 4.53146732
[29,] -3.57158547 -0.27135744
[30,] -0.83814021 -3.57158547
[31,] -1.16220600 -0.83814021
[32,] 1.61550511 -1.16220600
[33,] 2.24877982 1.61550511
[34,] -1.91002494 2.24877982
[35,] -0.92979810 -1.91002494
[36,] -3.08402071 -0.92979810
[37,] 0.20791275 -3.08402071
[38,] 2.85295546 0.20791275
[39,] 2.66599279 2.85295546
[40,] -1.00609060 2.66599279
[41,] 0.71230206 -1.00609060
[42,] 0.50157256 0.71230206
[43,] -1.02427741 0.50157256
[44,] -1.33355047 -1.02427741
[45,] 1.39516806 -1.33355047
[46,] -0.31633928 1.39516806
[47,] -1.84251761 -0.31633928
[48,] -2.79012190 -1.84251761
[49,] 3.10463234 -2.79012190
[50,] 3.72337851 3.10463234
[51,] 2.06729592 3.72337851
[52,] 0.16151155 2.06729592
[53,] 0.36063728 0.16151155
[54,] 4.50022955 0.36063728
[55,] 0.86600517 4.50022955
[56,] 0.12590098 0.86600517
[57,] -2.44560864 0.12590098
[58,] -1.80599679 -2.44560864
[59,] 0.06610751 -1.80599679
[60,] 0.81653068 0.06610751
[61,] 0.15132493 0.81653068
[62,] 0.64387665 0.15132493
[63,] -7.01896137 0.64387665
[64,] 2.44605552 -7.01896137
[65,] 2.89973097 2.44605552
[66,] -4.38495250 2.89973097
[67,] 0.52012715 -4.38495250
[68,] -1.13435035 0.52012715
[69,] -4.94538860 -1.13435035
[70,] 0.07866158 -4.94538860
[71,] -1.73392742 0.07866158
[72,] 1.00385975 -1.73392742
[73,] -2.82649012 1.00385975
[74,] -2.41244745 -2.82649012
[75,] -0.07244413 -2.41244745
[76,] -0.64270317 -0.07244413
[77,] 1.09472848 -0.64270317
[78,] -0.66537909 1.09472848
[79,] -4.49538875 -0.66537909
[80,] -5.64182347 -4.49538875
[81,] -0.61556773 -5.64182347
[82,] 2.62715123 -0.61556773
[83,] 2.26614659 2.62715123
[84,] -1.13509328 2.26614659
[85,] 1.86308732 -1.13509328
[86,] -1.37414270 1.86308732
[87,] -0.61950319 -1.37414270
[88,] -0.50803758 -0.61950319
[89,] -3.30071874 -0.50803758
[90,] 2.96799399 -3.30071874
[91,] 7.02222103 2.96799399
[92,] 1.78075710 7.02222103
[93,] 3.58810209 1.78075710
[94,] 1.82446860 3.58810209
[95,] 0.94196934 1.82446860
[96,] 0.96096260 0.94196934
[97,] -3.80654429 0.96096260
[98,] -1.54406836 -3.80654429
[99,] -0.42028608 -1.54406836
[100,] -0.89117818 -0.42028608
[101,] 5.21616092 -0.89117818
[102,] -0.91337413 5.21616092
[103,] 5.25502457 -0.91337413
[104,] 3.11126190 5.25502457
[105,] -2.35015859 3.11126190
[106,] -0.50612742 -2.35015859
[107,] 0.29095359 -0.50612742
[108,] 2.59505889 0.29095359
[109,] -2.21083879 2.59505889
[110,] -2.90367095 -2.21083879
[111,] -3.68426456 -2.90367095
[112,] 3.42543349 -3.68426456
[113,] -0.57937433 3.42543349
[114,] 4.12322416 -0.57937433
[115,] 3.37806418 4.12322416
[116,] -2.68775614 3.37806418
[117,] -0.25669837 -2.68775614
[118,] -3.66319438 -0.25669837
[119,] -4.56115178 -3.66319438
[120,] -0.01137594 -4.56115178
[121,] 1.91934078 -0.01137594
[122,] 2.81706221 1.91934078
[123,] -1.92387177 2.81706221
[124,] -0.83594449 -1.92387177
[125,] 1.81837853 -0.83594449
[126,] -4.56568462 1.81837853
[127,] 1.89958239 -4.56568462
[128,] -2.46567115 1.89958239
[129,] -2.35259017 -2.46567115
[130,] 0.04881542 -2.35259017
[131,] 0.78623536 0.04881542
[132,] 3.32916937 0.78623536
[133,] -1.65696707 3.32916937
[134,] 1.12809695 -1.65696707
[135,] -1.53114877 1.12809695
[136,] 4.70347581 -1.53114877
[137,] -2.09790151 4.70347581
[138,] 0.89202815 -2.09790151
[139,] 2.25930272 0.89202815
[140,] -0.29770469 2.25930272
[141,] -2.20302827 -0.29770469
[142,] 1.01879104 -2.20302827
[143,] 0.67755978 1.01879104
[144,] 1.35780959 0.67755978
[145,] -1.77486906 1.35780959
[146,] 2.36089933 -1.77486906
[147,] -5.93633366 2.36089933
[148,] -1.63470081 -5.93633366
[149,] 2.15035555 -1.63470081
[150,] -1.23522101 2.15035555
[151,] -1.99139580 -1.23522101
[152,] 4.95983665 -1.99139580
[153,] 0.95701063 4.95983665
[154,] 0.30838216 0.95701063
[155,] 5.73452388 0.30838216
[156,] -0.68510485 5.73452388
[157,] -2.67162744 -0.68510485
[158,] -1.67201054 -2.67162744
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.27765149 -6.47902156
2 -1.79151077 3.27765149
3 0.58080220 -1.79151077
4 0.60064540 0.58080220
5 -3.58068055 0.60064540
6 1.11127090 -3.58068055
7 1.43733216 1.11127090
8 1.19597768 1.43733216
9 -2.91767198 1.19597768
10 -2.33412633 -2.91767198
11 -4.87752537 -2.33412633
12 1.36997345 -4.87752537
13 -2.80090304 1.36997345
14 -2.10172325 -2.80090304
15 1.61263570 -2.10172325
16 3.11821293 1.61263570
17 1.63525811 3.11821293
18 -0.22226516 1.63525811
19 5.62474240 -0.22226516
20 -1.76570386 5.62474240
21 3.21213876 -1.76570386
22 1.01093906 3.21213876
23 -0.08559221 1.01093906
24 4.96462919 -0.08559221
25 0.79025937 4.96462919
26 -1.93189985 0.79025937
27 4.53146732 -1.93189985
28 -0.27135744 4.53146732
29 -3.57158547 -0.27135744
30 -0.83814021 -3.57158547
31 -1.16220600 -0.83814021
32 1.61550511 -1.16220600
33 2.24877982 1.61550511
34 -1.91002494 2.24877982
35 -0.92979810 -1.91002494
36 -3.08402071 -0.92979810
37 0.20791275 -3.08402071
38 2.85295546 0.20791275
39 2.66599279 2.85295546
40 -1.00609060 2.66599279
41 0.71230206 -1.00609060
42 0.50157256 0.71230206
43 -1.02427741 0.50157256
44 -1.33355047 -1.02427741
45 1.39516806 -1.33355047
46 -0.31633928 1.39516806
47 -1.84251761 -0.31633928
48 -2.79012190 -1.84251761
49 3.10463234 -2.79012190
50 3.72337851 3.10463234
51 2.06729592 3.72337851
52 0.16151155 2.06729592
53 0.36063728 0.16151155
54 4.50022955 0.36063728
55 0.86600517 4.50022955
56 0.12590098 0.86600517
57 -2.44560864 0.12590098
58 -1.80599679 -2.44560864
59 0.06610751 -1.80599679
60 0.81653068 0.06610751
61 0.15132493 0.81653068
62 0.64387665 0.15132493
63 -7.01896137 0.64387665
64 2.44605552 -7.01896137
65 2.89973097 2.44605552
66 -4.38495250 2.89973097
67 0.52012715 -4.38495250
68 -1.13435035 0.52012715
69 -4.94538860 -1.13435035
70 0.07866158 -4.94538860
71 -1.73392742 0.07866158
72 1.00385975 -1.73392742
73 -2.82649012 1.00385975
74 -2.41244745 -2.82649012
75 -0.07244413 -2.41244745
76 -0.64270317 -0.07244413
77 1.09472848 -0.64270317
78 -0.66537909 1.09472848
79 -4.49538875 -0.66537909
80 -5.64182347 -4.49538875
81 -0.61556773 -5.64182347
82 2.62715123 -0.61556773
83 2.26614659 2.62715123
84 -1.13509328 2.26614659
85 1.86308732 -1.13509328
86 -1.37414270 1.86308732
87 -0.61950319 -1.37414270
88 -0.50803758 -0.61950319
89 -3.30071874 -0.50803758
90 2.96799399 -3.30071874
91 7.02222103 2.96799399
92 1.78075710 7.02222103
93 3.58810209 1.78075710
94 1.82446860 3.58810209
95 0.94196934 1.82446860
96 0.96096260 0.94196934
97 -3.80654429 0.96096260
98 -1.54406836 -3.80654429
99 -0.42028608 -1.54406836
100 -0.89117818 -0.42028608
101 5.21616092 -0.89117818
102 -0.91337413 5.21616092
103 5.25502457 -0.91337413
104 3.11126190 5.25502457
105 -2.35015859 3.11126190
106 -0.50612742 -2.35015859
107 0.29095359 -0.50612742
108 2.59505889 0.29095359
109 -2.21083879 2.59505889
110 -2.90367095 -2.21083879
111 -3.68426456 -2.90367095
112 3.42543349 -3.68426456
113 -0.57937433 3.42543349
114 4.12322416 -0.57937433
115 3.37806418 4.12322416
116 -2.68775614 3.37806418
117 -0.25669837 -2.68775614
118 -3.66319438 -0.25669837
119 -4.56115178 -3.66319438
120 -0.01137594 -4.56115178
121 1.91934078 -0.01137594
122 2.81706221 1.91934078
123 -1.92387177 2.81706221
124 -0.83594449 -1.92387177
125 1.81837853 -0.83594449
126 -4.56568462 1.81837853
127 1.89958239 -4.56568462
128 -2.46567115 1.89958239
129 -2.35259017 -2.46567115
130 0.04881542 -2.35259017
131 0.78623536 0.04881542
132 3.32916937 0.78623536
133 -1.65696707 3.32916937
134 1.12809695 -1.65696707
135 -1.53114877 1.12809695
136 4.70347581 -1.53114877
137 -2.09790151 4.70347581
138 0.89202815 -2.09790151
139 2.25930272 0.89202815
140 -0.29770469 2.25930272
141 -2.20302827 -0.29770469
142 1.01879104 -2.20302827
143 0.67755978 1.01879104
144 1.35780959 0.67755978
145 -1.77486906 1.35780959
146 2.36089933 -1.77486906
147 -5.93633366 2.36089933
148 -1.63470081 -5.93633366
149 2.15035555 -1.63470081
150 -1.23522101 2.15035555
151 -1.99139580 -1.23522101
152 4.95983665 -1.99139580
153 0.95701063 4.95983665
154 0.30838216 0.95701063
155 5.73452388 0.30838216
156 -0.68510485 5.73452388
157 -2.67162744 -0.68510485
158 -1.67201054 -2.67162744
> 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/rcomp/tmp/7qwkc1292342161.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/www/rcomp/tmp/81njx1292342161.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/www/rcomp/tmp/91njx1292342161.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/www/rcomp/tmp/101njx1292342161.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11fxz51292342161.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/rcomp/tmp/12ixft1292342161.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/rcomp/tmp/13f7d21292342161.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/rcomp/tmp/140qtq1292342161.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/rcomp/tmp/1538sw1292342161.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/rcomp/tmp/167rq21292342161.tab")
+ }
>
> try(system("convert tmp/1um431292342161.ps tmp/1um431292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/25v3o1292342161.ps tmp/25v3o1292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/35v3o1292342161.ps tmp/35v3o1292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/45v3o1292342161.ps tmp/45v3o1292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/5g5391292342161.ps tmp/5g5391292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/6g5391292342161.ps tmp/6g5391292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qwkc1292342161.ps tmp/7qwkc1292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/81njx1292342161.ps tmp/81njx1292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/91njx1292342161.ps tmp/91njx1292342161.png",intern=TRUE))
character(0)
> try(system("convert tmp/101njx1292342161.ps tmp/101njx1292342161.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.630 1.800 6.488