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(14
+ ,11
+ ,12
+ ,24
+ ,24
+ ,11
+ ,7
+ ,8
+ ,25
+ ,25
+ ,6
+ ,17
+ ,8
+ ,30
+ ,17
+ ,12
+ ,10
+ ,8
+ ,19
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,18
+ ,10
+ ,12
+ ,7
+ ,22
+ ,16
+ ,10
+ ,11
+ ,4
+ ,25
+ ,20
+ ,11
+ ,11
+ ,11
+ ,23
+ ,16
+ ,16
+ ,12
+ ,7
+ ,17
+ ,18
+ ,11
+ ,13
+ ,7
+ ,21
+ ,17
+ ,13
+ ,14
+ ,12
+ ,19
+ ,23
+ ,12
+ ,16
+ ,10
+ ,19
+ ,30
+ ,8
+ ,11
+ ,10
+ ,15
+ ,23
+ ,12
+ ,10
+ ,8
+ ,16
+ ,18
+ ,11
+ ,11
+ ,8
+ ,23
+ ,15
+ ,4
+ ,15
+ ,4
+ ,27
+ ,12
+ ,9
+ ,9
+ ,9
+ ,22
+ ,21
+ ,8
+ ,11
+ ,8
+ ,14
+ ,15
+ ,8
+ ,17
+ ,7
+ ,22
+ ,20
+ ,14
+ ,17
+ ,11
+ ,23
+ ,31
+ ,15
+ ,11
+ ,9
+ ,23
+ ,27
+ ,16
+ ,18
+ ,11
+ ,21
+ ,34
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,14
+ ,10
+ ,8
+ ,18
+ ,31
+ ,11
+ ,11
+ ,8
+ ,20
+ ,19
+ ,8
+ ,15
+ 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im=c(5,159),dimnames=list(c('DA','PC','PE','PS','CM'),1:159))
> 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 = '5'
> #'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
CM DA PC PE PS
1 24 14 11 12 24
2 25 11 7 8 25
3 17 6 17 8 30
4 18 12 10 8 19
5 18 8 12 9 22
6 16 10 12 7 22
7 20 10 11 4 25
8 16 11 11 11 23
9 18 16 12 7 17
10 17 11 13 7 21
11 23 13 14 12 19
12 30 12 16 10 19
13 23 8 11 10 15
14 18 12 10 8 16
15 15 11 11 8 23
16 12 4 15 4 27
17 21 9 9 9 22
18 15 8 11 8 14
19 20 8 17 7 22
20 31 14 17 11 23
21 27 15 11 9 23
22 34 16 18 11 21
23 21 9 14 13 19
24 31 14 10 8 18
25 19 11 11 8 20
26 16 8 15 9 23
27 20 9 15 6 25
28 21 9 13 9 19
29 22 9 16 9 24
30 17 9 13 6 22
31 24 10 9 6 25
32 25 16 18 16 26
33 26 11 18 5 29
34 25 8 12 7 32
35 17 9 17 9 25
36 32 16 9 6 29
37 33 11 9 6 28
38 13 16 12 5 17
39 32 12 18 12 28
40 25 12 12 7 29
41 29 14 18 10 26
42 22 9 14 9 25
43 18 10 15 8 14
44 17 9 16 5 25
45 20 10 10 8 26
46 15 12 11 8 20
47 20 14 14 10 18
48 33 14 9 6 32
49 29 10 12 8 25
50 23 14 17 7 25
51 26 16 5 4 23
52 18 9 12 8 21
53 20 10 12 8 20
54 11 6 6 4 15
55 28 8 24 20 30
56 26 13 12 8 24
57 22 10 12 8 26
58 17 8 14 6 24
59 12 7 7 4 22
60 14 15 13 8 14
61 17 9 12 9 24
62 21 10 13 6 24
63 19 12 14 7 24
64 18 13 8 9 24
65 10 10 11 5 19
66 29 11 9 5 31
67 31 8 11 8 22
68 19 9 13 8 27
69 9 13 10 6 19
70 20 11 11 8 25
71 28 8 12 7 20
72 19 9 9 7 21
73 30 9 15 9 27
74 29 15 18 11 23
75 26 9 15 6 25
76 23 10 12 8 20
77 13 14 13 6 21
78 21 12 14 9 22
79 19 12 10 8 23
80 28 11 13 6 25
81 23 14 13 10 25
82 18 6 11 8 17
83 21 12 13 8 19
84 20 8 16 10 25
85 23 14 8 5 19
86 21 11 16 7 20
87 21 10 11 5 26
88 15 14 9 8 23
89 28 12 16 14 27
90 19 10 12 7 17
91 26 14 14 8 17
92 10 5 8 6 19
93 16 11 9 5 17
94 22 10 15 6 22
95 19 9 11 10 21
96 31 10 21 12 32
97 31 16 14 9 21
98 29 13 18 12 21
99 19 9 12 7 18
100 22 10 13 8 18
101 23 10 15 10 23
102 15 7 12 6 19
103 20 9 19 10 20
104 18 8 15 10 21
105 23 14 11 10 20
106 25 14 11 5 17
107 21 8 10 7 18
108 24 9 13 10 19
109 25 14 15 11 22
110 17 14 12 6 15
111 13 8 12 7 14
112 28 8 16 12 18
113 21 8 9 11 24
114 25 7 18 11 35
115 9 6 8 11 29
116 16 8 13 5 21
117 19 6 17 8 25
118 17 11 9 6 20
119 25 14 15 9 22
120 20 11 8 4 13
121 29 11 7 4 26
122 14 11 12 7 17
123 22 14 14 11 25
124 15 8 6 6 20
125 19 20 8 7 19
126 20 11 17 8 21
127 15 8 10 4 22
128 20 11 11 8 24
129 18 10 14 9 21
130 33 14 11 8 26
131 22 11 13 11 24
132 16 9 12 8 16
133 17 9 11 5 23
134 16 8 9 4 18
135 21 10 12 8 16
136 26 13 20 10 26
137 18 13 12 6 19
138 18 12 13 9 21
139 17 8 12 9 21
140 22 13 12 13 22
141 30 14 9 9 23
142 30 12 15 10 29
143 24 14 24 20 21
144 21 15 7 5 21
145 21 13 17 11 23
146 29 16 11 6 27
147 31 9 17 9 25
148 20 9 11 7 21
149 16 9 12 9 10
150 22 8 14 10 20
151 20 7 11 9 26
152 28 16 16 8 24
153 38 11 21 7 29
154 22 9 14 6 19
155 20 11 20 13 24
156 17 9 13 6 19
157 28 14 11 8 24
158 22 13 15 10 22
159 31 16 19 16 17
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) DA PC PE PS
-3.8703 0.7913 0.2707 0.2198 0.5214
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-11.5826 -2.5898 -0.3953 2.9888 12.3320
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.87026 2.54435 -1.521 0.1303
DA 0.79135 0.12937 6.117 7.54e-09 ***
PC 0.27070 0.13174 2.055 0.0416 *
PE 0.21984 0.16607 1.324 0.1875
PS 0.52141 0.08725 5.976 1.53e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.482 on 154 degrees of freedom
Multiple R-squared: 0.4023, Adjusted R-squared: 0.3868
F-statistic: 25.91 on 4 and 154 DF, p-value: < 2.2e-16
> 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.21164045 0.42328090 0.78835955
[2,] 0.10363260 0.20726520 0.89636740
[3,] 0.04628332 0.09256665 0.95371668
[4,] 0.13645346 0.27290691 0.86354654
[5,] 0.67857177 0.64285646 0.32142823
[6,] 0.64341408 0.71317185 0.35658592
[7,] 0.56778356 0.86443288 0.43221644
[8,] 0.56912256 0.86175488 0.43087744
[9,] 0.51328348 0.97343304 0.48671652
[10,] 0.43644529 0.87289057 0.56355471
[11,] 0.39244059 0.78488117 0.60755941
[12,] 0.33385110 0.66770221 0.66614890
[13,] 0.38999977 0.77999954 0.61000023
[14,] 0.36591189 0.73182377 0.63408811
[15,] 0.38586483 0.77172966 0.61413517
[16,] 0.33290828 0.66581656 0.66709172
[17,] 0.56308258 0.87383484 0.43691742
[18,] 0.49768262 0.99536524 0.50231738
[19,] 0.47391917 0.94783833 0.52608083
[20,] 0.41538030 0.83076061 0.58461970
[21,] 0.36389869 0.72779739 0.63610131
[22,] 0.30702160 0.61404320 0.69297840
[23,] 0.25786559 0.51573119 0.74213441
[24,] 0.30240882 0.60481763 0.69759118
[25,] 0.36685359 0.73370718 0.63314641
[26,] 0.33902860 0.67805720 0.66097140
[27,] 0.36120789 0.72241579 0.63879211
[28,] 0.36844455 0.73688909 0.63155545
[29,] 0.36147449 0.72294898 0.63852551
[30,] 0.57757820 0.84484360 0.42242180
[31,] 0.78260517 0.43478966 0.21739483
[32,] 0.78440529 0.43118942 0.21559471
[33,] 0.74349492 0.51301016 0.25650508
[34,] 0.70288439 0.59423121 0.29711561
[35,] 0.65514640 0.68970721 0.34485360
[36,] 0.61136855 0.77726289 0.38863145
[37,] 0.59743238 0.80513525 0.40256762
[38,] 0.56029152 0.87941696 0.43970848
[39,] 0.59984731 0.80030538 0.40015269
[40,] 0.56831484 0.86337031 0.43168516
[41,] 0.57170933 0.85658133 0.42829067
[42,] 0.63706096 0.72587809 0.36293904
[43,] 0.61013594 0.77972813 0.38986406
[44,] 0.57705885 0.84588229 0.42294115
[45,] 0.52998731 0.94002538 0.47001269
[46,] 0.48140497 0.96280994 0.51859503
[47,] 0.43221093 0.86442187 0.56778907
[48,] 0.38569053 0.77138106 0.61430947
[49,] 0.34742376 0.69484752 0.65257624
[50,] 0.30429493 0.60858986 0.69570507
[51,] 0.27840891 0.55681781 0.72159109
[52,] 0.26849366 0.53698733 0.73150634
[53,] 0.30999907 0.61999813 0.69000093
[54,] 0.30288046 0.60576092 0.69711954
[55,] 0.26412760 0.52825520 0.73587240
[56,] 0.26095480 0.52190960 0.73904520
[57,] 0.29532353 0.59064706 0.70467647
[58,] 0.37883837 0.75767674 0.62116163
[59,] 0.37322311 0.74644623 0.62677689
[60,] 0.69283312 0.61433377 0.30716688
[61,] 0.67883612 0.64232777 0.32116388
[62,] 0.86080276 0.27839448 0.13919724
[63,] 0.84353945 0.31292109 0.15646055
[64,] 0.93968161 0.12063678 0.06031839
[65,] 0.92509482 0.14981036 0.07490518
[66,] 0.94313747 0.11372507 0.05686253
[67,] 0.93179616 0.13640768 0.06820384
[68,] 0.93209100 0.13581800 0.06790900
[69,] 0.92678058 0.14643885 0.07321942
[70,] 0.97445070 0.05109859 0.02554930
[71,] 0.96831050 0.06337901 0.03168950
[72,] 0.96367168 0.07265663 0.03632832
[73,] 0.96725762 0.06548475 0.03274238
[74,] 0.96211292 0.07577415 0.03788708
[75,] 0.95908341 0.08183318 0.04091659
[76,] 0.94820630 0.10358740 0.05179370
[77,] 0.93779673 0.12440654 0.06220327
[78,] 0.92815385 0.14369230 0.07184615
[79,] 0.91437474 0.17125052 0.08562526
[80,] 0.89556828 0.20886344 0.10443172
[81,] 0.94086410 0.11827180 0.05913590
[82,] 0.92770518 0.14458964 0.07229482
[83,] 0.91184445 0.17631111 0.08815555
[84,] 0.91050461 0.17899078 0.08949539
[85,] 0.90243023 0.19513954 0.09756977
[86,] 0.88426547 0.23146906 0.11573453
[87,] 0.86237573 0.27524853 0.13762427
[88,] 0.83484820 0.33030360 0.16515180
[89,] 0.80848042 0.38303916 0.19151958
[90,] 0.82151983 0.35696033 0.17848017
[91,] 0.81690059 0.36619883 0.18309941
[92,] 0.78646593 0.42706814 0.21353407
[93,] 0.76761874 0.46476251 0.23238126
[94,] 0.72965903 0.54068194 0.27034097
[95,] 0.69457131 0.61085738 0.30542869
[96,] 0.65650783 0.68698433 0.34349217
[97,] 0.61743733 0.76512534 0.38256267
[98,] 0.57065693 0.85868614 0.42934307
[99,] 0.56746907 0.86506186 0.43253093
[100,] 0.57380478 0.85239044 0.42619522
[101,] 0.59523785 0.80952431 0.40476215
[102,] 0.54568963 0.90862074 0.45431037
[103,] 0.52279764 0.95440473 0.47720236
[104,] 0.48224883 0.96449765 0.51775117
[105,] 0.67534076 0.64931848 0.32465924
[106,] 0.66448609 0.67102782 0.33551391
[107,] 0.62316055 0.75367890 0.37683945
[108,] 0.81560937 0.36878126 0.18439063
[109,] 0.79809273 0.40381454 0.20190727
[110,] 0.77552822 0.44894356 0.22447178
[111,] 0.74561190 0.50877620 0.25438810
[112,] 0.69903217 0.60193566 0.30096783
[113,] 0.73282052 0.53435895 0.26717948
[114,] 0.79029878 0.41940244 0.20970122
[115,] 0.78681517 0.42636965 0.21318483
[116,] 0.78611117 0.42777766 0.21388883
[117,] 0.74203434 0.51593133 0.25796566
[118,] 0.78969682 0.42060636 0.21030318
[119,] 0.76700292 0.46599416 0.23299708
[120,] 0.75901609 0.48196781 0.24098391
[121,] 0.73089538 0.53820924 0.26910462
[122,] 0.70790104 0.58419792 0.29209896
[123,] 0.77456523 0.45086954 0.22543477
[124,] 0.72564186 0.54871627 0.27435814
[125,] 0.67008522 0.65982956 0.32991478
[126,] 0.66941849 0.66116302 0.33058151
[127,] 0.61281078 0.77437844 0.38718922
[128,] 0.57703315 0.84593371 0.42296685
[129,] 0.55170105 0.89659790 0.44829895
[130,] 0.55907509 0.88184981 0.44092491
[131,] 0.57993074 0.84013852 0.42006926
[132,] 0.52830852 0.94338296 0.47169148
[133,] 0.45209676 0.90419353 0.54790324
[134,] 0.56424147 0.87151705 0.43575853
[135,] 0.50568955 0.98862090 0.49431045
[136,] 0.45715762 0.91431524 0.54284238
[137,] 0.37209252 0.74418505 0.62790748
[138,] 0.44099817 0.88199635 0.55900183
[139,] 0.34422213 0.68844426 0.65577787
[140,] 0.38681522 0.77363043 0.61318478
[141,] 0.28238787 0.56477575 0.71761213
[142,] 0.19724511 0.39449023 0.80275489
[143,] 0.15534728 0.31069455 0.84465272
[144,] 0.11629536 0.23259073 0.88370464
> postscript(file="/var/www/rcomp/tmp/1qohm1293045088.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/2jxgq1293045088.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/3jxgq1293045088.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/4jxgq1293045088.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/5t6yb1293045088.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
-1.33830642 3.47652676 -5.88080815 -1.99848637 -1.15856427 -4.30157629
7 8 9 10 11 12
-0.93556545 -6.22300510 -4.44263374 -3.84222208 0.24797177 7.93760055
13 14 15 16 17 18
7.54215389 -0.43426165 -6.56347380 -6.31310031 1.86219874 0.50324966
19 20 21 22 23 24
-0.07239803 4.77872003 2.05128334 6.96813270 1.19352710 9.94022232
25 26 27 28 29 30
-0.99924909 -4.49208528 -1.66672024 2.34360641 -0.07554755 -2.56108701
31 32 33 34 35 36
3.16615554 -5.73812731 0.07267825 1.06704088 -5.86766005 4.33242395
37 38 39 40 41 42
9.81058105 -9.00294621 4.26383036 -0.53413350 1.16363482 -0.05554727
43 44 45 46 47 48
0.83773308 -4.71758073 -2.06564448 -5.79059886 -2.58228224 5.35089878
49 50 51 52 53 54
6.91435524 -3.38472139 2.98337794 -1.20866204 0.52139643 -0.20256268
55 56 57 58 59 60
-0.99656268 2.06171415 -0.60705300 -3.08325797 -3.91447438 -6.57760728
61 62 63 64 65 66
-3.99273052 -0.39525325 -4.46850083 -5.07531258 -8.02695978 4.46620011
67 68 69 70 71 72
12.33198376 -3.60781572 -11.35014861 -2.60629028 10.32393974 0.82329450
73 74 75 76 77 78
6.63093199 1.71666600 4.33327976 3.52139643 -9.99642764 -1.86537188
79 80 81 82 83 84
-3.08411932 5.29198873 -2.96143565 3.52172449 0.18940086 -2.02544978
85 86 87 88 89 90
2.61975390 -0.13292662 -0.67681745 -8.39611461 0.88695959 1.30546490
91 92 93 94 95 96
4.37881353 -3.47794190 -1.23408456 1.10615470 -0.37764531 1.94878419
97 98 99 100 101 102
5.49063726 4.12233826 1.57540644 3.29350864 0.70537141 -1.14345848
103 104 105 106 107 108
-1.02187114 -1.66911257 0.18701406 4.85045760 4.90816473 5.12376265
109 110 111 112 113 114
-0.15846322 -2.59727395 -1.54761083 9.18472036 1.17104451 -2.20943467
115 116 117 118 119 120
-11.58259288 -2.02848523 -1.27376696 -2.01815304 0.28122431 5.34209641
121 122 123 124 125 126
7.83449358 -4.48588487 -4.45198367 -0.83199094 -6.56803228 -2.14488288
127 128 129 130 131 132
-2.51793693 -2.08488204 -2.76126409 7.49825216 -1.28582185 -0.60162085
133 134 135 136 137 138
-2.32124296 0.83840028 3.60702938 -1.58642392 -2.89155713 -4.07325938
139 140 141 142 143 144
-1.63715603 -1.99468819 6.38404163 2.99422243 -5.05198719 -0.94370809
145 146 147 148 149 150
-4.42993020 1.83383190 8.13233995 1.28188599 2.30698481 3.12299993
151 152 153 154 155 156
-0.18214318 0.60484780 10.82087795 3.73243345 -5.62043919 -0.99686229
157 158 159
3.54106864 -2.14726968 4.68384257
> postscript(file="/var/www/rcomp/tmp/6t6yb1293045088.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 -1.33830642 NA
1 3.47652676 -1.33830642
2 -5.88080815 3.47652676
3 -1.99848637 -5.88080815
4 -1.15856427 -1.99848637
5 -4.30157629 -1.15856427
6 -0.93556545 -4.30157629
7 -6.22300510 -0.93556545
8 -4.44263374 -6.22300510
9 -3.84222208 -4.44263374
10 0.24797177 -3.84222208
11 7.93760055 0.24797177
12 7.54215389 7.93760055
13 -0.43426165 7.54215389
14 -6.56347380 -0.43426165
15 -6.31310031 -6.56347380
16 1.86219874 -6.31310031
17 0.50324966 1.86219874
18 -0.07239803 0.50324966
19 4.77872003 -0.07239803
20 2.05128334 4.77872003
21 6.96813270 2.05128334
22 1.19352710 6.96813270
23 9.94022232 1.19352710
24 -0.99924909 9.94022232
25 -4.49208528 -0.99924909
26 -1.66672024 -4.49208528
27 2.34360641 -1.66672024
28 -0.07554755 2.34360641
29 -2.56108701 -0.07554755
30 3.16615554 -2.56108701
31 -5.73812731 3.16615554
32 0.07267825 -5.73812731
33 1.06704088 0.07267825
34 -5.86766005 1.06704088
35 4.33242395 -5.86766005
36 9.81058105 4.33242395
37 -9.00294621 9.81058105
38 4.26383036 -9.00294621
39 -0.53413350 4.26383036
40 1.16363482 -0.53413350
41 -0.05554727 1.16363482
42 0.83773308 -0.05554727
43 -4.71758073 0.83773308
44 -2.06564448 -4.71758073
45 -5.79059886 -2.06564448
46 -2.58228224 -5.79059886
47 5.35089878 -2.58228224
48 6.91435524 5.35089878
49 -3.38472139 6.91435524
50 2.98337794 -3.38472139
51 -1.20866204 2.98337794
52 0.52139643 -1.20866204
53 -0.20256268 0.52139643
54 -0.99656268 -0.20256268
55 2.06171415 -0.99656268
56 -0.60705300 2.06171415
57 -3.08325797 -0.60705300
58 -3.91447438 -3.08325797
59 -6.57760728 -3.91447438
60 -3.99273052 -6.57760728
61 -0.39525325 -3.99273052
62 -4.46850083 -0.39525325
63 -5.07531258 -4.46850083
64 -8.02695978 -5.07531258
65 4.46620011 -8.02695978
66 12.33198376 4.46620011
67 -3.60781572 12.33198376
68 -11.35014861 -3.60781572
69 -2.60629028 -11.35014861
70 10.32393974 -2.60629028
71 0.82329450 10.32393974
72 6.63093199 0.82329450
73 1.71666600 6.63093199
74 4.33327976 1.71666600
75 3.52139643 4.33327976
76 -9.99642764 3.52139643
77 -1.86537188 -9.99642764
78 -3.08411932 -1.86537188
79 5.29198873 -3.08411932
80 -2.96143565 5.29198873
81 3.52172449 -2.96143565
82 0.18940086 3.52172449
83 -2.02544978 0.18940086
84 2.61975390 -2.02544978
85 -0.13292662 2.61975390
86 -0.67681745 -0.13292662
87 -8.39611461 -0.67681745
88 0.88695959 -8.39611461
89 1.30546490 0.88695959
90 4.37881353 1.30546490
91 -3.47794190 4.37881353
92 -1.23408456 -3.47794190
93 1.10615470 -1.23408456
94 -0.37764531 1.10615470
95 1.94878419 -0.37764531
96 5.49063726 1.94878419
97 4.12233826 5.49063726
98 1.57540644 4.12233826
99 3.29350864 1.57540644
100 0.70537141 3.29350864
101 -1.14345848 0.70537141
102 -1.02187114 -1.14345848
103 -1.66911257 -1.02187114
104 0.18701406 -1.66911257
105 4.85045760 0.18701406
106 4.90816473 4.85045760
107 5.12376265 4.90816473
108 -0.15846322 5.12376265
109 -2.59727395 -0.15846322
110 -1.54761083 -2.59727395
111 9.18472036 -1.54761083
112 1.17104451 9.18472036
113 -2.20943467 1.17104451
114 -11.58259288 -2.20943467
115 -2.02848523 -11.58259288
116 -1.27376696 -2.02848523
117 -2.01815304 -1.27376696
118 0.28122431 -2.01815304
119 5.34209641 0.28122431
120 7.83449358 5.34209641
121 -4.48588487 7.83449358
122 -4.45198367 -4.48588487
123 -0.83199094 -4.45198367
124 -6.56803228 -0.83199094
125 -2.14488288 -6.56803228
126 -2.51793693 -2.14488288
127 -2.08488204 -2.51793693
128 -2.76126409 -2.08488204
129 7.49825216 -2.76126409
130 -1.28582185 7.49825216
131 -0.60162085 -1.28582185
132 -2.32124296 -0.60162085
133 0.83840028 -2.32124296
134 3.60702938 0.83840028
135 -1.58642392 3.60702938
136 -2.89155713 -1.58642392
137 -4.07325938 -2.89155713
138 -1.63715603 -4.07325938
139 -1.99468819 -1.63715603
140 6.38404163 -1.99468819
141 2.99422243 6.38404163
142 -5.05198719 2.99422243
143 -0.94370809 -5.05198719
144 -4.42993020 -0.94370809
145 1.83383190 -4.42993020
146 8.13233995 1.83383190
147 1.28188599 8.13233995
148 2.30698481 1.28188599
149 3.12299993 2.30698481
150 -0.18214318 3.12299993
151 0.60484780 -0.18214318
152 10.82087795 0.60484780
153 3.73243345 10.82087795
154 -5.62043919 3.73243345
155 -0.99686229 -5.62043919
156 3.54106864 -0.99686229
157 -2.14726968 3.54106864
158 4.68384257 -2.14726968
159 NA 4.68384257
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.47652676 -1.33830642
[2,] -5.88080815 3.47652676
[3,] -1.99848637 -5.88080815
[4,] -1.15856427 -1.99848637
[5,] -4.30157629 -1.15856427
[6,] -0.93556545 -4.30157629
[7,] -6.22300510 -0.93556545
[8,] -4.44263374 -6.22300510
[9,] -3.84222208 -4.44263374
[10,] 0.24797177 -3.84222208
[11,] 7.93760055 0.24797177
[12,] 7.54215389 7.93760055
[13,] -0.43426165 7.54215389
[14,] -6.56347380 -0.43426165
[15,] -6.31310031 -6.56347380
[16,] 1.86219874 -6.31310031
[17,] 0.50324966 1.86219874
[18,] -0.07239803 0.50324966
[19,] 4.77872003 -0.07239803
[20,] 2.05128334 4.77872003
[21,] 6.96813270 2.05128334
[22,] 1.19352710 6.96813270
[23,] 9.94022232 1.19352710
[24,] -0.99924909 9.94022232
[25,] -4.49208528 -0.99924909
[26,] -1.66672024 -4.49208528
[27,] 2.34360641 -1.66672024
[28,] -0.07554755 2.34360641
[29,] -2.56108701 -0.07554755
[30,] 3.16615554 -2.56108701
[31,] -5.73812731 3.16615554
[32,] 0.07267825 -5.73812731
[33,] 1.06704088 0.07267825
[34,] -5.86766005 1.06704088
[35,] 4.33242395 -5.86766005
[36,] 9.81058105 4.33242395
[37,] -9.00294621 9.81058105
[38,] 4.26383036 -9.00294621
[39,] -0.53413350 4.26383036
[40,] 1.16363482 -0.53413350
[41,] -0.05554727 1.16363482
[42,] 0.83773308 -0.05554727
[43,] -4.71758073 0.83773308
[44,] -2.06564448 -4.71758073
[45,] -5.79059886 -2.06564448
[46,] -2.58228224 -5.79059886
[47,] 5.35089878 -2.58228224
[48,] 6.91435524 5.35089878
[49,] -3.38472139 6.91435524
[50,] 2.98337794 -3.38472139
[51,] -1.20866204 2.98337794
[52,] 0.52139643 -1.20866204
[53,] -0.20256268 0.52139643
[54,] -0.99656268 -0.20256268
[55,] 2.06171415 -0.99656268
[56,] -0.60705300 2.06171415
[57,] -3.08325797 -0.60705300
[58,] -3.91447438 -3.08325797
[59,] -6.57760728 -3.91447438
[60,] -3.99273052 -6.57760728
[61,] -0.39525325 -3.99273052
[62,] -4.46850083 -0.39525325
[63,] -5.07531258 -4.46850083
[64,] -8.02695978 -5.07531258
[65,] 4.46620011 -8.02695978
[66,] 12.33198376 4.46620011
[67,] -3.60781572 12.33198376
[68,] -11.35014861 -3.60781572
[69,] -2.60629028 -11.35014861
[70,] 10.32393974 -2.60629028
[71,] 0.82329450 10.32393974
[72,] 6.63093199 0.82329450
[73,] 1.71666600 6.63093199
[74,] 4.33327976 1.71666600
[75,] 3.52139643 4.33327976
[76,] -9.99642764 3.52139643
[77,] -1.86537188 -9.99642764
[78,] -3.08411932 -1.86537188
[79,] 5.29198873 -3.08411932
[80,] -2.96143565 5.29198873
[81,] 3.52172449 -2.96143565
[82,] 0.18940086 3.52172449
[83,] -2.02544978 0.18940086
[84,] 2.61975390 -2.02544978
[85,] -0.13292662 2.61975390
[86,] -0.67681745 -0.13292662
[87,] -8.39611461 -0.67681745
[88,] 0.88695959 -8.39611461
[89,] 1.30546490 0.88695959
[90,] 4.37881353 1.30546490
[91,] -3.47794190 4.37881353
[92,] -1.23408456 -3.47794190
[93,] 1.10615470 -1.23408456
[94,] -0.37764531 1.10615470
[95,] 1.94878419 -0.37764531
[96,] 5.49063726 1.94878419
[97,] 4.12233826 5.49063726
[98,] 1.57540644 4.12233826
[99,] 3.29350864 1.57540644
[100,] 0.70537141 3.29350864
[101,] -1.14345848 0.70537141
[102,] -1.02187114 -1.14345848
[103,] -1.66911257 -1.02187114
[104,] 0.18701406 -1.66911257
[105,] 4.85045760 0.18701406
[106,] 4.90816473 4.85045760
[107,] 5.12376265 4.90816473
[108,] -0.15846322 5.12376265
[109,] -2.59727395 -0.15846322
[110,] -1.54761083 -2.59727395
[111,] 9.18472036 -1.54761083
[112,] 1.17104451 9.18472036
[113,] -2.20943467 1.17104451
[114,] -11.58259288 -2.20943467
[115,] -2.02848523 -11.58259288
[116,] -1.27376696 -2.02848523
[117,] -2.01815304 -1.27376696
[118,] 0.28122431 -2.01815304
[119,] 5.34209641 0.28122431
[120,] 7.83449358 5.34209641
[121,] -4.48588487 7.83449358
[122,] -4.45198367 -4.48588487
[123,] -0.83199094 -4.45198367
[124,] -6.56803228 -0.83199094
[125,] -2.14488288 -6.56803228
[126,] -2.51793693 -2.14488288
[127,] -2.08488204 -2.51793693
[128,] -2.76126409 -2.08488204
[129,] 7.49825216 -2.76126409
[130,] -1.28582185 7.49825216
[131,] -0.60162085 -1.28582185
[132,] -2.32124296 -0.60162085
[133,] 0.83840028 -2.32124296
[134,] 3.60702938 0.83840028
[135,] -1.58642392 3.60702938
[136,] -2.89155713 -1.58642392
[137,] -4.07325938 -2.89155713
[138,] -1.63715603 -4.07325938
[139,] -1.99468819 -1.63715603
[140,] 6.38404163 -1.99468819
[141,] 2.99422243 6.38404163
[142,] -5.05198719 2.99422243
[143,] -0.94370809 -5.05198719
[144,] -4.42993020 -0.94370809
[145,] 1.83383190 -4.42993020
[146,] 8.13233995 1.83383190
[147,] 1.28188599 8.13233995
[148,] 2.30698481 1.28188599
[149,] 3.12299993 2.30698481
[150,] -0.18214318 3.12299993
[151,] 0.60484780 -0.18214318
[152,] 10.82087795 0.60484780
[153,] 3.73243345 10.82087795
[154,] -5.62043919 3.73243345
[155,] -0.99686229 -5.62043919
[156,] 3.54106864 -0.99686229
[157,] -2.14726968 3.54106864
[158,] 4.68384257 -2.14726968
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.47652676 -1.33830642
2 -5.88080815 3.47652676
3 -1.99848637 -5.88080815
4 -1.15856427 -1.99848637
5 -4.30157629 -1.15856427
6 -0.93556545 -4.30157629
7 -6.22300510 -0.93556545
8 -4.44263374 -6.22300510
9 -3.84222208 -4.44263374
10 0.24797177 -3.84222208
11 7.93760055 0.24797177
12 7.54215389 7.93760055
13 -0.43426165 7.54215389
14 -6.56347380 -0.43426165
15 -6.31310031 -6.56347380
16 1.86219874 -6.31310031
17 0.50324966 1.86219874
18 -0.07239803 0.50324966
19 4.77872003 -0.07239803
20 2.05128334 4.77872003
21 6.96813270 2.05128334
22 1.19352710 6.96813270
23 9.94022232 1.19352710
24 -0.99924909 9.94022232
25 -4.49208528 -0.99924909
26 -1.66672024 -4.49208528
27 2.34360641 -1.66672024
28 -0.07554755 2.34360641
29 -2.56108701 -0.07554755
30 3.16615554 -2.56108701
31 -5.73812731 3.16615554
32 0.07267825 -5.73812731
33 1.06704088 0.07267825
34 -5.86766005 1.06704088
35 4.33242395 -5.86766005
36 9.81058105 4.33242395
37 -9.00294621 9.81058105
38 4.26383036 -9.00294621
39 -0.53413350 4.26383036
40 1.16363482 -0.53413350
41 -0.05554727 1.16363482
42 0.83773308 -0.05554727
43 -4.71758073 0.83773308
44 -2.06564448 -4.71758073
45 -5.79059886 -2.06564448
46 -2.58228224 -5.79059886
47 5.35089878 -2.58228224
48 6.91435524 5.35089878
49 -3.38472139 6.91435524
50 2.98337794 -3.38472139
51 -1.20866204 2.98337794
52 0.52139643 -1.20866204
53 -0.20256268 0.52139643
54 -0.99656268 -0.20256268
55 2.06171415 -0.99656268
56 -0.60705300 2.06171415
57 -3.08325797 -0.60705300
58 -3.91447438 -3.08325797
59 -6.57760728 -3.91447438
60 -3.99273052 -6.57760728
61 -0.39525325 -3.99273052
62 -4.46850083 -0.39525325
63 -5.07531258 -4.46850083
64 -8.02695978 -5.07531258
65 4.46620011 -8.02695978
66 12.33198376 4.46620011
67 -3.60781572 12.33198376
68 -11.35014861 -3.60781572
69 -2.60629028 -11.35014861
70 10.32393974 -2.60629028
71 0.82329450 10.32393974
72 6.63093199 0.82329450
73 1.71666600 6.63093199
74 4.33327976 1.71666600
75 3.52139643 4.33327976
76 -9.99642764 3.52139643
77 -1.86537188 -9.99642764
78 -3.08411932 -1.86537188
79 5.29198873 -3.08411932
80 -2.96143565 5.29198873
81 3.52172449 -2.96143565
82 0.18940086 3.52172449
83 -2.02544978 0.18940086
84 2.61975390 -2.02544978
85 -0.13292662 2.61975390
86 -0.67681745 -0.13292662
87 -8.39611461 -0.67681745
88 0.88695959 -8.39611461
89 1.30546490 0.88695959
90 4.37881353 1.30546490
91 -3.47794190 4.37881353
92 -1.23408456 -3.47794190
93 1.10615470 -1.23408456
94 -0.37764531 1.10615470
95 1.94878419 -0.37764531
96 5.49063726 1.94878419
97 4.12233826 5.49063726
98 1.57540644 4.12233826
99 3.29350864 1.57540644
100 0.70537141 3.29350864
101 -1.14345848 0.70537141
102 -1.02187114 -1.14345848
103 -1.66911257 -1.02187114
104 0.18701406 -1.66911257
105 4.85045760 0.18701406
106 4.90816473 4.85045760
107 5.12376265 4.90816473
108 -0.15846322 5.12376265
109 -2.59727395 -0.15846322
110 -1.54761083 -2.59727395
111 9.18472036 -1.54761083
112 1.17104451 9.18472036
113 -2.20943467 1.17104451
114 -11.58259288 -2.20943467
115 -2.02848523 -11.58259288
116 -1.27376696 -2.02848523
117 -2.01815304 -1.27376696
118 0.28122431 -2.01815304
119 5.34209641 0.28122431
120 7.83449358 5.34209641
121 -4.48588487 7.83449358
122 -4.45198367 -4.48588487
123 -0.83199094 -4.45198367
124 -6.56803228 -0.83199094
125 -2.14488288 -6.56803228
126 -2.51793693 -2.14488288
127 -2.08488204 -2.51793693
128 -2.76126409 -2.08488204
129 7.49825216 -2.76126409
130 -1.28582185 7.49825216
131 -0.60162085 -1.28582185
132 -2.32124296 -0.60162085
133 0.83840028 -2.32124296
134 3.60702938 0.83840028
135 -1.58642392 3.60702938
136 -2.89155713 -1.58642392
137 -4.07325938 -2.89155713
138 -1.63715603 -4.07325938
139 -1.99468819 -1.63715603
140 6.38404163 -1.99468819
141 2.99422243 6.38404163
142 -5.05198719 2.99422243
143 -0.94370809 -5.05198719
144 -4.42993020 -0.94370809
145 1.83383190 -4.42993020
146 8.13233995 1.83383190
147 1.28188599 8.13233995
148 2.30698481 1.28188599
149 3.12299993 2.30698481
150 -0.18214318 3.12299993
151 0.60484780 -0.18214318
152 10.82087795 0.60484780
153 3.73243345 10.82087795
154 -5.62043919 3.73243345
155 -0.99686229 -5.62043919
156 3.54106864 -0.99686229
157 -2.14726968 3.54106864
158 4.68384257 -2.14726968
> 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/74fxd1293045088.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/84fxd1293045088.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/9f7wg1293045088.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/10f7wg1293045088.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/1107c41293045088.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/1238ts1293045088.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/13a9q41293045088.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/1430po1293045088.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/156joc1293045088.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/162all1293045088.tab")
+ }
>
> try(system("convert tmp/1qohm1293045088.ps tmp/1qohm1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/2jxgq1293045088.ps tmp/2jxgq1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/3jxgq1293045088.ps tmp/3jxgq1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/4jxgq1293045088.ps tmp/4jxgq1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/5t6yb1293045088.ps tmp/5t6yb1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/6t6yb1293045088.ps tmp/6t6yb1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/74fxd1293045088.ps tmp/74fxd1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/84fxd1293045088.ps tmp/84fxd1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/9f7wg1293045088.ps tmp/9f7wg1293045088.png",intern=TRUE))
character(0)
> try(system("convert tmp/10f7wg1293045088.ps tmp/10f7wg1293045088.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.500 0.920 5.425