R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(5
+ ,22
+ ,0
+ ,15
+ ,4
+ ,2
+ ,1
+ ,0
+ ,7
+ ,0
+ ,0
+ ,3
+ ,7
+ ,4
+ ,0
+ ,2
+ ,5
+ ,14
+ ,5
+ ,3
+ ,5
+ ,2
+ ,0
+ ,12
+ ,4
+ ,0
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,0
+ ,6
+ ,6
+ ,0
+ ,12
+ ,5
+ ,25
+ ,0
+ ,15
+ ,1
+ ,0
+ ,0
+ ,0
+ ,5
+ ,25
+ ,5
+ ,10
+ ,4
+ ,0
+ ,0
+ ,12
+ ,6
+ ,2
+ ,2
+ ,20
+ ,7
+ ,30
+ ,3
+ ,20
+ ,7
+ ,1
+ ,0
+ ,2
+ ,2
+ ,0
+ ,0
+ ,3
+ ,6
+ ,0
+ ,0
+ ,16
+ ,4
+ ,8
+ ,0
+ ,4
+ ,3
+ ,0
+ ,4
+ ,2
+ ,6
+ ,0
+ ,0
+ ,4
+ ,6
+ ,0
+ ,8
+ ,16
+ ,5
+ ,6
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,6
+ ,6
+ ,0
+ ,15
+ ,4
+ ,12
+ ,3
+ ,9
+ ,3
+ ,1
+ ,0
+ ,1
+ ,4
+ ,20
+ ,24
+ ,15
+ ,5
+ ,5
+ ,15
+ ,5
+ ,6
+ ,0
+ ,0
+ ,4
+ ,6
+ ,21
+ ,12
+ ,15
+ ,4
+ ,3
+ ,0
+ ,4
+ ,6
+ ,5
+ ,0
+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 ,dimnames=list(c('satisfaction'
+ ,'Walked'
+ ,'Cycled'
+ ,'Other
')
+ ,1:160))
> y <- array(NA,dim=c(4,160),dimnames=list(c('satisfaction','Walked','Cycled','Other
'),1:160))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'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
satisfaction Walked Cycled Other\r\r
1 5 22 0 15
2 4 2 1 0
3 7 0 0 3
4 7 4 0 2
5 5 14 5 3
6 5 2 0 12
7 4 0 4 3
8 4 4 4 0
9 6 6 0 12
10 5 25 0 15
11 1 0 0 0
12 5 25 5 10
13 4 0 0 12
14 6 2 2 20
15 7 30 3 20
16 7 1 0 2
17 2 0 0 3
18 6 0 0 16
19 4 8 0 4
20 3 0 4 2
21 6 0 0 4
22 6 0 8 16
23 5 6 0 0
24 4 0 0 0
25 6 6 0 15
26 4 12 3 9
27 3 1 0 1
28 4 20 24 15
29 5 5 15 5
30 6 0 0 4
31 6 21 12 15
32 4 3 0 4
33 6 5 0 12
34 6 8 0 2
35 5 10 4 4
36 6 5 1 2
37 4 8 0 4
38 6 6 16 8
39 7 15 9 30
40 5 9 0 6
41 6 14 8 6
42 6 9 10 7
43 5 5 0 4
44 7 9 6 17
45 6 10 0 5
46 3 12 0 0
47 4 9 15 3
48 5 7 0 4
49 4 15 0 15
50 3 14 0 0
51 5 16 0 8
52 5 6 0 10
53 4 6 0 4
54 5 2 0 0
55 1 8 10 6
56 2 0 7 11
57 3 6 2 10
58 4 4 0 0
59 3 15 2 0
60 7 0 0 0
61 2 12 3 0
62 4 0 12 0
63 2 13 0 0
64 5 18 3 0
65 6 4 0 7
66 6 9 0 4
67 6 12 0 12
68 6 14 8 6
69 6 0 0 12
70 6 4 7 10
71 6 12 0 9
72 4 15 18 6
73 4 0 0 0
74 5 30 13 16
75 6 0 0 2
76 6 0 0 0
77 7 3 0 0
78 4 2 0 1
79 6 15 0 10
80 6 3 2 10
81 6 4 0 14
82 3 12 9 12
83 5 8 16 12
84 6 12 10 12
85 4 18 0 5
86 5 15 7 0
87 6 3 8 4
88 6 0 0 3
89 3 0 0 0
90 6 21 0 14
91 5 10 0 4
92 6 5 1 3
93 4 0 0 0
94 7 1 0 12
95 5 0 0 12
96 6 6 0 15
97 6 12 0 0
98 6 10 20 8
99 7 0 9 6
100 6 25 0 14
101 6 3 0 5
102 6 15 0 10
103 6 10 0 16
104 2 15 4 4
105 4 4 0 0
106 4 10 2 8
107 6 2 0 12
108 5 12 0 6
109 6 9 0 4
110 6 1 28 20
111 2 4 0 0
112 7 2 0 13
113 1 0 0 0
114 4 1 0 0
115 1 0 0 0
116 6 0 0 0
117 6 0 0 10
118 6 18 10 6
119 7 3 0 16
120 6 6 0 6
121 4 0 16 0
122 4 2 1 0
123 6 4 10 4
124 5 15 0 9
125 7 6 0 17
126 4 30 15 12
127 4 3 10 3
128 6 18 0 6
129 7 10 0 8
130 5 0 0 3
131 6 7 2 7
132 6 0 3 0
133 6 22 4 10
134 5 7 1 3
135 7 4 4 0
136 4 15 0 8
137 6 5 0 0
138 6 14 8 4
139 7 11 0 13
140 6 24 0 12
141 6 24 6 16
142 5 0 0 20
143 5 20 2 20
144 5 12 0 21
145 6 7 0 10
146 6 0 0 14
147 7 28 0 12
148 4 12 0 15
149 6 15 27 9
150 6 0 0 4
151 7 7 4 8
152 6 8 0 0
153 7 30 0 13
154 4 14 0 0
155 6 3 0 21
156 4 3 1 0
157 4 0 0 1
158 7 15 4 16
159 4 0 0 12
160 7 11 0 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Walked Cycled `Other\r\r`
4.574087 -0.002062 -0.018280 0.087193
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.8980 -0.6634 0.1930 1.0732 2.5073
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.574087 0.179503 25.482 < 2e-16 ***
Walked -0.002062 0.014809 -0.139 0.889
Cycled -0.018280 0.019634 -0.931 0.353
`Other\r\r` 0.087193 0.018162 4.801 3.67e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.34 on 156 degrees of freedom
Multiple R-squared: 0.1399, Adjusted R-squared: 0.1234
F-statistic: 8.461 on 3 and 156 DF, p-value: 3.039e-05
> 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.6630732 0.67385351 0.33692676
[2,] 0.5349661 0.93006786 0.46503393
[3,] 0.4228732 0.84574644 0.57712678
[4,] 0.3138176 0.62763525 0.68618237
[5,] 0.9453560 0.10928800 0.05464400
[6,] 0.9124913 0.17501743 0.08750871
[7,] 0.8981281 0.20374390 0.10187195
[8,] 0.8578055 0.28438899 0.14219449
[9,] 0.8282008 0.34359849 0.17179924
[10,] 0.8993711 0.20125779 0.10062889
[11,] 0.9550635 0.08987293 0.04493646
[12,] 0.9363438 0.12731231 0.06365616
[13,] 0.9159790 0.16804201 0.08402100
[14,] 0.9098485 0.18030299 0.09015150
[15,] 0.9066836 0.18663278 0.09331639
[16,] 0.8808564 0.23828728 0.11914364
[17,] 0.8521010 0.29579805 0.14789903
[18,] 0.8127749 0.37445023 0.18722512
[19,] 0.7673259 0.46534823 0.23267412
[20,] 0.7473504 0.50529928 0.25264964
[21,] 0.7456495 0.50870093 0.25435047
[22,] 0.7074076 0.58518488 0.29259244
[23,] 0.6817695 0.63646097 0.31823048
[24,] 0.6763079 0.64738427 0.32369214
[25,] 0.6356659 0.72866813 0.36433406
[26,] 0.5943250 0.81134996 0.40567498
[27,] 0.5451677 0.90966467 0.45483233
[28,] 0.5522371 0.89552584 0.44776292
[29,] 0.4989932 0.99798640 0.50100680
[30,] 0.5031273 0.99374546 0.49687273
[31,] 0.4683620 0.93672397 0.53163801
[32,] 0.4649822 0.92996446 0.53501777
[33,] 0.4108804 0.82176075 0.58911962
[34,] 0.3584296 0.71685926 0.64157037
[35,] 0.3450718 0.69014368 0.65492816
[36,] 0.3264857 0.65297137 0.67351431
[37,] 0.2803937 0.56078734 0.71960633
[38,] 0.2672621 0.53452411 0.73273795
[39,] 0.2510995 0.50219906 0.74890047
[40,] 0.2622587 0.52451734 0.73774133
[41,] 0.2276701 0.45534025 0.77232988
[42,] 0.1911363 0.38227260 0.80886370
[43,] 0.2215448 0.44308957 0.77845521
[44,] 0.2250329 0.45006590 0.77496705
[45,] 0.1893406 0.37868130 0.81065935
[46,] 0.1591257 0.31825141 0.84087429
[47,] 0.1402116 0.28042312 0.85978844
[48,] 0.1190408 0.23808151 0.88095924
[49,] 0.3874385 0.77487700 0.61256150
[50,] 0.6255272 0.74894557 0.37447278
[51,] 0.7071936 0.58561271 0.29280635
[52,] 0.6705363 0.65892738 0.32946369
[53,] 0.6739567 0.65208655 0.32604328
[54,] 0.7756407 0.44871856 0.22435928
[55,] 0.8433520 0.31329590 0.15664795
[56,] 0.8168123 0.36637548 0.18318774
[57,] 0.8806722 0.23865556 0.11932778
[58,] 0.8652284 0.26954330 0.13477165
[59,] 0.8511230 0.29775394 0.14887697
[60,] 0.8453974 0.30920514 0.15460257
[61,] 0.8202605 0.35947892 0.17973946
[62,] 0.8145577 0.37088457 0.18544229
[63,] 0.7852043 0.42959137 0.21479568
[64,] 0.7614908 0.47701843 0.23850921
[65,] 0.7353674 0.52926523 0.26463262
[66,] 0.7100400 0.57992007 0.28996003
[67,] 0.6783144 0.64337121 0.32168560
[68,] 0.6481646 0.70367080 0.35183540
[69,] 0.6442232 0.71155369 0.35577685
[70,] 0.6505027 0.69899461 0.34949730
[71,] 0.7419527 0.51609461 0.25804731
[72,] 0.7135322 0.57293557 0.28646779
[73,] 0.6816830 0.63663394 0.31831697
[74,] 0.6478756 0.70424875 0.35212437
[75,] 0.6052451 0.78950975 0.39475488
[76,] 0.7062562 0.58748760 0.29374380
[77,] 0.6739176 0.65216489 0.32608244
[78,] 0.6416530 0.71669403 0.35834701
[79,] 0.6247936 0.75041270 0.37520635
[80,] 0.5918695 0.81626094 0.40813047
[81,] 0.5822453 0.83550949 0.41775475
[82,] 0.5700263 0.85994740 0.42997370
[83,] 0.5903047 0.81939063 0.40969531
[84,] 0.5473719 0.90525616 0.45262808
[85,] 0.5019778 0.99604439 0.49802220
[86,] 0.4896233 0.97924659 0.51037671
[87,] 0.4530989 0.90619778 0.54690111
[88,] 0.4553715 0.91074303 0.54462848
[89,] 0.4191202 0.83824039 0.58087981
[90,] 0.3741709 0.74834173 0.62582914
[91,] 0.3766975 0.75339491 0.62330254
[92,] 0.3587989 0.71759781 0.64120110
[93,] 0.4120003 0.82400051 0.58799974
[94,] 0.3695889 0.73917778 0.63041111
[95,] 0.3485751 0.69715021 0.65142489
[96,] 0.3121642 0.62432848 0.68783576
[97,] 0.2710272 0.54205450 0.72897275
[98,] 0.4409271 0.88185429 0.55907286
[99,] 0.4043064 0.80861273 0.59569364
[100,] 0.4029866 0.80597325 0.59701338
[101,] 0.3607879 0.72157578 0.63921211
[102,] 0.3180406 0.63608121 0.68195939
[103,] 0.2978278 0.59565564 0.70217218
[104,] 0.2566194 0.51323874 0.74338063
[105,] 0.3901345 0.78026904 0.60986548
[106,] 0.3919863 0.78397254 0.60801373
[107,] 0.7394895 0.52102108 0.26051054
[108,] 0.7191926 0.56161478 0.28080739
[109,] 0.9663746 0.06725072 0.03362536
[110,] 0.9614772 0.07704555 0.03852278
[111,] 0.9505025 0.09899491 0.04949746
[112,] 0.9408706 0.11825885 0.05912943
[113,] 0.9414890 0.11702208 0.05851104
[114,] 0.9279301 0.14413970 0.07206985
[115,] 0.9187079 0.16258419 0.08129209
[116,] 0.9209473 0.15810541 0.07905270
[117,] 0.9080339 0.18393211 0.09196606
[118,] 0.8913256 0.21734885 0.10867442
[119,] 0.8948491 0.21030179 0.10515089
[120,] 0.9363761 0.12724772 0.06362386
[121,] 0.9459225 0.10815504 0.05407752
[122,] 0.9293703 0.14125949 0.07062975
[123,] 0.9380244 0.12395111 0.06197555
[124,] 0.9174492 0.16510154 0.08255077
[125,] 0.8949379 0.21012422 0.10506211
[126,] 0.8770232 0.24595365 0.12297683
[127,] 0.8422064 0.31558724 0.15779362
[128,] 0.8060198 0.38796031 0.19398016
[129,] 0.8467553 0.30648938 0.15324469
[130,] 0.8868873 0.22622536 0.11311268
[131,] 0.8644126 0.27117477 0.13558739
[132,] 0.8260142 0.34797159 0.17398580
[133,] 0.8366857 0.32662865 0.16331432
[134,] 0.7855233 0.42895338 0.21447669
[135,] 0.7274413 0.54511736 0.27255868
[136,] 0.6655438 0.66891243 0.33445622
[137,] 0.6666263 0.66674731 0.33337366
[138,] 0.6523112 0.69537765 0.34768883
[139,] 0.5754235 0.84915299 0.42457650
[140,] 0.5117989 0.97640224 0.48820112
[141,] 0.4251111 0.85022213 0.57488894
[142,] 0.5687531 0.86249371 0.43124686
[143,] 0.5671099 0.86578017 0.43289009
[144,] 0.5782299 0.84354028 0.42177014
[145,] 0.5075892 0.98482156 0.49241078
[146,] 0.4905266 0.98105329 0.50947335
[147,] 0.3666072 0.73321430 0.63339285
> postscript(file="/var/www/html/rcomp/tmp/114cm1291200690.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/html/rcomp/tmp/2cdbp1291200690.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/html/rcomp/tmp/3cdbp1291200690.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/html/rcomp/tmp/4cdbp1291200690.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/html/rcomp/tmp/5m4ta1291200690.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 = 160
Frequency = 1
1 2 3 4 5 6
-0.836626074 -0.551683953 2.164333039 2.259773292 0.284597584 -0.616281966
7 8 9 10 11 12
-0.762547153 -0.492720557 0.391965115 -0.830440762 -3.574087446 -0.303075144
13 14 15 16 17 18
-1.620405507 -0.277267436 0.798742087 2.253587981 -2.835666961 0.030821806
19 20 21 22 23 24
-0.906365970 -1.675353982 1.077139867 0.177061422 0.438283176 -0.574087446
25 26 27 28 29 30
0.130385600 -1.279244891 -1.659218847 -1.402030767 0.274454827 1.077139867
31 32 33 34 35 36
0.380671580 -0.916674822 0.389903345 1.268020374 0.170877379 1.280115014
37 38 39 40 41 42
-0.906365970 1.033217034 0.005563525 -0.078690543 1.077857925 1.016915805
43 44 45 46 47 48
0.087448719 1.071864280 1.010564399 -1.549346201 -0.542911748 0.091572260
49 50 51 52 53 54
-1.851058466 -1.545222660 -0.238644494 -0.433648541 -0.910489511 0.430036095
55 56 57 58 59 60
-3.897952794 -3.405252672 -2.397088637 -0.565840364 -1.506600986 2.425912554
61 62 63 64 65 66
-2.494506345 -0.354728022 -2.547284431 0.517864277 0.823807433 1.095695801
67 68 69 70 71 72
0.404335738 1.077857925 0.379594493 0.690187582 0.665915253 -0.737280785
73 74 75 76 77 78
-0.574087446 -0.669685706 1.251526210 1.425912554 2.432097865 -0.657157077
79 80 81 82 83 84
0.584907392 0.596726052 0.213455231 -2.431144695 -0.311432112 0.587135257
85 86 87 88 89 90
-0.972941438 0.584798774 1.229564794 1.164333039 -1.574087446 0.248505328
91 92 93 94 95 96
0.097757571 1.192921843 -0.574087446 1.381656263 -0.620405507 0.130385600
97 98 99 100 101 102
1.450653799 1.114583923 2.067273091 0.256752409 0.996132006 0.584907392
103 104 105 106 107 108
0.051439510 -2.818813769 -0.565840364 -1.214455212 0.383718034 -0.072505232
109 110 111 112 113 114
1.095695801 0.195949544 -2.565840364 1.296524862 -3.574087446 -0.572025676
115 116 117 118 119 120
-3.574087446 1.425912554 0.553980836 1.122664910 1.037007117 0.915124146
121 122 123 124 125 126
-0.281608215 -0.551683953 1.268186468 -0.327899436 0.955999257 -1.284353115
127 128 129 130 131 132
-0.646682130 0.939865391 1.748984884 0.164333039 0.866552648 1.480752410
133 134 135 136 137 138
0.672459593 0.197045383 2.507279443 -1.240706264 1.436221406 1.252244268
139 140 141 142 143 144
1.315080796 0.429076983 0.189984007 -1.317950881 -1.240155569 -1.380402808
145 146 147 148 149 150
0.568413229 0.205208149 1.437324064 -1.857243778 1.165659267 1.077139867
151 152 153 154 155 156
1.815919381 1.442406717 1.354254433 -0.545222660 -0.398958742 -0.549622183
157 158 159 160
-0.661280618 1.134868170 -1.620405507 2.274205685
> postscript(file="/var/www/html/rcomp/tmp/6m4ta1291200690.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 = 160
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.836626074 NA
1 -0.551683953 -0.836626074
2 2.164333039 -0.551683953
3 2.259773292 2.164333039
4 0.284597584 2.259773292
5 -0.616281966 0.284597584
6 -0.762547153 -0.616281966
7 -0.492720557 -0.762547153
8 0.391965115 -0.492720557
9 -0.830440762 0.391965115
10 -3.574087446 -0.830440762
11 -0.303075144 -3.574087446
12 -1.620405507 -0.303075144
13 -0.277267436 -1.620405507
14 0.798742087 -0.277267436
15 2.253587981 0.798742087
16 -2.835666961 2.253587981
17 0.030821806 -2.835666961
18 -0.906365970 0.030821806
19 -1.675353982 -0.906365970
20 1.077139867 -1.675353982
21 0.177061422 1.077139867
22 0.438283176 0.177061422
23 -0.574087446 0.438283176
24 0.130385600 -0.574087446
25 -1.279244891 0.130385600
26 -1.659218847 -1.279244891
27 -1.402030767 -1.659218847
28 0.274454827 -1.402030767
29 1.077139867 0.274454827
30 0.380671580 1.077139867
31 -0.916674822 0.380671580
32 0.389903345 -0.916674822
33 1.268020374 0.389903345
34 0.170877379 1.268020374
35 1.280115014 0.170877379
36 -0.906365970 1.280115014
37 1.033217034 -0.906365970
38 0.005563525 1.033217034
39 -0.078690543 0.005563525
40 1.077857925 -0.078690543
41 1.016915805 1.077857925
42 0.087448719 1.016915805
43 1.071864280 0.087448719
44 1.010564399 1.071864280
45 -1.549346201 1.010564399
46 -0.542911748 -1.549346201
47 0.091572260 -0.542911748
48 -1.851058466 0.091572260
49 -1.545222660 -1.851058466
50 -0.238644494 -1.545222660
51 -0.433648541 -0.238644494
52 -0.910489511 -0.433648541
53 0.430036095 -0.910489511
54 -3.897952794 0.430036095
55 -3.405252672 -3.897952794
56 -2.397088637 -3.405252672
57 -0.565840364 -2.397088637
58 -1.506600986 -0.565840364
59 2.425912554 -1.506600986
60 -2.494506345 2.425912554
61 -0.354728022 -2.494506345
62 -2.547284431 -0.354728022
63 0.517864277 -2.547284431
64 0.823807433 0.517864277
65 1.095695801 0.823807433
66 0.404335738 1.095695801
67 1.077857925 0.404335738
68 0.379594493 1.077857925
69 0.690187582 0.379594493
70 0.665915253 0.690187582
71 -0.737280785 0.665915253
72 -0.574087446 -0.737280785
73 -0.669685706 -0.574087446
74 1.251526210 -0.669685706
75 1.425912554 1.251526210
76 2.432097865 1.425912554
77 -0.657157077 2.432097865
78 0.584907392 -0.657157077
79 0.596726052 0.584907392
80 0.213455231 0.596726052
81 -2.431144695 0.213455231
82 -0.311432112 -2.431144695
83 0.587135257 -0.311432112
84 -0.972941438 0.587135257
85 0.584798774 -0.972941438
86 1.229564794 0.584798774
87 1.164333039 1.229564794
88 -1.574087446 1.164333039
89 0.248505328 -1.574087446
90 0.097757571 0.248505328
91 1.192921843 0.097757571
92 -0.574087446 1.192921843
93 1.381656263 -0.574087446
94 -0.620405507 1.381656263
95 0.130385600 -0.620405507
96 1.450653799 0.130385600
97 1.114583923 1.450653799
98 2.067273091 1.114583923
99 0.256752409 2.067273091
100 0.996132006 0.256752409
101 0.584907392 0.996132006
102 0.051439510 0.584907392
103 -2.818813769 0.051439510
104 -0.565840364 -2.818813769
105 -1.214455212 -0.565840364
106 0.383718034 -1.214455212
107 -0.072505232 0.383718034
108 1.095695801 -0.072505232
109 0.195949544 1.095695801
110 -2.565840364 0.195949544
111 1.296524862 -2.565840364
112 -3.574087446 1.296524862
113 -0.572025676 -3.574087446
114 -3.574087446 -0.572025676
115 1.425912554 -3.574087446
116 0.553980836 1.425912554
117 1.122664910 0.553980836
118 1.037007117 1.122664910
119 0.915124146 1.037007117
120 -0.281608215 0.915124146
121 -0.551683953 -0.281608215
122 1.268186468 -0.551683953
123 -0.327899436 1.268186468
124 0.955999257 -0.327899436
125 -1.284353115 0.955999257
126 -0.646682130 -1.284353115
127 0.939865391 -0.646682130
128 1.748984884 0.939865391
129 0.164333039 1.748984884
130 0.866552648 0.164333039
131 1.480752410 0.866552648
132 0.672459593 1.480752410
133 0.197045383 0.672459593
134 2.507279443 0.197045383
135 -1.240706264 2.507279443
136 1.436221406 -1.240706264
137 1.252244268 1.436221406
138 1.315080796 1.252244268
139 0.429076983 1.315080796
140 0.189984007 0.429076983
141 -1.317950881 0.189984007
142 -1.240155569 -1.317950881
143 -1.380402808 -1.240155569
144 0.568413229 -1.380402808
145 0.205208149 0.568413229
146 1.437324064 0.205208149
147 -1.857243778 1.437324064
148 1.165659267 -1.857243778
149 1.077139867 1.165659267
150 1.815919381 1.077139867
151 1.442406717 1.815919381
152 1.354254433 1.442406717
153 -0.545222660 1.354254433
154 -0.398958742 -0.545222660
155 -0.549622183 -0.398958742
156 -0.661280618 -0.549622183
157 1.134868170 -0.661280618
158 -1.620405507 1.134868170
159 2.274205685 -1.620405507
160 NA 2.274205685
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.551683953 -0.836626074
[2,] 2.164333039 -0.551683953
[3,] 2.259773292 2.164333039
[4,] 0.284597584 2.259773292
[5,] -0.616281966 0.284597584
[6,] -0.762547153 -0.616281966
[7,] -0.492720557 -0.762547153
[8,] 0.391965115 -0.492720557
[9,] -0.830440762 0.391965115
[10,] -3.574087446 -0.830440762
[11,] -0.303075144 -3.574087446
[12,] -1.620405507 -0.303075144
[13,] -0.277267436 -1.620405507
[14,] 0.798742087 -0.277267436
[15,] 2.253587981 0.798742087
[16,] -2.835666961 2.253587981
[17,] 0.030821806 -2.835666961
[18,] -0.906365970 0.030821806
[19,] -1.675353982 -0.906365970
[20,] 1.077139867 -1.675353982
[21,] 0.177061422 1.077139867
[22,] 0.438283176 0.177061422
[23,] -0.574087446 0.438283176
[24,] 0.130385600 -0.574087446
[25,] -1.279244891 0.130385600
[26,] -1.659218847 -1.279244891
[27,] -1.402030767 -1.659218847
[28,] 0.274454827 -1.402030767
[29,] 1.077139867 0.274454827
[30,] 0.380671580 1.077139867
[31,] -0.916674822 0.380671580
[32,] 0.389903345 -0.916674822
[33,] 1.268020374 0.389903345
[34,] 0.170877379 1.268020374
[35,] 1.280115014 0.170877379
[36,] -0.906365970 1.280115014
[37,] 1.033217034 -0.906365970
[38,] 0.005563525 1.033217034
[39,] -0.078690543 0.005563525
[40,] 1.077857925 -0.078690543
[41,] 1.016915805 1.077857925
[42,] 0.087448719 1.016915805
[43,] 1.071864280 0.087448719
[44,] 1.010564399 1.071864280
[45,] -1.549346201 1.010564399
[46,] -0.542911748 -1.549346201
[47,] 0.091572260 -0.542911748
[48,] -1.851058466 0.091572260
[49,] -1.545222660 -1.851058466
[50,] -0.238644494 -1.545222660
[51,] -0.433648541 -0.238644494
[52,] -0.910489511 -0.433648541
[53,] 0.430036095 -0.910489511
[54,] -3.897952794 0.430036095
[55,] -3.405252672 -3.897952794
[56,] -2.397088637 -3.405252672
[57,] -0.565840364 -2.397088637
[58,] -1.506600986 -0.565840364
[59,] 2.425912554 -1.506600986
[60,] -2.494506345 2.425912554
[61,] -0.354728022 -2.494506345
[62,] -2.547284431 -0.354728022
[63,] 0.517864277 -2.547284431
[64,] 0.823807433 0.517864277
[65,] 1.095695801 0.823807433
[66,] 0.404335738 1.095695801
[67,] 1.077857925 0.404335738
[68,] 0.379594493 1.077857925
[69,] 0.690187582 0.379594493
[70,] 0.665915253 0.690187582
[71,] -0.737280785 0.665915253
[72,] -0.574087446 -0.737280785
[73,] -0.669685706 -0.574087446
[74,] 1.251526210 -0.669685706
[75,] 1.425912554 1.251526210
[76,] 2.432097865 1.425912554
[77,] -0.657157077 2.432097865
[78,] 0.584907392 -0.657157077
[79,] 0.596726052 0.584907392
[80,] 0.213455231 0.596726052
[81,] -2.431144695 0.213455231
[82,] -0.311432112 -2.431144695
[83,] 0.587135257 -0.311432112
[84,] -0.972941438 0.587135257
[85,] 0.584798774 -0.972941438
[86,] 1.229564794 0.584798774
[87,] 1.164333039 1.229564794
[88,] -1.574087446 1.164333039
[89,] 0.248505328 -1.574087446
[90,] 0.097757571 0.248505328
[91,] 1.192921843 0.097757571
[92,] -0.574087446 1.192921843
[93,] 1.381656263 -0.574087446
[94,] -0.620405507 1.381656263
[95,] 0.130385600 -0.620405507
[96,] 1.450653799 0.130385600
[97,] 1.114583923 1.450653799
[98,] 2.067273091 1.114583923
[99,] 0.256752409 2.067273091
[100,] 0.996132006 0.256752409
[101,] 0.584907392 0.996132006
[102,] 0.051439510 0.584907392
[103,] -2.818813769 0.051439510
[104,] -0.565840364 -2.818813769
[105,] -1.214455212 -0.565840364
[106,] 0.383718034 -1.214455212
[107,] -0.072505232 0.383718034
[108,] 1.095695801 -0.072505232
[109,] 0.195949544 1.095695801
[110,] -2.565840364 0.195949544
[111,] 1.296524862 -2.565840364
[112,] -3.574087446 1.296524862
[113,] -0.572025676 -3.574087446
[114,] -3.574087446 -0.572025676
[115,] 1.425912554 -3.574087446
[116,] 0.553980836 1.425912554
[117,] 1.122664910 0.553980836
[118,] 1.037007117 1.122664910
[119,] 0.915124146 1.037007117
[120,] -0.281608215 0.915124146
[121,] -0.551683953 -0.281608215
[122,] 1.268186468 -0.551683953
[123,] -0.327899436 1.268186468
[124,] 0.955999257 -0.327899436
[125,] -1.284353115 0.955999257
[126,] -0.646682130 -1.284353115
[127,] 0.939865391 -0.646682130
[128,] 1.748984884 0.939865391
[129,] 0.164333039 1.748984884
[130,] 0.866552648 0.164333039
[131,] 1.480752410 0.866552648
[132,] 0.672459593 1.480752410
[133,] 0.197045383 0.672459593
[134,] 2.507279443 0.197045383
[135,] -1.240706264 2.507279443
[136,] 1.436221406 -1.240706264
[137,] 1.252244268 1.436221406
[138,] 1.315080796 1.252244268
[139,] 0.429076983 1.315080796
[140,] 0.189984007 0.429076983
[141,] -1.317950881 0.189984007
[142,] -1.240155569 -1.317950881
[143,] -1.380402808 -1.240155569
[144,] 0.568413229 -1.380402808
[145,] 0.205208149 0.568413229
[146,] 1.437324064 0.205208149
[147,] -1.857243778 1.437324064
[148,] 1.165659267 -1.857243778
[149,] 1.077139867 1.165659267
[150,] 1.815919381 1.077139867
[151,] 1.442406717 1.815919381
[152,] 1.354254433 1.442406717
[153,] -0.545222660 1.354254433
[154,] -0.398958742 -0.545222660
[155,] -0.549622183 -0.398958742
[156,] -0.661280618 -0.549622183
[157,] 1.134868170 -0.661280618
[158,] -1.620405507 1.134868170
[159,] 2.274205685 -1.620405507
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.551683953 -0.836626074
2 2.164333039 -0.551683953
3 2.259773292 2.164333039
4 0.284597584 2.259773292
5 -0.616281966 0.284597584
6 -0.762547153 -0.616281966
7 -0.492720557 -0.762547153
8 0.391965115 -0.492720557
9 -0.830440762 0.391965115
10 -3.574087446 -0.830440762
11 -0.303075144 -3.574087446
12 -1.620405507 -0.303075144
13 -0.277267436 -1.620405507
14 0.798742087 -0.277267436
15 2.253587981 0.798742087
16 -2.835666961 2.253587981
17 0.030821806 -2.835666961
18 -0.906365970 0.030821806
19 -1.675353982 -0.906365970
20 1.077139867 -1.675353982
21 0.177061422 1.077139867
22 0.438283176 0.177061422
23 -0.574087446 0.438283176
24 0.130385600 -0.574087446
25 -1.279244891 0.130385600
26 -1.659218847 -1.279244891
27 -1.402030767 -1.659218847
28 0.274454827 -1.402030767
29 1.077139867 0.274454827
30 0.380671580 1.077139867
31 -0.916674822 0.380671580
32 0.389903345 -0.916674822
33 1.268020374 0.389903345
34 0.170877379 1.268020374
35 1.280115014 0.170877379
36 -0.906365970 1.280115014
37 1.033217034 -0.906365970
38 0.005563525 1.033217034
39 -0.078690543 0.005563525
40 1.077857925 -0.078690543
41 1.016915805 1.077857925
42 0.087448719 1.016915805
43 1.071864280 0.087448719
44 1.010564399 1.071864280
45 -1.549346201 1.010564399
46 -0.542911748 -1.549346201
47 0.091572260 -0.542911748
48 -1.851058466 0.091572260
49 -1.545222660 -1.851058466
50 -0.238644494 -1.545222660
51 -0.433648541 -0.238644494
52 -0.910489511 -0.433648541
53 0.430036095 -0.910489511
54 -3.897952794 0.430036095
55 -3.405252672 -3.897952794
56 -2.397088637 -3.405252672
57 -0.565840364 -2.397088637
58 -1.506600986 -0.565840364
59 2.425912554 -1.506600986
60 -2.494506345 2.425912554
61 -0.354728022 -2.494506345
62 -2.547284431 -0.354728022
63 0.517864277 -2.547284431
64 0.823807433 0.517864277
65 1.095695801 0.823807433
66 0.404335738 1.095695801
67 1.077857925 0.404335738
68 0.379594493 1.077857925
69 0.690187582 0.379594493
70 0.665915253 0.690187582
71 -0.737280785 0.665915253
72 -0.574087446 -0.737280785
73 -0.669685706 -0.574087446
74 1.251526210 -0.669685706
75 1.425912554 1.251526210
76 2.432097865 1.425912554
77 -0.657157077 2.432097865
78 0.584907392 -0.657157077
79 0.596726052 0.584907392
80 0.213455231 0.596726052
81 -2.431144695 0.213455231
82 -0.311432112 -2.431144695
83 0.587135257 -0.311432112
84 -0.972941438 0.587135257
85 0.584798774 -0.972941438
86 1.229564794 0.584798774
87 1.164333039 1.229564794
88 -1.574087446 1.164333039
89 0.248505328 -1.574087446
90 0.097757571 0.248505328
91 1.192921843 0.097757571
92 -0.574087446 1.192921843
93 1.381656263 -0.574087446
94 -0.620405507 1.381656263
95 0.130385600 -0.620405507
96 1.450653799 0.130385600
97 1.114583923 1.450653799
98 2.067273091 1.114583923
99 0.256752409 2.067273091
100 0.996132006 0.256752409
101 0.584907392 0.996132006
102 0.051439510 0.584907392
103 -2.818813769 0.051439510
104 -0.565840364 -2.818813769
105 -1.214455212 -0.565840364
106 0.383718034 -1.214455212
107 -0.072505232 0.383718034
108 1.095695801 -0.072505232
109 0.195949544 1.095695801
110 -2.565840364 0.195949544
111 1.296524862 -2.565840364
112 -3.574087446 1.296524862
113 -0.572025676 -3.574087446
114 -3.574087446 -0.572025676
115 1.425912554 -3.574087446
116 0.553980836 1.425912554
117 1.122664910 0.553980836
118 1.037007117 1.122664910
119 0.915124146 1.037007117
120 -0.281608215 0.915124146
121 -0.551683953 -0.281608215
122 1.268186468 -0.551683953
123 -0.327899436 1.268186468
124 0.955999257 -0.327899436
125 -1.284353115 0.955999257
126 -0.646682130 -1.284353115
127 0.939865391 -0.646682130
128 1.748984884 0.939865391
129 0.164333039 1.748984884
130 0.866552648 0.164333039
131 1.480752410 0.866552648
132 0.672459593 1.480752410
133 0.197045383 0.672459593
134 2.507279443 0.197045383
135 -1.240706264 2.507279443
136 1.436221406 -1.240706264
137 1.252244268 1.436221406
138 1.315080796 1.252244268
139 0.429076983 1.315080796
140 0.189984007 0.429076983
141 -1.317950881 0.189984007
142 -1.240155569 -1.317950881
143 -1.380402808 -1.240155569
144 0.568413229 -1.380402808
145 0.205208149 0.568413229
146 1.437324064 0.205208149
147 -1.857243778 1.437324064
148 1.165659267 -1.857243778
149 1.077139867 1.165659267
150 1.815919381 1.077139867
151 1.442406717 1.815919381
152 1.354254433 1.442406717
153 -0.545222660 1.354254433
154 -0.398958742 -0.545222660
155 -0.549622183 -0.398958742
156 -0.661280618 -0.549622183
157 1.134868170 -0.661280618
158 -1.620405507 1.134868170
159 2.274205685 -1.620405507
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7fesv1291200690.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/html/rcomp/tmp/8fesv1291200690.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/html/rcomp/tmp/9859g1291200690.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/html/rcomp/tmp/10859g1291200690.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11t58m1291200690.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12wooa1291200690.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/133pll1291200690.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14eyk61291200690.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15hh1u1291200690.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16vqzl1291200690.tab")
+ }
>
> try(system("convert tmp/114cm1291200690.ps tmp/114cm1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/2cdbp1291200690.ps tmp/2cdbp1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/3cdbp1291200690.ps tmp/3cdbp1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/4cdbp1291200690.ps tmp/4cdbp1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/5m4ta1291200690.ps tmp/5m4ta1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/6m4ta1291200690.ps tmp/6m4ta1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/7fesv1291200690.ps tmp/7fesv1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/8fesv1291200690.ps tmp/8fesv1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/9859g1291200690.ps tmp/9859g1291200690.png",intern=TRUE))
character(0)
> try(system("convert tmp/10859g1291200690.ps tmp/10859g1291200690.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.104 1.786 9.325