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(20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,1
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,2
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,2
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,3
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,3
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,4
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,4
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,4
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,6
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,7
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,7
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,8
+ ,20
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,8
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,11
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,12
+ ,34
+ ,16
+ ,18
+ ,11
+ ,21
+ ,20
+ ,13
+ ,21
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,13
+ ,31
+ ,14
+ ,10
+ ,8
+ ,18
+ ,23
+ ,13
+ ,19
+ ,11
+ ,11
+ ,8
+ ,20
+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25
+ ,19
+ ,19
+ ,20
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,19
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,19
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,19
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,19
+ ,28
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,19
+ ,38
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,19
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,20
+ ,20
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,20
+ ,17
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,20
+ ,28
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,20
+ ,22
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,21
+ ,31
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20
+ ,22)
+ ,dim=c(7
+ ,153)
+ ,dimnames=list(c('concern'
+ ,'doubts'
+ ,'Par_Crit'
+ ,'Par_Stan'
+ ,'Pers_Stand'
+ ,'Org'
+ ,'Days')
+ ,1:153))
> y <- array(NA,dim=c(7,153),dimnames=list(c('concern','doubts','Par_Crit','Par_Stan','Pers_Stand','Org','Days'),1:153))
> 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 = '6'
> #'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
Org concern doubts Par_Crit Par_Stan Pers_Stand Days
1 25 20 10 11 4 25 1
2 21 16 11 11 11 23 2
3 22 18 16 12 7 17 2
4 25 17 11 13 7 21 3
5 24 23 13 14 12 19 3
6 18 30 12 16 10 19 4
7 22 23 8 11 10 15 4
8 15 18 12 10 8 16 4
9 22 15 11 11 8 23 6
10 28 12 4 15 4 27 7
11 20 21 9 9 9 22 7
12 12 15 8 11 8 14 8
13 24 20 8 17 7 22 8
14 20 31 14 17 11 23 11
15 21 27 15 11 9 23 12
16 20 34 16 18 11 21 13
17 21 21 9 14 13 19 13
18 23 31 14 10 8 18 13
19 28 19 11 11 8 20 13
20 24 16 8 15 9 23 13
21 24 20 9 15 6 25 13
22 24 21 9 13 9 19 13
23 23 22 9 16 9 24 13
24 23 17 9 13 6 22 13
25 29 24 10 9 6 25 13
26 24 25 16 18 16 26 13
27 18 26 11 18 5 29 13
28 25 25 8 12 7 32 13
29 21 17 9 17 9 25 13
30 26 32 16 9 6 29 13
31 22 33 11 9 6 28 13
32 22 13 16 12 5 17 13
33 22 32 12 18 12 28 13
34 23 25 12 12 7 29 13
35 30 29 14 18 10 26 13
36 23 22 9 14 9 25 13
37 17 18 10 15 8 14 13
38 23 17 9 16 5 25 13
39 23 20 10 10 8 26 14
40 25 15 12 11 8 20 14
41 24 20 14 14 10 18 14
42 24 33 14 9 6 32 14
43 23 29 10 12 8 25 14
44 21 23 14 17 7 25 14
45 24 26 16 5 4 23 14
46 24 18 9 12 8 21 14
47 28 20 10 12 8 20 14
48 16 11 6 6 4 15 14
49 20 28 8 24 20 30 14
50 29 26 13 12 8 24 14
51 27 22 10 12 8 26 15
52 22 17 8 14 6 24 15
53 28 12 7 7 4 22 15
54 16 14 15 13 8 14 15
55 25 17 9 12 9 24 15
56 24 21 10 13 6 24 15
57 28 19 12 14 7 24 15
58 24 18 13 8 9 24 15
59 23 10 10 11 5 19 15
60 30 29 11 9 5 31 15
61 24 31 8 11 8 22 15
62 21 19 9 13 8 27 15
63 25 9 13 10 6 19 15
64 25 20 11 11 8 25 15
65 22 28 8 12 7 20 15
66 23 19 9 9 7 21 15
67 26 30 9 15 9 27 15
68 23 29 15 18 11 23 15
69 25 26 9 15 6 25 15
70 21 23 10 12 8 20 16
71 25 13 14 13 6 21 16
72 24 21 12 14 9 22 16
73 29 19 12 10 8 23 16
74 22 28 11 13 6 25 16
75 27 23 14 13 10 25 16
76 26 18 6 11 8 17 16
77 22 21 12 13 8 19 16
78 24 20 8 16 10 25 16
79 27 23 14 8 5 19 17
80 24 21 11 16 7 20 17
81 24 21 10 11 5 26 17
82 29 15 14 9 8 23 17
83 22 28 12 16 14 27 17
84 21 19 10 12 7 17 17
85 24 26 14 14 8 17 17
86 24 10 5 8 6 19 17
87 23 16 11 9 5 17 17
88 20 22 10 15 6 22 17
89 27 19 9 11 10 21 17
90 26 31 10 21 12 32 17
91 25 31 16 14 9 21 17
92 21 29 13 18 12 21 17
93 21 19 9 12 7 18 18
94 19 22 10 13 8 18 18
95 21 23 10 15 10 23 18
96 21 15 7 12 6 19 18
97 16 20 9 19 10 20 18
98 22 18 8 15 10 21 18
99 29 23 14 11 10 20 18
100 15 25 14 11 5 17 18
101 17 21 8 10 7 18 18
102 15 24 9 13 10 19 18
103 21 25 14 15 11 22 18
104 21 17 14 12 6 15 18
105 19 13 8 12 7 14 18
106 24 28 8 16 12 18 18
107 20 21 8 9 11 24 18
108 17 25 7 18 11 35 18
109 23 9 6 8 11 29 18
110 24 16 8 13 5 21 18
111 14 19 6 17 8 25 18
112 19 17 11 9 6 20 18
113 24 25 14 15 9 22 18
114 13 20 11 8 4 13 18
115 22 29 11 7 4 26 18
116 16 14 11 12 7 17 18
117 19 22 14 14 11 25 18
118 25 15 8 6 6 20 18
119 25 19 20 8 7 19 18
120 23 20 11 17 8 21 19
121 24 15 8 10 4 22 19
122 26 20 11 11 8 24 19
123 26 18 10 14 9 21 19
124 25 33 14 11 8 26 19
125 18 22 11 13 11 24 19
126 21 16 9 12 8 16 19
127 26 17 9 11 5 23 19
128 23 16 8 9 4 18 19
129 23 21 10 12 8 16 19
130 22 26 13 20 10 26 19
131 20 18 13 12 6 19 19
132 13 18 12 13 9 21 19
133 24 17 8 12 9 21 19
134 15 22 13 12 13 22 19
135 14 30 14 9 9 23 19
136 22 30 12 15 10 29 19
137 10 24 14 24 20 21 19
138 24 21 15 7 5 21 19
139 22 21 13 17 11 23 19
140 24 29 16 11 6 27 19
141 19 31 9 17 9 25 19
142 20 20 9 11 7 21 19
143 13 16 9 12 9 10 19
144 20 22 8 14 10 20 19
145 22 20 7 11 9 26 19
146 24 28 16 16 8 24 19
147 29 38 11 21 7 29 19
148 12 22 9 14 6 19 20
149 20 20 11 20 13 24 20
150 21 17 9 13 6 19 20
151 24 28 14 11 8 24 20
152 22 22 13 15 10 22 21
153 20 31 16 19 16 17 22
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) concern doubts Par_Crit Par_Stan Pers_Stand
17.47864 -0.05403 0.19864 -0.14665 -0.25757 0.41014
Days
-0.08222
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.8715 -1.8202 0.3749 2.1202 7.4493
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 17.47864 2.27502 7.683 2.08e-12 ***
concern -0.05403 0.06398 -0.845 0.3998
doubts 0.19864 0.11395 1.743 0.0834 .
Par_Crit -0.14665 0.10841 -1.353 0.1782
Par_Stan -0.25757 0.13359 -1.928 0.0558 .
Pers_Stand 0.41014 0.07722 5.311 3.98e-07 ***
Days -0.08222 0.06994 -1.176 0.2416
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.51 on 146 degrees of freedom
Multiple R-squared: 0.2287, Adjusted R-squared: 0.197
F-statistic: 7.216 on 6 and 146 DF, p-value: 9.278e-07
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.685160709 0.629678582 0.3148393
[2,] 0.594847957 0.810304086 0.4051520
[3,] 0.695991169 0.608017663 0.3040088
[4,] 0.590676311 0.818647378 0.4093237
[5,] 0.482027443 0.964054887 0.5179726
[6,] 0.482480077 0.964960154 0.5175199
[7,] 0.383229343 0.766458686 0.6167707
[8,] 0.361135062 0.722270124 0.6388649
[9,] 0.510936500 0.978127000 0.4890635
[10,] 0.723720943 0.552558114 0.2762791
[11,] 0.650516434 0.698967131 0.3494836
[12,] 0.584310003 0.831379994 0.4156900
[13,] 0.549159125 0.901681750 0.4508409
[14,] 0.478128577 0.956257154 0.5218714
[15,] 0.407130657 0.814261314 0.5928693
[16,] 0.401146486 0.802292971 0.5988535
[17,] 0.338099599 0.676199199 0.6619004
[18,] 0.626758543 0.746482914 0.3732415
[19,] 0.592059148 0.815881703 0.4079409
[20,] 0.557990615 0.884018771 0.4420094
[21,] 0.495662718 0.991325436 0.5043373
[22,] 0.488618843 0.977237686 0.5113812
[23,] 0.430429780 0.860859559 0.5695702
[24,] 0.376358769 0.752717538 0.6236412
[25,] 0.350977165 0.701954331 0.6490228
[26,] 0.526505895 0.946988211 0.4734941
[27,] 0.469155302 0.938310604 0.5308447
[28,] 0.448158318 0.896316635 0.5518417
[29,] 0.399050801 0.798101602 0.6009492
[30,] 0.358430121 0.716860242 0.6415699
[31,] 0.325382615 0.650765231 0.6746174
[32,] 0.297278773 0.594557545 0.7027212
[33,] 0.286295581 0.572591162 0.7137044
[34,] 0.244309906 0.488619811 0.7556901
[35,] 0.240527313 0.481054626 0.7594727
[36,] 0.216325888 0.432651776 0.7836741
[37,] 0.182642749 0.365285498 0.8173573
[38,] 0.244372454 0.488744908 0.7556275
[39,] 0.337089146 0.674178292 0.6629109
[40,] 0.329244356 0.658488712 0.6707556
[41,] 0.386000474 0.772000949 0.6139995
[42,] 0.362593078 0.725186156 0.6374069
[43,] 0.328658703 0.657317406 0.6713413
[44,] 0.329176083 0.658352166 0.6708239
[45,] 0.402971270 0.805942541 0.5970287
[46,] 0.357932048 0.715864097 0.6420680
[47,] 0.313816766 0.627633531 0.6861832
[48,] 0.320049504 0.640099008 0.6799505
[49,] 0.283212363 0.566424725 0.7167876
[50,] 0.244198663 0.488397326 0.7558013
[51,] 0.229983415 0.459966831 0.7700166
[52,] 0.200730028 0.401460057 0.7992700
[53,] 0.218840430 0.437680861 0.7811596
[54,] 0.188559552 0.377119104 0.8114404
[55,] 0.157679478 0.315358957 0.8423205
[56,] 0.130595741 0.261191483 0.8694043
[57,] 0.107855988 0.215711977 0.8921440
[58,] 0.092942555 0.185885109 0.9070574
[59,] 0.075461750 0.150923499 0.9245383
[60,] 0.060992558 0.121985116 0.9390074
[61,] 0.050034140 0.100068281 0.9499659
[62,] 0.039554828 0.079109657 0.9604452
[63,] 0.030607760 0.061215521 0.9693922
[64,] 0.036961963 0.073923926 0.9630380
[65,] 0.032816176 0.065632352 0.9671838
[66,] 0.028088181 0.056176363 0.9719118
[67,] 0.037421051 0.074842102 0.9625789
[68,] 0.028686449 0.057372898 0.9713136
[69,] 0.022122579 0.044245159 0.9778774
[70,] 0.021599449 0.043198898 0.9784006
[71,] 0.017593574 0.035187148 0.9824064
[72,] 0.013666515 0.027333030 0.9863335
[73,] 0.015627178 0.031254356 0.9843728
[74,] 0.012566620 0.025133240 0.9874334
[75,] 0.009368585 0.018737170 0.9906314
[76,] 0.008431438 0.016862875 0.9915686
[77,] 0.006988088 0.013976175 0.9930119
[78,] 0.005182156 0.010364312 0.9948178
[79,] 0.004582483 0.009164967 0.9954175
[80,] 0.007562146 0.015124291 0.9924379
[81,] 0.006685171 0.013370343 0.9933148
[82,] 0.006381169 0.012762338 0.9936188
[83,] 0.005188987 0.010377975 0.9948110
[84,] 0.003952736 0.007905473 0.9960473
[85,] 0.003252243 0.006504487 0.9967478
[86,] 0.002553715 0.005107430 0.9974463
[87,] 0.001878646 0.003757293 0.9981214
[88,] 0.002148193 0.004296387 0.9978518
[89,] 0.001751383 0.003502765 0.9982486
[90,] 0.008467370 0.016934739 0.9915326
[91,] 0.018919292 0.037838584 0.9810807
[92,] 0.019753600 0.039507199 0.9802464
[93,] 0.025577497 0.051154994 0.9744225
[94,] 0.020678196 0.041356392 0.9793218
[95,] 0.015442889 0.030885778 0.9845571
[96,] 0.011498394 0.022996788 0.9885016
[97,] 0.041013431 0.082026862 0.9589866
[98,] 0.042233054 0.084466108 0.9577669
[99,] 0.098166191 0.196332382 0.9018338
[100,] 0.086085685 0.172171370 0.9139143
[101,] 0.075131280 0.150262559 0.9248687
[102,] 0.162397841 0.324795681 0.8376022
[103,] 0.152344960 0.304689920 0.8476550
[104,] 0.154594802 0.309189604 0.8454052
[105,] 0.220161800 0.440323599 0.7798382
[106,] 0.202215139 0.404430278 0.7977849
[107,] 0.222102987 0.444205974 0.7778970
[108,] 0.209160897 0.418321794 0.7908391
[109,] 0.216147536 0.432295072 0.7838525
[110,] 0.216928313 0.433856627 0.7830717
[111,] 0.182190198 0.364380395 0.8178098
[112,] 0.145645736 0.291291471 0.8543543
[113,] 0.149042434 0.298084868 0.8509576
[114,] 0.216359044 0.432718088 0.7836410
[115,] 0.194712392 0.389424784 0.8052876
[116,] 0.171885515 0.343771029 0.8281145
[117,] 0.158384805 0.316769609 0.8416152
[118,] 0.143299192 0.286598384 0.8567008
[119,] 0.119441853 0.238883706 0.8805581
[120,] 0.193522540 0.387045079 0.8064775
[121,] 0.148229883 0.296459765 0.8517701
[122,] 0.112369928 0.224739857 0.8876301
[123,] 0.227804729 0.455609458 0.7721953
[124,] 0.320741234 0.641482468 0.6792588
[125,] 0.286468416 0.572936833 0.7135316
[126,] 0.489913653 0.979827306 0.5100863
[127,] 0.432068723 0.864137446 0.5679313
[128,] 0.677611581 0.644776838 0.3223884
[129,] 0.613763115 0.772473770 0.3862369
[130,] 0.502755536 0.994488929 0.4972445
[131,] 0.440113157 0.880226314 0.5598868
[132,] 0.461725802 0.923451604 0.5382742
[133,] 0.326361515 0.652723029 0.6736385
[134,] 0.213958000 0.427916000 0.7860420
> postscript(file="/var/www/html/rcomp/tmp/1mfj71291325413.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/2mfj71291325413.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/3f7ia1291325413.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/4f7ia1291325413.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/5f7ia1291325413.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 = 153
Frequency = 1
1 2 3 4 5 6
-0.91216275 -2.62143362 -0.92934622 1.59812499 2.77984890 -2.78288290
7 8 9 10 11 12
2.54073050 -6.59593442 -2.11928537 3.10706276 -2.94116579 -7.66765318
13 14 15 16 17 18
1.94373505 -1.78689346 -2.51450230 -0.89068330 1.54614995 1.62898096
19 20 21 22 23 24
5.90284817 1.95041628 0.37492086 3.36921156 0.81249829 0.14993465
25 26 27 28 29 30
4.51251000 1.86015640 -7.15632583 -1.20963614 -1.72116509 -0.88760559
31 32 33 34 35 36
-3.43023690 -0.81019457 -0.81761294 -2.77376803 6.92814361 0.10905350
37 38 39 40 41 42
-1.90509525 -0.89810348 -1.36975078 2.57029444 3.21857260 -3.58449149
43 44 45 46 47 48
-0.17999182 -2.82306731 -1.77049673 2.06482609 6.38439814 -5.16685584
49 50 51 52 53 54
-0.03677065 5.47212851 3.11384749 -1.16060745 4.04643117 -4.24328283
55 56 57 58 59 60
2.12016480 0.51160302 4.41047960 -0.20696260 0.41704759 3.03007837
61 62 63 64 65 66
2.49135017 -3.11310748 1.87801653 1.07062793 1.03860748 0.50355794
67 68 69 70 71 72
3.03215207 1.38194808 1.86357929 -0.28904815 1.59741636 1.93619877
73 74 75 76 77 78
5.57380859 -1.63670755 3.52748854 6.31910217 0.76239766 1.99717131
79 80 81 82 83 84
4.04944006 2.81550427 -0.69510522 4.89596428 -0.07287455 0.54988758
85 86 87 88 89 90
3.68445315 2.39230518 1.23404512 -2.15632747 5.73402569 2.65391994
91 92 93 94 95 96
3.17435880 1.02152749 0.42060984 -1.21170044 -0.39992250 -0.06596504
97 98 99 100 101 102
-3.54635821 1.54746180 7.44933768 -6.50002803 -3.56598572 -4.79998966
103 104 105 106 107 108
-0.41869462 0.29219795 -0.06439771 5.98002854 -2.14319626 -7.92009927
109 110 111 112 113 114
-1.59169409 1.85823001 -7.86362865 -3.60254637 2.06616218 -7.23125104
115 116 117 118 119 120
-3.22341960 -4.83670106 -3.95787381 2.44534364 1.23883657 1.92000110
121 122 123 124 125 126
0.77875121 2.80966671 4.82818552 1.09592309 -4.01624470 1.41858286
127 128 129 130 131 132
2.68226519 1.32669744 3.49011881 -0.24867162 -2.01346737 -8.71574364
133 134 135 136 137 138
2.87812383 -6.22474901 -8.87149152 -1.79757579 -7.34235194 -0.05975300
139 140 141 142 143 144
0.52919197 -1.44277775 -2.47132944 -1.82020523 -3.86300058 0.10931476
145 146 147 148 149 150
-0.95848897 0.98201294 5.94053916 -8.62724492 -0.50038293 -0.04407144
151 152 153
0.72825469 0.60694112 2.76230568
> postscript(file="/var/www/html/rcomp/tmp/6pyid1291325413.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 = 153
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.91216275 NA
1 -2.62143362 -0.91216275
2 -0.92934622 -2.62143362
3 1.59812499 -0.92934622
4 2.77984890 1.59812499
5 -2.78288290 2.77984890
6 2.54073050 -2.78288290
7 -6.59593442 2.54073050
8 -2.11928537 -6.59593442
9 3.10706276 -2.11928537
10 -2.94116579 3.10706276
11 -7.66765318 -2.94116579
12 1.94373505 -7.66765318
13 -1.78689346 1.94373505
14 -2.51450230 -1.78689346
15 -0.89068330 -2.51450230
16 1.54614995 -0.89068330
17 1.62898096 1.54614995
18 5.90284817 1.62898096
19 1.95041628 5.90284817
20 0.37492086 1.95041628
21 3.36921156 0.37492086
22 0.81249829 3.36921156
23 0.14993465 0.81249829
24 4.51251000 0.14993465
25 1.86015640 4.51251000
26 -7.15632583 1.86015640
27 -1.20963614 -7.15632583
28 -1.72116509 -1.20963614
29 -0.88760559 -1.72116509
30 -3.43023690 -0.88760559
31 -0.81019457 -3.43023690
32 -0.81761294 -0.81019457
33 -2.77376803 -0.81761294
34 6.92814361 -2.77376803
35 0.10905350 6.92814361
36 -1.90509525 0.10905350
37 -0.89810348 -1.90509525
38 -1.36975078 -0.89810348
39 2.57029444 -1.36975078
40 3.21857260 2.57029444
41 -3.58449149 3.21857260
42 -0.17999182 -3.58449149
43 -2.82306731 -0.17999182
44 -1.77049673 -2.82306731
45 2.06482609 -1.77049673
46 6.38439814 2.06482609
47 -5.16685584 6.38439814
48 -0.03677065 -5.16685584
49 5.47212851 -0.03677065
50 3.11384749 5.47212851
51 -1.16060745 3.11384749
52 4.04643117 -1.16060745
53 -4.24328283 4.04643117
54 2.12016480 -4.24328283
55 0.51160302 2.12016480
56 4.41047960 0.51160302
57 -0.20696260 4.41047960
58 0.41704759 -0.20696260
59 3.03007837 0.41704759
60 2.49135017 3.03007837
61 -3.11310748 2.49135017
62 1.87801653 -3.11310748
63 1.07062793 1.87801653
64 1.03860748 1.07062793
65 0.50355794 1.03860748
66 3.03215207 0.50355794
67 1.38194808 3.03215207
68 1.86357929 1.38194808
69 -0.28904815 1.86357929
70 1.59741636 -0.28904815
71 1.93619877 1.59741636
72 5.57380859 1.93619877
73 -1.63670755 5.57380859
74 3.52748854 -1.63670755
75 6.31910217 3.52748854
76 0.76239766 6.31910217
77 1.99717131 0.76239766
78 4.04944006 1.99717131
79 2.81550427 4.04944006
80 -0.69510522 2.81550427
81 4.89596428 -0.69510522
82 -0.07287455 4.89596428
83 0.54988758 -0.07287455
84 3.68445315 0.54988758
85 2.39230518 3.68445315
86 1.23404512 2.39230518
87 -2.15632747 1.23404512
88 5.73402569 -2.15632747
89 2.65391994 5.73402569
90 3.17435880 2.65391994
91 1.02152749 3.17435880
92 0.42060984 1.02152749
93 -1.21170044 0.42060984
94 -0.39992250 -1.21170044
95 -0.06596504 -0.39992250
96 -3.54635821 -0.06596504
97 1.54746180 -3.54635821
98 7.44933768 1.54746180
99 -6.50002803 7.44933768
100 -3.56598572 -6.50002803
101 -4.79998966 -3.56598572
102 -0.41869462 -4.79998966
103 0.29219795 -0.41869462
104 -0.06439771 0.29219795
105 5.98002854 -0.06439771
106 -2.14319626 5.98002854
107 -7.92009927 -2.14319626
108 -1.59169409 -7.92009927
109 1.85823001 -1.59169409
110 -7.86362865 1.85823001
111 -3.60254637 -7.86362865
112 2.06616218 -3.60254637
113 -7.23125104 2.06616218
114 -3.22341960 -7.23125104
115 -4.83670106 -3.22341960
116 -3.95787381 -4.83670106
117 2.44534364 -3.95787381
118 1.23883657 2.44534364
119 1.92000110 1.23883657
120 0.77875121 1.92000110
121 2.80966671 0.77875121
122 4.82818552 2.80966671
123 1.09592309 4.82818552
124 -4.01624470 1.09592309
125 1.41858286 -4.01624470
126 2.68226519 1.41858286
127 1.32669744 2.68226519
128 3.49011881 1.32669744
129 -0.24867162 3.49011881
130 -2.01346737 -0.24867162
131 -8.71574364 -2.01346737
132 2.87812383 -8.71574364
133 -6.22474901 2.87812383
134 -8.87149152 -6.22474901
135 -1.79757579 -8.87149152
136 -7.34235194 -1.79757579
137 -0.05975300 -7.34235194
138 0.52919197 -0.05975300
139 -1.44277775 0.52919197
140 -2.47132944 -1.44277775
141 -1.82020523 -2.47132944
142 -3.86300058 -1.82020523
143 0.10931476 -3.86300058
144 -0.95848897 0.10931476
145 0.98201294 -0.95848897
146 5.94053916 0.98201294
147 -8.62724492 5.94053916
148 -0.50038293 -8.62724492
149 -0.04407144 -0.50038293
150 0.72825469 -0.04407144
151 0.60694112 0.72825469
152 2.76230568 0.60694112
153 NA 2.76230568
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.62143362 -0.91216275
[2,] -0.92934622 -2.62143362
[3,] 1.59812499 -0.92934622
[4,] 2.77984890 1.59812499
[5,] -2.78288290 2.77984890
[6,] 2.54073050 -2.78288290
[7,] -6.59593442 2.54073050
[8,] -2.11928537 -6.59593442
[9,] 3.10706276 -2.11928537
[10,] -2.94116579 3.10706276
[11,] -7.66765318 -2.94116579
[12,] 1.94373505 -7.66765318
[13,] -1.78689346 1.94373505
[14,] -2.51450230 -1.78689346
[15,] -0.89068330 -2.51450230
[16,] 1.54614995 -0.89068330
[17,] 1.62898096 1.54614995
[18,] 5.90284817 1.62898096
[19,] 1.95041628 5.90284817
[20,] 0.37492086 1.95041628
[21,] 3.36921156 0.37492086
[22,] 0.81249829 3.36921156
[23,] 0.14993465 0.81249829
[24,] 4.51251000 0.14993465
[25,] 1.86015640 4.51251000
[26,] -7.15632583 1.86015640
[27,] -1.20963614 -7.15632583
[28,] -1.72116509 -1.20963614
[29,] -0.88760559 -1.72116509
[30,] -3.43023690 -0.88760559
[31,] -0.81019457 -3.43023690
[32,] -0.81761294 -0.81019457
[33,] -2.77376803 -0.81761294
[34,] 6.92814361 -2.77376803
[35,] 0.10905350 6.92814361
[36,] -1.90509525 0.10905350
[37,] -0.89810348 -1.90509525
[38,] -1.36975078 -0.89810348
[39,] 2.57029444 -1.36975078
[40,] 3.21857260 2.57029444
[41,] -3.58449149 3.21857260
[42,] -0.17999182 -3.58449149
[43,] -2.82306731 -0.17999182
[44,] -1.77049673 -2.82306731
[45,] 2.06482609 -1.77049673
[46,] 6.38439814 2.06482609
[47,] -5.16685584 6.38439814
[48,] -0.03677065 -5.16685584
[49,] 5.47212851 -0.03677065
[50,] 3.11384749 5.47212851
[51,] -1.16060745 3.11384749
[52,] 4.04643117 -1.16060745
[53,] -4.24328283 4.04643117
[54,] 2.12016480 -4.24328283
[55,] 0.51160302 2.12016480
[56,] 4.41047960 0.51160302
[57,] -0.20696260 4.41047960
[58,] 0.41704759 -0.20696260
[59,] 3.03007837 0.41704759
[60,] 2.49135017 3.03007837
[61,] -3.11310748 2.49135017
[62,] 1.87801653 -3.11310748
[63,] 1.07062793 1.87801653
[64,] 1.03860748 1.07062793
[65,] 0.50355794 1.03860748
[66,] 3.03215207 0.50355794
[67,] 1.38194808 3.03215207
[68,] 1.86357929 1.38194808
[69,] -0.28904815 1.86357929
[70,] 1.59741636 -0.28904815
[71,] 1.93619877 1.59741636
[72,] 5.57380859 1.93619877
[73,] -1.63670755 5.57380859
[74,] 3.52748854 -1.63670755
[75,] 6.31910217 3.52748854
[76,] 0.76239766 6.31910217
[77,] 1.99717131 0.76239766
[78,] 4.04944006 1.99717131
[79,] 2.81550427 4.04944006
[80,] -0.69510522 2.81550427
[81,] 4.89596428 -0.69510522
[82,] -0.07287455 4.89596428
[83,] 0.54988758 -0.07287455
[84,] 3.68445315 0.54988758
[85,] 2.39230518 3.68445315
[86,] 1.23404512 2.39230518
[87,] -2.15632747 1.23404512
[88,] 5.73402569 -2.15632747
[89,] 2.65391994 5.73402569
[90,] 3.17435880 2.65391994
[91,] 1.02152749 3.17435880
[92,] 0.42060984 1.02152749
[93,] -1.21170044 0.42060984
[94,] -0.39992250 -1.21170044
[95,] -0.06596504 -0.39992250
[96,] -3.54635821 -0.06596504
[97,] 1.54746180 -3.54635821
[98,] 7.44933768 1.54746180
[99,] -6.50002803 7.44933768
[100,] -3.56598572 -6.50002803
[101,] -4.79998966 -3.56598572
[102,] -0.41869462 -4.79998966
[103,] 0.29219795 -0.41869462
[104,] -0.06439771 0.29219795
[105,] 5.98002854 -0.06439771
[106,] -2.14319626 5.98002854
[107,] -7.92009927 -2.14319626
[108,] -1.59169409 -7.92009927
[109,] 1.85823001 -1.59169409
[110,] -7.86362865 1.85823001
[111,] -3.60254637 -7.86362865
[112,] 2.06616218 -3.60254637
[113,] -7.23125104 2.06616218
[114,] -3.22341960 -7.23125104
[115,] -4.83670106 -3.22341960
[116,] -3.95787381 -4.83670106
[117,] 2.44534364 -3.95787381
[118,] 1.23883657 2.44534364
[119,] 1.92000110 1.23883657
[120,] 0.77875121 1.92000110
[121,] 2.80966671 0.77875121
[122,] 4.82818552 2.80966671
[123,] 1.09592309 4.82818552
[124,] -4.01624470 1.09592309
[125,] 1.41858286 -4.01624470
[126,] 2.68226519 1.41858286
[127,] 1.32669744 2.68226519
[128,] 3.49011881 1.32669744
[129,] -0.24867162 3.49011881
[130,] -2.01346737 -0.24867162
[131,] -8.71574364 -2.01346737
[132,] 2.87812383 -8.71574364
[133,] -6.22474901 2.87812383
[134,] -8.87149152 -6.22474901
[135,] -1.79757579 -8.87149152
[136,] -7.34235194 -1.79757579
[137,] -0.05975300 -7.34235194
[138,] 0.52919197 -0.05975300
[139,] -1.44277775 0.52919197
[140,] -2.47132944 -1.44277775
[141,] -1.82020523 -2.47132944
[142,] -3.86300058 -1.82020523
[143,] 0.10931476 -3.86300058
[144,] -0.95848897 0.10931476
[145,] 0.98201294 -0.95848897
[146,] 5.94053916 0.98201294
[147,] -8.62724492 5.94053916
[148,] -0.50038293 -8.62724492
[149,] -0.04407144 -0.50038293
[150,] 0.72825469 -0.04407144
[151,] 0.60694112 0.72825469
[152,] 2.76230568 0.60694112
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.62143362 -0.91216275
2 -0.92934622 -2.62143362
3 1.59812499 -0.92934622
4 2.77984890 1.59812499
5 -2.78288290 2.77984890
6 2.54073050 -2.78288290
7 -6.59593442 2.54073050
8 -2.11928537 -6.59593442
9 3.10706276 -2.11928537
10 -2.94116579 3.10706276
11 -7.66765318 -2.94116579
12 1.94373505 -7.66765318
13 -1.78689346 1.94373505
14 -2.51450230 -1.78689346
15 -0.89068330 -2.51450230
16 1.54614995 -0.89068330
17 1.62898096 1.54614995
18 5.90284817 1.62898096
19 1.95041628 5.90284817
20 0.37492086 1.95041628
21 3.36921156 0.37492086
22 0.81249829 3.36921156
23 0.14993465 0.81249829
24 4.51251000 0.14993465
25 1.86015640 4.51251000
26 -7.15632583 1.86015640
27 -1.20963614 -7.15632583
28 -1.72116509 -1.20963614
29 -0.88760559 -1.72116509
30 -3.43023690 -0.88760559
31 -0.81019457 -3.43023690
32 -0.81761294 -0.81019457
33 -2.77376803 -0.81761294
34 6.92814361 -2.77376803
35 0.10905350 6.92814361
36 -1.90509525 0.10905350
37 -0.89810348 -1.90509525
38 -1.36975078 -0.89810348
39 2.57029444 -1.36975078
40 3.21857260 2.57029444
41 -3.58449149 3.21857260
42 -0.17999182 -3.58449149
43 -2.82306731 -0.17999182
44 -1.77049673 -2.82306731
45 2.06482609 -1.77049673
46 6.38439814 2.06482609
47 -5.16685584 6.38439814
48 -0.03677065 -5.16685584
49 5.47212851 -0.03677065
50 3.11384749 5.47212851
51 -1.16060745 3.11384749
52 4.04643117 -1.16060745
53 -4.24328283 4.04643117
54 2.12016480 -4.24328283
55 0.51160302 2.12016480
56 4.41047960 0.51160302
57 -0.20696260 4.41047960
58 0.41704759 -0.20696260
59 3.03007837 0.41704759
60 2.49135017 3.03007837
61 -3.11310748 2.49135017
62 1.87801653 -3.11310748
63 1.07062793 1.87801653
64 1.03860748 1.07062793
65 0.50355794 1.03860748
66 3.03215207 0.50355794
67 1.38194808 3.03215207
68 1.86357929 1.38194808
69 -0.28904815 1.86357929
70 1.59741636 -0.28904815
71 1.93619877 1.59741636
72 5.57380859 1.93619877
73 -1.63670755 5.57380859
74 3.52748854 -1.63670755
75 6.31910217 3.52748854
76 0.76239766 6.31910217
77 1.99717131 0.76239766
78 4.04944006 1.99717131
79 2.81550427 4.04944006
80 -0.69510522 2.81550427
81 4.89596428 -0.69510522
82 -0.07287455 4.89596428
83 0.54988758 -0.07287455
84 3.68445315 0.54988758
85 2.39230518 3.68445315
86 1.23404512 2.39230518
87 -2.15632747 1.23404512
88 5.73402569 -2.15632747
89 2.65391994 5.73402569
90 3.17435880 2.65391994
91 1.02152749 3.17435880
92 0.42060984 1.02152749
93 -1.21170044 0.42060984
94 -0.39992250 -1.21170044
95 -0.06596504 -0.39992250
96 -3.54635821 -0.06596504
97 1.54746180 -3.54635821
98 7.44933768 1.54746180
99 -6.50002803 7.44933768
100 -3.56598572 -6.50002803
101 -4.79998966 -3.56598572
102 -0.41869462 -4.79998966
103 0.29219795 -0.41869462
104 -0.06439771 0.29219795
105 5.98002854 -0.06439771
106 -2.14319626 5.98002854
107 -7.92009927 -2.14319626
108 -1.59169409 -7.92009927
109 1.85823001 -1.59169409
110 -7.86362865 1.85823001
111 -3.60254637 -7.86362865
112 2.06616218 -3.60254637
113 -7.23125104 2.06616218
114 -3.22341960 -7.23125104
115 -4.83670106 -3.22341960
116 -3.95787381 -4.83670106
117 2.44534364 -3.95787381
118 1.23883657 2.44534364
119 1.92000110 1.23883657
120 0.77875121 1.92000110
121 2.80966671 0.77875121
122 4.82818552 2.80966671
123 1.09592309 4.82818552
124 -4.01624470 1.09592309
125 1.41858286 -4.01624470
126 2.68226519 1.41858286
127 1.32669744 2.68226519
128 3.49011881 1.32669744
129 -0.24867162 3.49011881
130 -2.01346737 -0.24867162
131 -8.71574364 -2.01346737
132 2.87812383 -8.71574364
133 -6.22474901 2.87812383
134 -8.87149152 -6.22474901
135 -1.79757579 -8.87149152
136 -7.34235194 -1.79757579
137 -0.05975300 -7.34235194
138 0.52919197 -0.05975300
139 -1.44277775 0.52919197
140 -2.47132944 -1.44277775
141 -1.82020523 -2.47132944
142 -3.86300058 -1.82020523
143 0.10931476 -3.86300058
144 -0.95848897 0.10931476
145 0.98201294 -0.95848897
146 5.94053916 0.98201294
147 -8.62724492 5.94053916
148 -0.50038293 -8.62724492
149 -0.04407144 -0.50038293
150 0.72825469 -0.04407144
151 0.60694112 0.72825469
152 2.76230568 0.60694112
> 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/7iphy1291325413.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/8iphy1291325413.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/9iphy1291325413.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/10ykn81291325413.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/11wzf71291325413.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/12ihdv1291325413.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/13o0s61291325413.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/14sj8c1291325413.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/15v1pi1291325413.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/16h26o1291325413.tab")
+ }
> try(system("convert tmp/1mfj71291325413.ps tmp/1mfj71291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/2mfj71291325413.ps tmp/2mfj71291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/3f7ia1291325413.ps tmp/3f7ia1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/4f7ia1291325413.ps tmp/4f7ia1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/5f7ia1291325413.ps tmp/5f7ia1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/6pyid1291325413.ps tmp/6pyid1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/7iphy1291325413.ps tmp/7iphy1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/8iphy1291325413.ps tmp/8iphy1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/9iphy1291325413.ps tmp/9iphy1291325413.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ykn81291325413.ps tmp/10ykn81291325413.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.026 1.739 10.597