R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(41
+ ,38
+ ,7
+ ,2
+ ,39
+ ,32
+ ,5
+ ,2
+ ,30
+ ,35
+ ,5
+ ,2
+ ,31
+ ,33
+ ,5
+ ,1
+ ,34
+ ,37
+ ,8
+ ,2
+ ,35
+ ,29
+ ,6
+ ,2
+ ,39
+ ,31
+ ,5
+ ,2
+ ,34
+ ,36
+ ,6
+ ,2
+ ,36
+ ,35
+ ,5
+ ,2
+ ,37
+ ,38
+ ,4
+ ,2
+ ,38
+ ,31
+ ,6
+ ,1
+ ,36
+ ,34
+ ,5
+ ,2
+ ,38
+ ,35
+ ,5
+ ,1
+ ,39
+ ,38
+ ,6
+ ,2
+ ,33
+ ,37
+ ,7
+ ,2
+ ,32
+ ,33
+ ,6
+ ,1
+ ,36
+ ,32
+ ,7
+ ,1
+ ,38
+ ,38
+ ,6
+ ,2
+ ,39
+ ,38
+ ,8
+ ,1
+ ,32
+ ,32
+ ,7
+ ,2
+ ,32
+ ,33
+ ,5
+ ,1
+ ,31
+ ,31
+ ,5
+ ,2
+ ,39
+ ,38
+ ,7
+ ,2
+ ,37
+ ,39
+ ,7
+ ,2
+ ,39
+ ,32
+ ,5
+ ,1
+ ,41
+ ,32
+ ,4
+ ,2
+ ,36
+ ,35
+ ,10
+ ,1
+ ,33
+ ,37
+ ,6
+ ,2
+ ,33
+ ,33
+ ,5
+ ,2
+ ,34
+ ,33
+ ,5
+ ,1
+ ,31
+ ,28
+ ,5
+ ,2
+ ,27
+ ,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32
+ ,7
+ ,2
+ ,32
+ ,35
+ ,6
+ ,2
+ ,34
+ ,36
+ ,6
+ ,2)
+ ,dim=c(4
+ ,162)
+ ,dimnames=list(c('Conected'
+ ,'Seperate'
+ ,'Age'
+ ,'Gender')
+ ,1:162))
> y <- array(NA,dim=c(4,162),dimnames=list(c('Conected','Seperate','Age','Gender'),1:162))
> 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 = '3'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '3'
> #'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, 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
Age Conected Seperate Gender
1 7 41 38 2
2 5 39 32 2
3 5 30 35 2
4 5 31 33 1
5 8 34 37 2
6 6 35 29 2
7 5 39 31 2
8 6 34 36 2
9 5 36 35 2
10 4 37 38 2
11 6 38 31 1
12 5 36 34 2
13 5 38 35 1
14 6 39 38 2
15 7 33 37 2
16 6 32 33 1
17 7 36 32 1
18 6 38 38 2
19 8 39 38 1
20 7 32 32 2
21 5 32 33 1
22 5 31 31 2
23 7 39 38 2
24 7 37 39 2
25 5 39 32 1
26 4 41 32 2
27 10 36 35 1
28 6 33 37 2
29 5 33 33 2
30 5 34 33 1
31 5 31 28 2
32 5 27 32 1
33 6 37 31 2
34 5 34 37 2
35 5 34 30 1
36 5 32 33 1
37 5 29 31 1
38 5 36 33 1
39 5 29 31 2
40 5 35 33 1
41 5 37 32 1
42 7 34 33 2
43 5 38 32 1
44 6 35 33 1
45 7 38 28 2
46 7 37 35 2
47 5 38 39 2
48 5 33 34 2
49 4 36 38 2
50 5 38 32 1
51 4 32 38 2
52 5 32 30 1
53 5 32 33 1
54 7 34 38 2
55 5 32 32 1
56 5 37 32 2
57 6 39 34 2
58 4 29 34 2
59 6 37 36 1
60 6 35 34 2
61 5 30 28 1
62 7 38 34 1
63 6 34 35 2
64 8 31 35 2
65 7 34 31 2
66 5 35 37 1
67 6 36 35 2
68 6 30 27 1
69 5 39 40 2
70 5 35 37 1
71 5 38 36 1
72 5 31 38 2
73 4 34 39 2
74 6 38 41 1
75 6 34 27 1
76 6 39 30 2
77 6 37 37 2
78 7 34 31 2
79 5 28 31 1
80 7 37 27 1
81 6 33 36 1
82 5 37 38 1
83 5 35 37 2
84 4 37 33 1
85 8 32 34 2
86 8 33 31 2
87 5 38 39 1
88 5 33 34 2
89 6 29 32 2
90 4 33 33 2
91 5 31 36 2
92 5 36 32 2
93 5 35 41 2
94 5 32 28 2
95 6 29 30 2
96 6 39 36 2
97 5 37 35 2
98 6 35 31 2
99 5 37 34 1
100 7 32 36 1
101 5 38 36 2
102 6 37 35 1
103 6 36 37 2
104 6 32 28 1
105 4 33 39 2
106 5 40 32 1
107 5 38 35 2
108 7 41 39 1
109 6 36 35 1
110 9 43 42 2
111 6 30 34 2
112 6 31 33 2
113 5 32 41 2
114 6 32 33 1
115 5 37 34 2
116 8 37 32 1
117 7 33 40 2
118 5 34 40 2
119 7 33 35 2
120 6 38 36 2
121 6 33 37 2
122 9 31 27 2
123 7 38 39 2
124 6 37 38 2
125 5 33 31 2
126 5 31 33 2
127 6 39 32 1
128 6 44 39 2
129 7 33 36 2
130 5 35 33 2
131 5 32 33 1
132 5 28 32 1
133 6 40 37 2
134 4 27 30 1
135 5 37 38 1
136 7 32 29 2
137 5 28 22 1
138 7 34 35 1
139 7 30 35 2
140 6 35 34 2
141 5 31 35 1
142 8 32 34 2
143 5 30 34 1
144 5 30 35 2
145 5 31 23 1
146 6 40 31 2
147 4 32 27 2
148 5 36 36 1
149 5 32 31 1
150 7 35 32 1
151 6 38 39 2
152 7 42 37 2
153 10 34 38 1
154 6 35 39 2
155 8 35 34 2
156 4 33 31 2
157 5 36 32 2
158 6 32 37 2
159 7 33 36 2
160 7 34 32 2
161 6 32 35 2
162 6 34 36 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Conected Seperate Gender
3.54415 0.04388 0.01445 0.14429
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.0940 -0.7994 -0.1077 0.4926 4.2707
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.54415 1.10355 3.212 0.0016 **
Conected 0.04388 0.02901 1.512 0.1324
Seperate 0.01445 0.02834 0.510 0.6109
Gender 0.14429 0.19296 0.748 0.4557
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.155 on 158 degrees of freedom
Multiple R-squared: 0.02832, Adjusted R-squared: 0.009869
F-statistic: 1.535 on 3 and 158 DF, p-value: 0.2076
> 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.69314625 0.6137075 0.3068538
[2,] 0.55557039 0.8888592 0.4444296
[3,] 0.53903511 0.9219298 0.4609649
[4,] 0.79297328 0.4140534 0.2070267
[5,] 0.73392505 0.5321499 0.2660749
[6,] 0.66394909 0.6721018 0.3360509
[7,] 0.59568636 0.8086273 0.4043136
[8,] 0.50053412 0.9989318 0.4994659
[9,] 0.50009993 0.9998001 0.4999001
[10,] 0.42880767 0.8576153 0.5711923
[11,] 0.47187040 0.9437408 0.5281296
[12,] 0.39002023 0.7800405 0.6099798
[13,] 0.45669272 0.9133854 0.5433073
[14,] 0.51292862 0.9741428 0.4870714
[15,] 0.49141802 0.9828360 0.5085820
[16,] 0.42798612 0.8559722 0.5720139
[17,] 0.38908889 0.7781778 0.6109111
[18,] 0.34349528 0.6869906 0.6565047
[19,] 0.31128580 0.6225716 0.6887142
[20,] 0.35447941 0.7089588 0.6455206
[21,] 0.86565824 0.2686835 0.1343418
[22,] 0.83158633 0.3368273 0.1684137
[23,] 0.79970709 0.4005858 0.2002929
[24,] 0.79294170 0.4141166 0.2070583
[25,] 0.75816173 0.4836765 0.2418383
[26,] 0.73434516 0.5313097 0.2656548
[27,] 0.70652430 0.5869514 0.2934757
[28,] 0.69895026 0.6020995 0.3010497
[29,] 0.65839399 0.6832120 0.3416060
[30,] 0.63173763 0.7365247 0.3682624
[31,] 0.58437426 0.8312515 0.4156257
[32,] 0.55953718 0.8809256 0.4404628
[33,] 0.50901767 0.9819647 0.4909823
[34,] 0.47939235 0.9587847 0.5206076
[35,] 0.44437522 0.8887504 0.5556248
[36,] 0.47511739 0.9502348 0.5248826
[37,] 0.44074177 0.8814835 0.5592582
[38,] 0.39252300 0.7850460 0.6074770
[39,] 0.47128103 0.9425621 0.5287190
[40,] 0.45896912 0.9179382 0.5410309
[41,] 0.47764316 0.9552863 0.5223568
[42,] 0.44654308 0.8930862 0.5534569
[43,] 0.55608333 0.8878333 0.4439167
[44,] 0.52804311 0.9439138 0.4719569
[45,] 0.59688116 0.8062377 0.4031188
[46,] 0.55473840 0.8905232 0.4452616
[47,] 0.51579513 0.9684097 0.4842049
[48,] 0.51215544 0.9756891 0.4878446
[49,] 0.47191543 0.9438309 0.5280846
[50,] 0.44548517 0.8909703 0.5545148
[51,] 0.39916469 0.7983294 0.6008353
[52,] 0.42412084 0.8482417 0.5758792
[53,] 0.37798483 0.7559697 0.6220152
[54,] 0.33684475 0.6736895 0.6631552
[55,] 0.29835608 0.5967122 0.7016439
[56,] 0.29424702 0.5884940 0.7057530
[57,] 0.25744835 0.5148967 0.7425517
[58,] 0.39919296 0.7983859 0.6008070
[59,] 0.42148038 0.8429608 0.5785196
[60,] 0.40094948 0.8018990 0.5990505
[61,] 0.35692042 0.7138408 0.6430796
[62,] 0.33470316 0.6694063 0.6652968
[63,] 0.33618917 0.6723783 0.6638108
[64,] 0.31387362 0.6277472 0.6861264
[65,] 0.29718430 0.5943686 0.7028157
[66,] 0.27287134 0.5457427 0.7271287
[67,] 0.33533534 0.6706707 0.6646647
[68,] 0.29459852 0.5891970 0.7054015
[69,] 0.26197210 0.5239442 0.7380279
[70,] 0.22633759 0.4526752 0.7736624
[71,] 0.19375836 0.3875167 0.8062416
[72,] 0.19978308 0.3995662 0.8002169
[73,] 0.17195794 0.3439159 0.8280421
[74,] 0.17746990 0.3549398 0.8225301
[75,] 0.15224809 0.3044962 0.8477519
[76,] 0.14027200 0.2805440 0.8597280
[77,] 0.12969582 0.2593916 0.8703042
[78,] 0.16751211 0.3350242 0.8324879
[79,] 0.26330747 0.5266149 0.7366925
[80,] 0.37588718 0.7517744 0.6241128
[81,] 0.36527125 0.7305425 0.6347288
[82,] 0.34127578 0.6825516 0.6587242
[83,] 0.30582143 0.6116429 0.6941786
[84,] 0.35918658 0.7183732 0.6408134
[85,] 0.33343724 0.6668745 0.6665628
[86,] 0.31597057 0.6319411 0.6840294
[87,] 0.30819250 0.6163850 0.6918075
[88,] 0.28074396 0.5614879 0.7192560
[89,] 0.24850243 0.4970049 0.7514976
[90,] 0.21431564 0.4286313 0.7856844
[91,] 0.20620654 0.4124131 0.7937935
[92,] 0.17515375 0.3503075 0.8248463
[93,] 0.16432783 0.3286557 0.8356722
[94,] 0.17278806 0.3455761 0.8272119
[95,] 0.17053446 0.3410689 0.8294655
[96,] 0.14371798 0.2874360 0.8562820
[97,] 0.11987719 0.2397544 0.8801228
[98,] 0.10072062 0.2014412 0.8992794
[99,] 0.14520101 0.2904020 0.8547990
[100,] 0.14072005 0.2814401 0.8592799
[101,] 0.14222073 0.2844415 0.8577793
[102,] 0.12944331 0.2588866 0.8705567
[103,] 0.10678376 0.2135675 0.8932162
[104,] 0.20076767 0.4015353 0.7992323
[105,] 0.17072998 0.3414600 0.8292700
[106,] 0.14309350 0.2861870 0.8569065
[107,] 0.13846914 0.2769383 0.8615309
[108,] 0.11485488 0.2297098 0.8851451
[109,] 0.11168203 0.2233641 0.8883180
[110,] 0.17825825 0.3565165 0.8217418
[111,] 0.16572681 0.3314536 0.8342732
[112,] 0.17081153 0.3416231 0.8291885
[113,] 0.16206344 0.3241269 0.8379366
[114,] 0.13397107 0.2679421 0.8660289
[115,] 0.10957598 0.2191520 0.8904240
[116,] 0.43068280 0.8613656 0.5693172
[117,] 0.39394357 0.7878871 0.6060564
[118,] 0.34950577 0.6990115 0.6504942
[119,] 0.31678089 0.6335618 0.6832191
[120,] 0.29202746 0.5840549 0.7079725
[121,] 0.24780761 0.4956152 0.7521924
[122,] 0.22207057 0.4441411 0.7779294
[123,] 0.20428603 0.4085721 0.7957140
[124,] 0.19147521 0.3829504 0.8085248
[125,] 0.16583140 0.3316628 0.8341686
[126,] 0.13680183 0.2736037 0.8631982
[127,] 0.11394083 0.2278817 0.8860592
[128,] 0.12150518 0.2430104 0.8784948
[129,] 0.14620800 0.2924160 0.8537920
[130,] 0.17390975 0.3478195 0.8260903
[131,] 0.14781636 0.2956327 0.8521836
[132,] 0.12645937 0.2529187 0.8735406
[133,] 0.12387302 0.2477460 0.8761270
[134,] 0.09265079 0.1853016 0.9073492
[135,] 0.09204251 0.1840850 0.9079575
[136,] 0.18619214 0.3723843 0.8138079
[137,] 0.18672816 0.3734563 0.8132718
[138,] 0.15837228 0.3167446 0.8416277
[139,] 0.12230786 0.2446157 0.8776921
[140,] 0.09287438 0.1857488 0.9071256
[141,] 0.07077300 0.1415460 0.9292270
[142,] 0.18541865 0.3708373 0.8145813
[143,] 0.31996843 0.6399369 0.6800316
[144,] 0.39231841 0.7846368 0.6076816
[145,] 0.34165168 0.6833034 0.6583483
[146,] 0.24766951 0.4953390 0.7523305
[147,] 0.20904215 0.4180843 0.7909578
[148,] 0.21716726 0.4343345 0.7828327
[149,] 0.31116687 0.6223337 0.6888331
> postscript(file="/var/wessaorg/rcomp/tmp/1p8cd1352063389.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/wessaorg/rcomp/tmp/2nnkt1352063389.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/wessaorg/rcomp/tmp/38hej1352063389.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/wessaorg/rcomp/tmp/4vzw41352063389.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/wessaorg/rcomp/tmp/5ekps1352063389.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 = 162
Frequency = 1
1 2 3 4 5 6
0.819306696 -1.006258022 -0.654694691 -0.525391282 2.140899890 0.212593911
7 8 9 10 11 12
-0.991811507 0.155346405 -0.917963274 -2.005180916 0.196355068 -0.903516760
13 14 15 16 17 18
-0.861430991 -0.092937110 1.184777988 0.430730621 1.269664747 -0.049059013
19 20 21 22 23 24
2.051351367 1.300888658 -0.569269379 -0.640786730 0.907062890 0.980372569
25 26 27 28 29 30
-0.861969544 -2.094014216 4.226325203 0.184777988 -0.757435954 -0.657025573
31 32 33 34 35 36
-0.597447186 -0.335432378 0.095944687 -0.859100110 -0.613686029 -0.569269379
37 38 39 40 41 42
-0.408742058 -0.744781767 -0.553030535 -0.700903670 -0.774213350 1.198685949
43 44 45 46 47 48
-0.818091447 0.299096330 1.095406134 1.038158628 -1.063505528 -0.771882468
49 50 51 52 53 54
-1.961302819 -0.818091447 -1.785790430 -0.525929835 -0.569269379 1.126453376
55 56 57 58 59 60
-0.554822864 -0.918501827 -0.035151051 -1.596370080 0.168000591 0.140361337
61 62 63 64 65 66
-0.409280611 1.153015524 0.169792920 2.301427211 1.227578979 -0.758689729
67 68 69 70 71 72
0.082036726 0.605165904 -1.121830140 -0.758689729 -0.875877506 -0.741912333
73 74 75 76 77 78
-1.887993139 0.051889920 0.429653515 0.022635008 0.009265599 1.227578979
79 80 81 82 83 84
-0.364863961 1.298019224 0.343512980 -0.860892438 -0.902978207 -1.788659865
85 86 87 88 89 90
2.271995629 2.271457076 -0.919217050 -0.771882468 0.432522950 -1.757435954
91 92 93 94 95 96
-0.713019303 -0.874623730 -0.960764266 -0.641325283 0.461415979 -0.064044081
97 98 99 100 101 102
-0.961841372 0.183700882 -0.803106379 1.387391077 -1.020165984 0.182447106
103 104 105 106 107 108
0.053143696 0.502963195 -1.844115042 -0.905847641 -1.005719469 0.949148658
109 110 111 112 113 114
0.226325203 2.673764442 0.359751823 0.330320241 -0.829129974 0.430730621
115 116 117 118 119 120
-0.947394857 2.225786650 1.141438443 -0.902439654 1.213671017 -0.020165984
121 122 123 124 125 126
0.184777988 3.416999329 0.936494472 -0.005180916 -0.728542924 -0.669679759
127 128 129 130 131 132
0.138030456 -0.326774111 1.199224502 -0.845192148 -0.569269379 -0.379310475
133 134 135 136 137 138
-0.122368693 -1.306539349 -0.860892438 1.344228203 -0.234845328 1.314081397
139 140 141 142 143 144
1.345305309 0.140361337 -0.554284311 2.271995629 -0.495959699 -0.654694691
145 146 147 148 149 150
-0.380926134 -0.035689604 -1.626878768 -0.788121312 -0.540376349 1.313542844
151 152 153 154 155 156
-0.063505528 0.789875113 4.270741853 0.068128764 2.140361337 -1.728542924
157 158 159 160 161 162
-0.874623730 0.228656085 1.199224502 1.213132464 0.257549114 0.155346405
> postscript(file="/var/wessaorg/rcomp/tmp/6ylpb1352063389.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 0.819306696 NA
1 -1.006258022 0.819306696
2 -0.654694691 -1.006258022
3 -0.525391282 -0.654694691
4 2.140899890 -0.525391282
5 0.212593911 2.140899890
6 -0.991811507 0.212593911
7 0.155346405 -0.991811507
8 -0.917963274 0.155346405
9 -2.005180916 -0.917963274
10 0.196355068 -2.005180916
11 -0.903516760 0.196355068
12 -0.861430991 -0.903516760
13 -0.092937110 -0.861430991
14 1.184777988 -0.092937110
15 0.430730621 1.184777988
16 1.269664747 0.430730621
17 -0.049059013 1.269664747
18 2.051351367 -0.049059013
19 1.300888658 2.051351367
20 -0.569269379 1.300888658
21 -0.640786730 -0.569269379
22 0.907062890 -0.640786730
23 0.980372569 0.907062890
24 -0.861969544 0.980372569
25 -2.094014216 -0.861969544
26 4.226325203 -2.094014216
27 0.184777988 4.226325203
28 -0.757435954 0.184777988
29 -0.657025573 -0.757435954
30 -0.597447186 -0.657025573
31 -0.335432378 -0.597447186
32 0.095944687 -0.335432378
33 -0.859100110 0.095944687
34 -0.613686029 -0.859100110
35 -0.569269379 -0.613686029
36 -0.408742058 -0.569269379
37 -0.744781767 -0.408742058
38 -0.553030535 -0.744781767
39 -0.700903670 -0.553030535
40 -0.774213350 -0.700903670
41 1.198685949 -0.774213350
42 -0.818091447 1.198685949
43 0.299096330 -0.818091447
44 1.095406134 0.299096330
45 1.038158628 1.095406134
46 -1.063505528 1.038158628
47 -0.771882468 -1.063505528
48 -1.961302819 -0.771882468
49 -0.818091447 -1.961302819
50 -1.785790430 -0.818091447
51 -0.525929835 -1.785790430
52 -0.569269379 -0.525929835
53 1.126453376 -0.569269379
54 -0.554822864 1.126453376
55 -0.918501827 -0.554822864
56 -0.035151051 -0.918501827
57 -1.596370080 -0.035151051
58 0.168000591 -1.596370080
59 0.140361337 0.168000591
60 -0.409280611 0.140361337
61 1.153015524 -0.409280611
62 0.169792920 1.153015524
63 2.301427211 0.169792920
64 1.227578979 2.301427211
65 -0.758689729 1.227578979
66 0.082036726 -0.758689729
67 0.605165904 0.082036726
68 -1.121830140 0.605165904
69 -0.758689729 -1.121830140
70 -0.875877506 -0.758689729
71 -0.741912333 -0.875877506
72 -1.887993139 -0.741912333
73 0.051889920 -1.887993139
74 0.429653515 0.051889920
75 0.022635008 0.429653515
76 0.009265599 0.022635008
77 1.227578979 0.009265599
78 -0.364863961 1.227578979
79 1.298019224 -0.364863961
80 0.343512980 1.298019224
81 -0.860892438 0.343512980
82 -0.902978207 -0.860892438
83 -1.788659865 -0.902978207
84 2.271995629 -1.788659865
85 2.271457076 2.271995629
86 -0.919217050 2.271457076
87 -0.771882468 -0.919217050
88 0.432522950 -0.771882468
89 -1.757435954 0.432522950
90 -0.713019303 -1.757435954
91 -0.874623730 -0.713019303
92 -0.960764266 -0.874623730
93 -0.641325283 -0.960764266
94 0.461415979 -0.641325283
95 -0.064044081 0.461415979
96 -0.961841372 -0.064044081
97 0.183700882 -0.961841372
98 -0.803106379 0.183700882
99 1.387391077 -0.803106379
100 -1.020165984 1.387391077
101 0.182447106 -1.020165984
102 0.053143696 0.182447106
103 0.502963195 0.053143696
104 -1.844115042 0.502963195
105 -0.905847641 -1.844115042
106 -1.005719469 -0.905847641
107 0.949148658 -1.005719469
108 0.226325203 0.949148658
109 2.673764442 0.226325203
110 0.359751823 2.673764442
111 0.330320241 0.359751823
112 -0.829129974 0.330320241
113 0.430730621 -0.829129974
114 -0.947394857 0.430730621
115 2.225786650 -0.947394857
116 1.141438443 2.225786650
117 -0.902439654 1.141438443
118 1.213671017 -0.902439654
119 -0.020165984 1.213671017
120 0.184777988 -0.020165984
121 3.416999329 0.184777988
122 0.936494472 3.416999329
123 -0.005180916 0.936494472
124 -0.728542924 -0.005180916
125 -0.669679759 -0.728542924
126 0.138030456 -0.669679759
127 -0.326774111 0.138030456
128 1.199224502 -0.326774111
129 -0.845192148 1.199224502
130 -0.569269379 -0.845192148
131 -0.379310475 -0.569269379
132 -0.122368693 -0.379310475
133 -1.306539349 -0.122368693
134 -0.860892438 -1.306539349
135 1.344228203 -0.860892438
136 -0.234845328 1.344228203
137 1.314081397 -0.234845328
138 1.345305309 1.314081397
139 0.140361337 1.345305309
140 -0.554284311 0.140361337
141 2.271995629 -0.554284311
142 -0.495959699 2.271995629
143 -0.654694691 -0.495959699
144 -0.380926134 -0.654694691
145 -0.035689604 -0.380926134
146 -1.626878768 -0.035689604
147 -0.788121312 -1.626878768
148 -0.540376349 -0.788121312
149 1.313542844 -0.540376349
150 -0.063505528 1.313542844
151 0.789875113 -0.063505528
152 4.270741853 0.789875113
153 0.068128764 4.270741853
154 2.140361337 0.068128764
155 -1.728542924 2.140361337
156 -0.874623730 -1.728542924
157 0.228656085 -0.874623730
158 1.199224502 0.228656085
159 1.213132464 1.199224502
160 0.257549114 1.213132464
161 0.155346405 0.257549114
162 NA 0.155346405
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.006258022 0.819306696
[2,] -0.654694691 -1.006258022
[3,] -0.525391282 -0.654694691
[4,] 2.140899890 -0.525391282
[5,] 0.212593911 2.140899890
[6,] -0.991811507 0.212593911
[7,] 0.155346405 -0.991811507
[8,] -0.917963274 0.155346405
[9,] -2.005180916 -0.917963274
[10,] 0.196355068 -2.005180916
[11,] -0.903516760 0.196355068
[12,] -0.861430991 -0.903516760
[13,] -0.092937110 -0.861430991
[14,] 1.184777988 -0.092937110
[15,] 0.430730621 1.184777988
[16,] 1.269664747 0.430730621
[17,] -0.049059013 1.269664747
[18,] 2.051351367 -0.049059013
[19,] 1.300888658 2.051351367
[20,] -0.569269379 1.300888658
[21,] -0.640786730 -0.569269379
[22,] 0.907062890 -0.640786730
[23,] 0.980372569 0.907062890
[24,] -0.861969544 0.980372569
[25,] -2.094014216 -0.861969544
[26,] 4.226325203 -2.094014216
[27,] 0.184777988 4.226325203
[28,] -0.757435954 0.184777988
[29,] -0.657025573 -0.757435954
[30,] -0.597447186 -0.657025573
[31,] -0.335432378 -0.597447186
[32,] 0.095944687 -0.335432378
[33,] -0.859100110 0.095944687
[34,] -0.613686029 -0.859100110
[35,] -0.569269379 -0.613686029
[36,] -0.408742058 -0.569269379
[37,] -0.744781767 -0.408742058
[38,] -0.553030535 -0.744781767
[39,] -0.700903670 -0.553030535
[40,] -0.774213350 -0.700903670
[41,] 1.198685949 -0.774213350
[42,] -0.818091447 1.198685949
[43,] 0.299096330 -0.818091447
[44,] 1.095406134 0.299096330
[45,] 1.038158628 1.095406134
[46,] -1.063505528 1.038158628
[47,] -0.771882468 -1.063505528
[48,] -1.961302819 -0.771882468
[49,] -0.818091447 -1.961302819
[50,] -1.785790430 -0.818091447
[51,] -0.525929835 -1.785790430
[52,] -0.569269379 -0.525929835
[53,] 1.126453376 -0.569269379
[54,] -0.554822864 1.126453376
[55,] -0.918501827 -0.554822864
[56,] -0.035151051 -0.918501827
[57,] -1.596370080 -0.035151051
[58,] 0.168000591 -1.596370080
[59,] 0.140361337 0.168000591
[60,] -0.409280611 0.140361337
[61,] 1.153015524 -0.409280611
[62,] 0.169792920 1.153015524
[63,] 2.301427211 0.169792920
[64,] 1.227578979 2.301427211
[65,] -0.758689729 1.227578979
[66,] 0.082036726 -0.758689729
[67,] 0.605165904 0.082036726
[68,] -1.121830140 0.605165904
[69,] -0.758689729 -1.121830140
[70,] -0.875877506 -0.758689729
[71,] -0.741912333 -0.875877506
[72,] -1.887993139 -0.741912333
[73,] 0.051889920 -1.887993139
[74,] 0.429653515 0.051889920
[75,] 0.022635008 0.429653515
[76,] 0.009265599 0.022635008
[77,] 1.227578979 0.009265599
[78,] -0.364863961 1.227578979
[79,] 1.298019224 -0.364863961
[80,] 0.343512980 1.298019224
[81,] -0.860892438 0.343512980
[82,] -0.902978207 -0.860892438
[83,] -1.788659865 -0.902978207
[84,] 2.271995629 -1.788659865
[85,] 2.271457076 2.271995629
[86,] -0.919217050 2.271457076
[87,] -0.771882468 -0.919217050
[88,] 0.432522950 -0.771882468
[89,] -1.757435954 0.432522950
[90,] -0.713019303 -1.757435954
[91,] -0.874623730 -0.713019303
[92,] -0.960764266 -0.874623730
[93,] -0.641325283 -0.960764266
[94,] 0.461415979 -0.641325283
[95,] -0.064044081 0.461415979
[96,] -0.961841372 -0.064044081
[97,] 0.183700882 -0.961841372
[98,] -0.803106379 0.183700882
[99,] 1.387391077 -0.803106379
[100,] -1.020165984 1.387391077
[101,] 0.182447106 -1.020165984
[102,] 0.053143696 0.182447106
[103,] 0.502963195 0.053143696
[104,] -1.844115042 0.502963195
[105,] -0.905847641 -1.844115042
[106,] -1.005719469 -0.905847641
[107,] 0.949148658 -1.005719469
[108,] 0.226325203 0.949148658
[109,] 2.673764442 0.226325203
[110,] 0.359751823 2.673764442
[111,] 0.330320241 0.359751823
[112,] -0.829129974 0.330320241
[113,] 0.430730621 -0.829129974
[114,] -0.947394857 0.430730621
[115,] 2.225786650 -0.947394857
[116,] 1.141438443 2.225786650
[117,] -0.902439654 1.141438443
[118,] 1.213671017 -0.902439654
[119,] -0.020165984 1.213671017
[120,] 0.184777988 -0.020165984
[121,] 3.416999329 0.184777988
[122,] 0.936494472 3.416999329
[123,] -0.005180916 0.936494472
[124,] -0.728542924 -0.005180916
[125,] -0.669679759 -0.728542924
[126,] 0.138030456 -0.669679759
[127,] -0.326774111 0.138030456
[128,] 1.199224502 -0.326774111
[129,] -0.845192148 1.199224502
[130,] -0.569269379 -0.845192148
[131,] -0.379310475 -0.569269379
[132,] -0.122368693 -0.379310475
[133,] -1.306539349 -0.122368693
[134,] -0.860892438 -1.306539349
[135,] 1.344228203 -0.860892438
[136,] -0.234845328 1.344228203
[137,] 1.314081397 -0.234845328
[138,] 1.345305309 1.314081397
[139,] 0.140361337 1.345305309
[140,] -0.554284311 0.140361337
[141,] 2.271995629 -0.554284311
[142,] -0.495959699 2.271995629
[143,] -0.654694691 -0.495959699
[144,] -0.380926134 -0.654694691
[145,] -0.035689604 -0.380926134
[146,] -1.626878768 -0.035689604
[147,] -0.788121312 -1.626878768
[148,] -0.540376349 -0.788121312
[149,] 1.313542844 -0.540376349
[150,] -0.063505528 1.313542844
[151,] 0.789875113 -0.063505528
[152,] 4.270741853 0.789875113
[153,] 0.068128764 4.270741853
[154,] 2.140361337 0.068128764
[155,] -1.728542924 2.140361337
[156,] -0.874623730 -1.728542924
[157,] 0.228656085 -0.874623730
[158,] 1.199224502 0.228656085
[159,] 1.213132464 1.199224502
[160,] 0.257549114 1.213132464
[161,] 0.155346405 0.257549114
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.006258022 0.819306696
2 -0.654694691 -1.006258022
3 -0.525391282 -0.654694691
4 2.140899890 -0.525391282
5 0.212593911 2.140899890
6 -0.991811507 0.212593911
7 0.155346405 -0.991811507
8 -0.917963274 0.155346405
9 -2.005180916 -0.917963274
10 0.196355068 -2.005180916
11 -0.903516760 0.196355068
12 -0.861430991 -0.903516760
13 -0.092937110 -0.861430991
14 1.184777988 -0.092937110
15 0.430730621 1.184777988
16 1.269664747 0.430730621
17 -0.049059013 1.269664747
18 2.051351367 -0.049059013
19 1.300888658 2.051351367
20 -0.569269379 1.300888658
21 -0.640786730 -0.569269379
22 0.907062890 -0.640786730
23 0.980372569 0.907062890
24 -0.861969544 0.980372569
25 -2.094014216 -0.861969544
26 4.226325203 -2.094014216
27 0.184777988 4.226325203
28 -0.757435954 0.184777988
29 -0.657025573 -0.757435954
30 -0.597447186 -0.657025573
31 -0.335432378 -0.597447186
32 0.095944687 -0.335432378
33 -0.859100110 0.095944687
34 -0.613686029 -0.859100110
35 -0.569269379 -0.613686029
36 -0.408742058 -0.569269379
37 -0.744781767 -0.408742058
38 -0.553030535 -0.744781767
39 -0.700903670 -0.553030535
40 -0.774213350 -0.700903670
41 1.198685949 -0.774213350
42 -0.818091447 1.198685949
43 0.299096330 -0.818091447
44 1.095406134 0.299096330
45 1.038158628 1.095406134
46 -1.063505528 1.038158628
47 -0.771882468 -1.063505528
48 -1.961302819 -0.771882468
49 -0.818091447 -1.961302819
50 -1.785790430 -0.818091447
51 -0.525929835 -1.785790430
52 -0.569269379 -0.525929835
53 1.126453376 -0.569269379
54 -0.554822864 1.126453376
55 -0.918501827 -0.554822864
56 -0.035151051 -0.918501827
57 -1.596370080 -0.035151051
58 0.168000591 -1.596370080
59 0.140361337 0.168000591
60 -0.409280611 0.140361337
61 1.153015524 -0.409280611
62 0.169792920 1.153015524
63 2.301427211 0.169792920
64 1.227578979 2.301427211
65 -0.758689729 1.227578979
66 0.082036726 -0.758689729
67 0.605165904 0.082036726
68 -1.121830140 0.605165904
69 -0.758689729 -1.121830140
70 -0.875877506 -0.758689729
71 -0.741912333 -0.875877506
72 -1.887993139 -0.741912333
73 0.051889920 -1.887993139
74 0.429653515 0.051889920
75 0.022635008 0.429653515
76 0.009265599 0.022635008
77 1.227578979 0.009265599
78 -0.364863961 1.227578979
79 1.298019224 -0.364863961
80 0.343512980 1.298019224
81 -0.860892438 0.343512980
82 -0.902978207 -0.860892438
83 -1.788659865 -0.902978207
84 2.271995629 -1.788659865
85 2.271457076 2.271995629
86 -0.919217050 2.271457076
87 -0.771882468 -0.919217050
88 0.432522950 -0.771882468
89 -1.757435954 0.432522950
90 -0.713019303 -1.757435954
91 -0.874623730 -0.713019303
92 -0.960764266 -0.874623730
93 -0.641325283 -0.960764266
94 0.461415979 -0.641325283
95 -0.064044081 0.461415979
96 -0.961841372 -0.064044081
97 0.183700882 -0.961841372
98 -0.803106379 0.183700882
99 1.387391077 -0.803106379
100 -1.020165984 1.387391077
101 0.182447106 -1.020165984
102 0.053143696 0.182447106
103 0.502963195 0.053143696
104 -1.844115042 0.502963195
105 -0.905847641 -1.844115042
106 -1.005719469 -0.905847641
107 0.949148658 -1.005719469
108 0.226325203 0.949148658
109 2.673764442 0.226325203
110 0.359751823 2.673764442
111 0.330320241 0.359751823
112 -0.829129974 0.330320241
113 0.430730621 -0.829129974
114 -0.947394857 0.430730621
115 2.225786650 -0.947394857
116 1.141438443 2.225786650
117 -0.902439654 1.141438443
118 1.213671017 -0.902439654
119 -0.020165984 1.213671017
120 0.184777988 -0.020165984
121 3.416999329 0.184777988
122 0.936494472 3.416999329
123 -0.005180916 0.936494472
124 -0.728542924 -0.005180916
125 -0.669679759 -0.728542924
126 0.138030456 -0.669679759
127 -0.326774111 0.138030456
128 1.199224502 -0.326774111
129 -0.845192148 1.199224502
130 -0.569269379 -0.845192148
131 -0.379310475 -0.569269379
132 -0.122368693 -0.379310475
133 -1.306539349 -0.122368693
134 -0.860892438 -1.306539349
135 1.344228203 -0.860892438
136 -0.234845328 1.344228203
137 1.314081397 -0.234845328
138 1.345305309 1.314081397
139 0.140361337 1.345305309
140 -0.554284311 0.140361337
141 2.271995629 -0.554284311
142 -0.495959699 2.271995629
143 -0.654694691 -0.495959699
144 -0.380926134 -0.654694691
145 -0.035689604 -0.380926134
146 -1.626878768 -0.035689604
147 -0.788121312 -1.626878768
148 -0.540376349 -0.788121312
149 1.313542844 -0.540376349
150 -0.063505528 1.313542844
151 0.789875113 -0.063505528
152 4.270741853 0.789875113
153 0.068128764 4.270741853
154 2.140361337 0.068128764
155 -1.728542924 2.140361337
156 -0.874623730 -1.728542924
157 0.228656085 -0.874623730
158 1.199224502 0.228656085
159 1.213132464 1.199224502
160 0.257549114 1.213132464
161 0.155346405 0.257549114
> 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/wessaorg/rcomp/tmp/7swck1352063389.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/wessaorg/rcomp/tmp/8sx3y1352063390.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/wessaorg/rcomp/tmp/9uc0o1352063390.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/wessaorg/rcomp/tmp/10urch1352063390.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11j0q61352063390.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/wessaorg/rcomp/tmp/12ubq81352063390.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/wessaorg/rcomp/tmp/13laeq1352063390.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/wessaorg/rcomp/tmp/148b9x1352063390.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/wessaorg/rcomp/tmp/15mrpi1352063390.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/wessaorg/rcomp/tmp/16h8031352063390.tab")
+ }
>
> try(system("convert tmp/1p8cd1352063389.ps tmp/1p8cd1352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/2nnkt1352063389.ps tmp/2nnkt1352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/38hej1352063389.ps tmp/38hej1352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/4vzw41352063389.ps tmp/4vzw41352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ekps1352063389.ps tmp/5ekps1352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ylpb1352063389.ps tmp/6ylpb1352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/7swck1352063389.ps tmp/7swck1352063389.png",intern=TRUE))
character(0)
> try(system("convert tmp/8sx3y1352063390.ps tmp/8sx3y1352063390.png",intern=TRUE))
character(0)
> try(system("convert tmp/9uc0o1352063390.ps tmp/9uc0o1352063390.png",intern=TRUE))
character(0)
> try(system("convert tmp/10urch1352063390.ps tmp/10urch1352063390.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.073 1.109 8.180