R version 2.13.0 (2011-04-13)
Copyright (C) 2011 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(2
+ ,41
+ ,38
+ ,13
+ ,12
+ ,14
+ ,1
+ ,2
+ ,39
+ ,32
+ ,16
+ ,11
+ ,18
+ ,1
+ ,2
+ ,30
+ ,35
+ ,19
+ ,15
+ ,11
+ ,1
+ ,1
+ ,31
+ ,33
+ ,15
+ ,6
+ ,12
+ ,0
+ ,2
+ ,34
+ ,37
+ ,14
+ ,13
+ ,16
+ ,0
+ ,2
+ ,35
+ ,29
+ ,13
+ ,10
+ ,18
+ ,1
+ ,2
+ ,39
+ ,31
+ ,19
+ ,12
+ ,14
+ ,1
+ ,2
+ ,34
+ ,36
+ ,15
+ ,14
+ ,14
+ ,1
+ ,2
+ ,36
+ ,35
+ ,14
+ ,12
+ ,15
+ ,0
+ ,2
+ ,37
+ ,38
+ ,15
+ ,6
+ ,15
+ ,0
+ ,1
+ ,38
+ ,31
+ ,16
+ ,10
+ ,17
+ ,1
+ ,2
+ ,36
+ ,34
+ ,16
+ ,12
+ ,19
+ ,0
+ ,1
+ ,38
+ ,35
+ ,16
+ ,12
+ ,10
+ ,0
+ ,2
+ ,39
+ ,38
+ ,16
+ ,11
+ ,16
+ ,0
+ ,2
+ ,33
+ ,37
+ ,17
+ ,15
+ ,18
+ ,0
+ ,1
+ ,32
+ ,33
+ ,15
+ ,12
+ ,14
+ ,0
+ ,1
+ ,36
+ ,32
+ ,15
+ ,10
+ ,14
+ ,1
+ ,2
+ ,38
+ ,38
+ ,20
+ ,12
+ ,17
+ ,1
+ ,1
+ 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(NA,dim=c(7,162),dimnames=list(c('gender','connected','separate','learning','software','hapiness','pop'),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 = '2'
> #'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
connected gender separate learning software hapiness pop
1 41 2 38 13 12 14 1
2 39 2 32 16 11 18 1
3 30 2 35 19 15 11 1
4 31 1 33 15 6 12 0
5 34 2 37 14 13 16 0
6 35 2 29 13 10 18 1
7 39 2 31 19 12 14 1
8 34 2 36 15 14 14 1
9 36 2 35 14 12 15 0
10 37 2 38 15 6 15 0
11 38 1 31 16 10 17 1
12 36 2 34 16 12 19 0
13 38 1 35 16 12 10 0
14 39 2 38 16 11 16 0
15 33 2 37 17 15 18 0
16 32 1 33 15 12 14 0
17 36 1 32 15 10 14 1
18 38 2 38 20 12 17 1
19 39 1 38 18 11 14 1
20 32 2 32 16 12 16 0
21 32 1 33 16 11 18 0
22 31 2 31 16 12 11 1
23 39 2 38 19 13 14 1
24 37 2 39 16 11 12 0
25 39 1 32 17 9 17 1
26 41 2 32 17 13 9 1
27 36 1 35 16 10 16 1
28 33 2 37 15 14 14 1
29 33 2 33 16 12 15 0
30 34 1 33 14 10 11 0
31 31 2 28 15 12 16 1
32 27 1 32 12 8 13 1
33 37 2 31 14 10 17 1
34 34 2 37 16 12 15 0
35 34 1 30 14 12 14 0
36 32 1 33 7 7 16 0
37 29 1 31 10 6 9 1
38 36 1 33 14 12 15 1
39 29 2 31 16 10 17 0
40 35 1 33 16 10 13 0
41 37 1 32 16 10 15 1
42 34 2 33 14 12 16 1
43 38 1 32 20 15 16 1
44 35 1 33 14 10 12 1
45 38 2 28 14 10 12 1
46 37 2 35 11 12 11 0
47 38 2 39 14 13 15 0
48 33 2 34 15 11 15 0
49 36 2 38 16 11 17 1
50 38 1 32 14 12 13 1
51 32 2 38 16 14 16 0
52 32 1 30 14 10 14 0
53 32 1 33 12 12 11 1
54 34 2 38 16 13 12 0
55 32 1 32 9 5 12 0
56 37 2 32 14 6 15 0
57 39 2 34 16 12 16 0
58 29 2 34 16 12 15 0
59 37 1 36 15 11 12 0
60 35 2 34 16 10 12 0
61 30 1 28 12 7 8 0
62 38 1 34 16 12 13 0
63 34 2 35 16 14 11 1
64 31 2 35 14 11 14 1
65 34 2 31 16 12 15 1
66 35 1 37 17 13 10 0
67 36 2 35 18 14 11 0
68 30 1 27 18 11 12 0
69 39 2 40 12 12 15 0
70 35 1 37 16 12 15 1
71 38 1 36 10 8 14 1
72 31 2 38 14 11 16 0
73 34 2 39 18 14 15 0
74 38 1 41 18 14 15 0
75 34 1 27 16 12 13 0
76 39 2 30 17 9 12 1
77 37 2 37 16 13 17 1
78 34 2 31 16 11 13 0
79 28 1 31 13 12 15 1
80 37 1 27 16 12 13 1
81 33 1 36 16 12 15 1
82 37 1 38 20 12 16 0
83 35 2 37 16 12 15 0
84 37 1 33 15 12 16 0
85 32 2 34 15 11 15 1
86 33 2 31 16 10 14 0
87 38 1 39 14 9 15 0
88 33 2 34 16 12 14 1
89 29 2 32 16 12 13 1
90 33 2 33 15 12 7 0
91 31 2 36 12 9 17 0
92 36 2 32 17 15 13 1
93 35 2 41 16 12 15 1
94 32 2 28 15 12 14 1
95 29 2 30 13 12 13 0
96 39 2 36 16 10 16 1
97 37 2 35 16 13 12 1
98 35 2 31 16 9 14 1
99 37 1 34 16 12 17 1
100 32 1 36 14 10 15 0
101 38 2 36 16 14 17 0
102 37 1 35 16 11 12 1
103 36 2 37 20 15 16 0
104 32 1 28 15 11 11 0
105 33 2 39 16 11 15 0
106 40 1 32 13 12 9 0
107 38 2 35 17 12 16 1
108 41 1 39 16 12 15 1
109 36 1 35 16 11 10 0
110 43 2 42 12 7 10 0
111 30 2 34 16 12 15 1
112 31 2 33 16 14 11 1
113 32 2 41 17 11 13 1
114 32 1 33 13 11 14 0
115 37 2 34 12 10 18 0
116 37 1 32 18 13 16 1
117 33 2 40 14 13 14 0
118 34 2 40 14 8 14 0
119 33 2 35 13 11 14 0
120 38 2 36 16 12 14 0
121 33 2 37 13 11 12 0
122 31 2 27 16 13 14 1
123 38 2 39 13 12 15 1
124 37 2 38 16 14 15 1
125 33 2 31 15 13 15 0
126 31 2 33 16 15 13 0
127 39 1 32 15 10 17 1
128 44 2 39 17 11 17 1
129 33 2 36 15 9 19 0
130 35 2 33 12 11 15 1
131 32 1 33 16 10 13 1
132 28 1 32 10 11 9 1
133 40 2 37 16 8 15 1
134 27 1 30 12 11 15 0
135 37 1 38 14 12 15 0
136 32 2 29 15 12 16 1
137 28 1 22 13 9 11 1
138 34 1 35 15 11 14 1
139 30 2 35 11 10 11 0
140 35 2 34 12 8 15 0
141 31 1 35 8 9 13 0
142 32 2 34 16 8 15 1
143 30 1 34 15 9 16 1
144 30 2 35 17 15 14 0
145 31 1 23 16 11 15 0
146 40 2 31 10 8 16 1
147 32 2 27 18 13 16 1
148 36 1 36 13 12 11 1
149 32 1 31 16 12 12 1
150 35 1 32 13 9 9 1
151 38 2 39 10 7 16 0
152 42 2 37 15 13 13 0
153 34 1 38 16 9 16 0
154 35 2 39 16 6 12 1
155 35 2 34 14 8 9 1
156 33 2 31 10 8 13 0
157 36 2 32 17 15 13 0
158 32 2 37 13 6 14 1
159 33 2 36 15 9 19 0
160 34 2 32 16 11 13 0
161 32 2 35 12 8 12 0
162 34 2 36 13 8 13 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) gender separate learning software hapiness
17.95432 -0.30076 0.36248 0.29640 -0.11756 0.08612
pop
0.95376
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.9424 -2.3908 -0.1143 1.9337 7.5297
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 17.95432 2.93711 6.113 7.61e-09 ***
gender -0.30076 0.52570 -0.572 0.5681
separate 0.36248 0.07186 5.044 1.26e-06 ***
learning 0.29640 0.13178 2.249 0.0259 *
software -0.11756 0.13642 -0.862 0.3901
hapiness 0.08612 0.10780 0.799 0.4256
pop 0.95376 0.49718 1.918 0.0569 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.078 on 155 degrees of freedom
Multiple R-squared: 0.1991, Adjusted R-squared: 0.1681
F-statistic: 6.424 on 6 and 155 DF, p-value: 4.597e-06
> 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.87479461 0.25041078 0.12520539
[2,] 0.79298884 0.41402231 0.20701116
[3,] 0.69019310 0.61961380 0.30980690
[4,] 0.88515909 0.22968183 0.11484091
[5,] 0.84672116 0.30655769 0.15327884
[6,] 0.84548963 0.30902074 0.15451037
[7,] 0.80272717 0.39454566 0.19727283
[8,] 0.73571496 0.52857008 0.26428504
[9,] 0.66262976 0.67474049 0.33737024
[10,] 0.58291197 0.83417606 0.41708803
[11,] 0.51259265 0.97481469 0.48740735
[12,] 0.48826072 0.97652144 0.51173928
[13,] 0.47433774 0.94867548 0.52566226
[14,] 0.41152439 0.82304878 0.58847561
[15,] 0.35186245 0.70372491 0.64813755
[16,] 0.30842037 0.61684075 0.69157963
[17,] 0.58643105 0.82713791 0.41356895
[18,] 0.54184557 0.91630887 0.45815443
[19,] 0.57620118 0.84759764 0.42379882
[20,] 0.51395504 0.97208991 0.48604496
[21,] 0.45017541 0.90035083 0.54982459
[22,] 0.44291320 0.88582639 0.55708680
[23,] 0.74119328 0.51761345 0.25880672
[24,] 0.71676445 0.56647110 0.28323555
[25,] 0.67561542 0.64876915 0.32438458
[26,] 0.65794506 0.68410989 0.34205494
[27,] 0.60397525 0.79204950 0.39602475
[28,] 0.62011356 0.75977288 0.37988644
[29,] 0.57844546 0.84310909 0.42155454
[30,] 0.64905231 0.70189538 0.35094769
[31,] 0.60285219 0.79429561 0.39714781
[32,] 0.56166401 0.87667199 0.43833599
[33,] 0.50991253 0.98017495 0.49008747
[34,] 0.46979859 0.93959718 0.53020141
[35,] 0.41665922 0.83331843 0.58334078
[36,] 0.52256022 0.95487956 0.47743978
[37,] 0.57829716 0.84340569 0.42170284
[38,] 0.55890426 0.88219148 0.44109574
[39,] 0.51511589 0.96976822 0.48488411
[40,] 0.47722400 0.95444800 0.52277600
[41,] 0.49206800 0.98413599 0.50793200
[42,] 0.51092492 0.97815015 0.48907508
[43,] 0.46203681 0.92407362 0.53796319
[44,] 0.43477493 0.86954985 0.56522507
[45,] 0.39437745 0.78875491 0.60562255
[46,] 0.34795633 0.69591267 0.65204367
[47,] 0.34921877 0.69843754 0.65078123
[48,] 0.40134947 0.80269895 0.59865053
[49,] 0.50012843 0.99974314 0.49987157
[50,] 0.47922463 0.95844926 0.52077537
[51,] 0.43239692 0.86479384 0.56760308
[52,] 0.39339676 0.78679351 0.60660324
[53,] 0.41138028 0.82276056 0.58861972
[54,] 0.37488840 0.74977680 0.62511160
[55,] 0.41442198 0.82884396 0.58557802
[56,] 0.37087777 0.74175554 0.62912223
[57,] 0.32740537 0.65481074 0.67259463
[58,] 0.29180505 0.58361010 0.70819495
[59,] 0.28262951 0.56525903 0.71737049
[60,] 0.29920040 0.59840079 0.70079960
[61,] 0.27291390 0.54582780 0.72708610
[62,] 0.26848774 0.53697548 0.73151226
[63,] 0.30953202 0.61906403 0.69046798
[64,] 0.29370413 0.58740826 0.70629587
[65,] 0.25591897 0.51183794 0.74408103
[66,] 0.23584602 0.47169203 0.76415398
[67,] 0.28252556 0.56505113 0.71747444
[68,] 0.24577282 0.49154564 0.75422718
[69,] 0.21288234 0.42576467 0.78711766
[70,] 0.29682592 0.59365184 0.70317408
[71,] 0.33182504 0.66365009 0.66817496
[72,] 0.33588380 0.67176760 0.66411620
[73,] 0.29445272 0.58890544 0.70554728
[74,] 0.25607226 0.51214452 0.74392774
[75,] 0.25540664 0.51081327 0.74459336
[76,] 0.25655502 0.51311003 0.74344498
[77,] 0.22226292 0.44452584 0.77773708
[78,] 0.20171037 0.40342073 0.79828963
[79,] 0.18589088 0.37178176 0.81410912
[80,] 0.25186629 0.50373259 0.74813371
[81,] 0.21611778 0.43223555 0.78388222
[82,] 0.22178857 0.44357714 0.77821143
[83,] 0.19761238 0.39522476 0.80238762
[84,] 0.19253450 0.38506900 0.80746550
[85,] 0.16382481 0.32764963 0.83617519
[86,] 0.15726140 0.31452280 0.84273860
[87,] 0.15019566 0.30039132 0.84980434
[88,] 0.13195482 0.26390964 0.86804518
[89,] 0.11115295 0.22230590 0.88884705
[90,] 0.09392570 0.18785139 0.90607430
[91,] 0.09094538 0.18189077 0.90905462
[92,] 0.08869214 0.17738428 0.91130786
[93,] 0.07491961 0.14983921 0.92508039
[94,] 0.05947046 0.11894091 0.94052954
[95,] 0.04719837 0.09439674 0.95280163
[96,] 0.04722329 0.09444658 0.95277671
[97,] 0.14982475 0.29964950 0.85017525
[98,] 0.13412670 0.26825339 0.86587330
[99,] 0.15006302 0.30012604 0.84993698
[100,] 0.14355807 0.28711614 0.85644193
[101,] 0.31331951 0.62663901 0.68668049
[102,] 0.40845951 0.81691902 0.59154049
[103,] 0.40624204 0.81248408 0.59375796
[104,] 0.53692128 0.92615743 0.46307872
[105,] 0.48926545 0.97853090 0.51073455
[106,] 0.47849204 0.95698407 0.52150796
[107,] 0.45286219 0.90572438 0.54713781
[108,] 0.45401685 0.90803370 0.54598315
[109,] 0.42291315 0.84582630 0.57708685
[110,] 0.37659350 0.75318699 0.62340650
[111,] 0.38028026 0.76056052 0.61971974
[112,] 0.33824508 0.67649016 0.66175492
[113,] 0.30391421 0.60782841 0.69608579
[114,] 0.26276601 0.52553203 0.73723399
[115,] 0.22548640 0.45097281 0.77451360
[116,] 0.18523030 0.37046060 0.81476970
[117,] 0.17841476 0.35682952 0.82158524
[118,] 0.24507759 0.49015518 0.75492241
[119,] 0.38803273 0.77606546 0.61196727
[120,] 0.35738703 0.71477407 0.64261297
[121,] 0.30326339 0.60652677 0.69673661
[122,] 0.26725657 0.53451314 0.73274343
[123,] 0.33127248 0.66254497 0.66872752
[124,] 0.38934151 0.77868303 0.61065849
[125,] 0.48893058 0.97786117 0.51106942
[126,] 0.45793610 0.91587221 0.54206390
[127,] 0.41856755 0.83713510 0.58143245
[128,] 0.38209686 0.76419372 0.61790314
[129,] 0.31904009 0.63808017 0.68095991
[130,] 0.44904878 0.89809756 0.55095122
[131,] 0.37983185 0.75966371 0.62016815
[132,] 0.48252794 0.96505587 0.51747206
[133,] 0.41967053 0.83934106 0.58032947
[134,] 0.44793903 0.89587806 0.55206097
[135,] 0.73448559 0.53102882 0.26551441
[136,] 0.74576400 0.50847200 0.25423600
[137,] 0.94117341 0.11765318 0.05882659
[138,] 0.91994897 0.16010206 0.08005103
[139,] 0.93866386 0.12267229 0.06133614
[140,] 0.92297426 0.15405147 0.07702574
[141,] 0.86221779 0.27556442 0.13778221
[142,] 0.78504754 0.42990492 0.21495246
[143,] 0.92816051 0.14367898 0.07183949
> postscript(file="/var/wessaorg/rcomp/tmp/1psln1323961837.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/27q131323961837.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/3jcfv1323961837.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/431z21323961837.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/5mnra1323961837.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
5.27128277 4.09491661 -5.80861648 -3.38926393 -0.76355244 1.95396941
7 8 9 10 11 12
4.03024521 -1.36143074 1.92995703 0.84075927 3.12518780 1.35516671
13 14 15 16 17 18
3.46699944 3.04605609 -2.58985197 -1.85612854 1.31746379 -0.06184155
19 20 21 22 23 24
1.37098195 -1.66152360 -2.61456211 -2.82221180 1.61047301 1.02805575
25 26 27 28 29 30
3.34875389 6.80871676 -0.23859859 -2.72390709 -0.93788094 0.46349933
31 32 33 34 35 36
-1.86898244 -6.94235568 3.01874039 -1.38778633 1.52769583 -0.24501506
37 38 39 40 41 42
-3.87773713 1.40038823 -4.62029071 0.69847066 1.93494945 -0.38496884
43 44 45 46 47 48
2.25106029 0.42362077 5.53676444 4.16361902 2.59761387 -1.12152419
49 50 51 52 53 54
-0.99382246 3.93510258 -3.60125721 -0.70742864 -1.66234510 -1.37434344
55 56 57 58 59 60
-0.36597783 3.31201268 4.61352371 -5.30035729 2.11111819 0.72287525
61 62 63 64 65 66
-1.22565797 3.57111878 -1.03699272 -4.05524576 -0.16668780 -0.43678635
67 68 69 70 71 72
1.32397617 -2.51578069 3.71036596 -1.64230782 3.11441059 -4.36115325
73 74 75 76 77 78
-2.47040522 0.50388015 2.10845321 4.80506352 0.60377835 0.84174752
79 80 81 82 83 84
-5.57826375 4.15469365 -3.27983147 -0.32272493 -0.38778633 2.97163345
85 86 87 88 89 90
-3.07528374 -0.36193371 1.82660301 -2.16799784 -5.35692615 0.04746640
91 92 93 94 95 96
-3.36465335 1.69936522 -2.79145127 -0.69674443 -2.78902791 2.69968700
97 98 99 100 101 102
1.75932605 0.56674451 1.27288322 -2.96840572 3.03757648 1.22343965
103 104 105 106 107 108
-0.30679996 0.09704796 -3.23030125 7.52973347 2.00089248 3.63273949
109 110 111 112 113 114
1.34943721 6.82819712 -5.25411684 -3.31204003 -6.03317083 -1.38090011
115 116 117 118 119 120
3.39174257 1.60872648 -2.67874347 -2.26655463 -0.80509087 3.06080902
121 122 123 124 125 126
-1.35780556 -1.51310119 1.82268742 0.53110223 0.20102931 -2.41295625
127 128 129 130 131 132
4.05910678 6.34730586 -2.42607735 1.17637860 -3.25528889 -4.65240232
133 134 135 136 137 138
3.18820519 -5.08319475 1.54176605 -1.23145878 -2.32418732 -1.65240302
139 140 141 142 143 144
-3.07150544 1.41497511 -1.77288161 -3.72436577 -5.69728914 -4.52042327
145 146 147 148 149 150
0.26855836 7.05531625 -1.27812985 0.95383053 -2.20909273 1.22328722
151 152 153 154 155 156
2.99170281 7.19840924 -2.48983030 -2.51351496 0.38513890 1.26743281
157 158 159 160 161 162
2.65312477 -4.07161427 -2.42607735 0.47927118 -1.68914423 -0.43413491
> postscript(file="/var/wessaorg/rcomp/tmp/67qk81323961837.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 5.27128277 NA
1 4.09491661 5.27128277
2 -5.80861648 4.09491661
3 -3.38926393 -5.80861648
4 -0.76355244 -3.38926393
5 1.95396941 -0.76355244
6 4.03024521 1.95396941
7 -1.36143074 4.03024521
8 1.92995703 -1.36143074
9 0.84075927 1.92995703
10 3.12518780 0.84075927
11 1.35516671 3.12518780
12 3.46699944 1.35516671
13 3.04605609 3.46699944
14 -2.58985197 3.04605609
15 -1.85612854 -2.58985197
16 1.31746379 -1.85612854
17 -0.06184155 1.31746379
18 1.37098195 -0.06184155
19 -1.66152360 1.37098195
20 -2.61456211 -1.66152360
21 -2.82221180 -2.61456211
22 1.61047301 -2.82221180
23 1.02805575 1.61047301
24 3.34875389 1.02805575
25 6.80871676 3.34875389
26 -0.23859859 6.80871676
27 -2.72390709 -0.23859859
28 -0.93788094 -2.72390709
29 0.46349933 -0.93788094
30 -1.86898244 0.46349933
31 -6.94235568 -1.86898244
32 3.01874039 -6.94235568
33 -1.38778633 3.01874039
34 1.52769583 -1.38778633
35 -0.24501506 1.52769583
36 -3.87773713 -0.24501506
37 1.40038823 -3.87773713
38 -4.62029071 1.40038823
39 0.69847066 -4.62029071
40 1.93494945 0.69847066
41 -0.38496884 1.93494945
42 2.25106029 -0.38496884
43 0.42362077 2.25106029
44 5.53676444 0.42362077
45 4.16361902 5.53676444
46 2.59761387 4.16361902
47 -1.12152419 2.59761387
48 -0.99382246 -1.12152419
49 3.93510258 -0.99382246
50 -3.60125721 3.93510258
51 -0.70742864 -3.60125721
52 -1.66234510 -0.70742864
53 -1.37434344 -1.66234510
54 -0.36597783 -1.37434344
55 3.31201268 -0.36597783
56 4.61352371 3.31201268
57 -5.30035729 4.61352371
58 2.11111819 -5.30035729
59 0.72287525 2.11111819
60 -1.22565797 0.72287525
61 3.57111878 -1.22565797
62 -1.03699272 3.57111878
63 -4.05524576 -1.03699272
64 -0.16668780 -4.05524576
65 -0.43678635 -0.16668780
66 1.32397617 -0.43678635
67 -2.51578069 1.32397617
68 3.71036596 -2.51578069
69 -1.64230782 3.71036596
70 3.11441059 -1.64230782
71 -4.36115325 3.11441059
72 -2.47040522 -4.36115325
73 0.50388015 -2.47040522
74 2.10845321 0.50388015
75 4.80506352 2.10845321
76 0.60377835 4.80506352
77 0.84174752 0.60377835
78 -5.57826375 0.84174752
79 4.15469365 -5.57826375
80 -3.27983147 4.15469365
81 -0.32272493 -3.27983147
82 -0.38778633 -0.32272493
83 2.97163345 -0.38778633
84 -3.07528374 2.97163345
85 -0.36193371 -3.07528374
86 1.82660301 -0.36193371
87 -2.16799784 1.82660301
88 -5.35692615 -2.16799784
89 0.04746640 -5.35692615
90 -3.36465335 0.04746640
91 1.69936522 -3.36465335
92 -2.79145127 1.69936522
93 -0.69674443 -2.79145127
94 -2.78902791 -0.69674443
95 2.69968700 -2.78902791
96 1.75932605 2.69968700
97 0.56674451 1.75932605
98 1.27288322 0.56674451
99 -2.96840572 1.27288322
100 3.03757648 -2.96840572
101 1.22343965 3.03757648
102 -0.30679996 1.22343965
103 0.09704796 -0.30679996
104 -3.23030125 0.09704796
105 7.52973347 -3.23030125
106 2.00089248 7.52973347
107 3.63273949 2.00089248
108 1.34943721 3.63273949
109 6.82819712 1.34943721
110 -5.25411684 6.82819712
111 -3.31204003 -5.25411684
112 -6.03317083 -3.31204003
113 -1.38090011 -6.03317083
114 3.39174257 -1.38090011
115 1.60872648 3.39174257
116 -2.67874347 1.60872648
117 -2.26655463 -2.67874347
118 -0.80509087 -2.26655463
119 3.06080902 -0.80509087
120 -1.35780556 3.06080902
121 -1.51310119 -1.35780556
122 1.82268742 -1.51310119
123 0.53110223 1.82268742
124 0.20102931 0.53110223
125 -2.41295625 0.20102931
126 4.05910678 -2.41295625
127 6.34730586 4.05910678
128 -2.42607735 6.34730586
129 1.17637860 -2.42607735
130 -3.25528889 1.17637860
131 -4.65240232 -3.25528889
132 3.18820519 -4.65240232
133 -5.08319475 3.18820519
134 1.54176605 -5.08319475
135 -1.23145878 1.54176605
136 -2.32418732 -1.23145878
137 -1.65240302 -2.32418732
138 -3.07150544 -1.65240302
139 1.41497511 -3.07150544
140 -1.77288161 1.41497511
141 -3.72436577 -1.77288161
142 -5.69728914 -3.72436577
143 -4.52042327 -5.69728914
144 0.26855836 -4.52042327
145 7.05531625 0.26855836
146 -1.27812985 7.05531625
147 0.95383053 -1.27812985
148 -2.20909273 0.95383053
149 1.22328722 -2.20909273
150 2.99170281 1.22328722
151 7.19840924 2.99170281
152 -2.48983030 7.19840924
153 -2.51351496 -2.48983030
154 0.38513890 -2.51351496
155 1.26743281 0.38513890
156 2.65312477 1.26743281
157 -4.07161427 2.65312477
158 -2.42607735 -4.07161427
159 0.47927118 -2.42607735
160 -1.68914423 0.47927118
161 -0.43413491 -1.68914423
162 NA -0.43413491
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 4.09491661 5.27128277
[2,] -5.80861648 4.09491661
[3,] -3.38926393 -5.80861648
[4,] -0.76355244 -3.38926393
[5,] 1.95396941 -0.76355244
[6,] 4.03024521 1.95396941
[7,] -1.36143074 4.03024521
[8,] 1.92995703 -1.36143074
[9,] 0.84075927 1.92995703
[10,] 3.12518780 0.84075927
[11,] 1.35516671 3.12518780
[12,] 3.46699944 1.35516671
[13,] 3.04605609 3.46699944
[14,] -2.58985197 3.04605609
[15,] -1.85612854 -2.58985197
[16,] 1.31746379 -1.85612854
[17,] -0.06184155 1.31746379
[18,] 1.37098195 -0.06184155
[19,] -1.66152360 1.37098195
[20,] -2.61456211 -1.66152360
[21,] -2.82221180 -2.61456211
[22,] 1.61047301 -2.82221180
[23,] 1.02805575 1.61047301
[24,] 3.34875389 1.02805575
[25,] 6.80871676 3.34875389
[26,] -0.23859859 6.80871676
[27,] -2.72390709 -0.23859859
[28,] -0.93788094 -2.72390709
[29,] 0.46349933 -0.93788094
[30,] -1.86898244 0.46349933
[31,] -6.94235568 -1.86898244
[32,] 3.01874039 -6.94235568
[33,] -1.38778633 3.01874039
[34,] 1.52769583 -1.38778633
[35,] -0.24501506 1.52769583
[36,] -3.87773713 -0.24501506
[37,] 1.40038823 -3.87773713
[38,] -4.62029071 1.40038823
[39,] 0.69847066 -4.62029071
[40,] 1.93494945 0.69847066
[41,] -0.38496884 1.93494945
[42,] 2.25106029 -0.38496884
[43,] 0.42362077 2.25106029
[44,] 5.53676444 0.42362077
[45,] 4.16361902 5.53676444
[46,] 2.59761387 4.16361902
[47,] -1.12152419 2.59761387
[48,] -0.99382246 -1.12152419
[49,] 3.93510258 -0.99382246
[50,] -3.60125721 3.93510258
[51,] -0.70742864 -3.60125721
[52,] -1.66234510 -0.70742864
[53,] -1.37434344 -1.66234510
[54,] -0.36597783 -1.37434344
[55,] 3.31201268 -0.36597783
[56,] 4.61352371 3.31201268
[57,] -5.30035729 4.61352371
[58,] 2.11111819 -5.30035729
[59,] 0.72287525 2.11111819
[60,] -1.22565797 0.72287525
[61,] 3.57111878 -1.22565797
[62,] -1.03699272 3.57111878
[63,] -4.05524576 -1.03699272
[64,] -0.16668780 -4.05524576
[65,] -0.43678635 -0.16668780
[66,] 1.32397617 -0.43678635
[67,] -2.51578069 1.32397617
[68,] 3.71036596 -2.51578069
[69,] -1.64230782 3.71036596
[70,] 3.11441059 -1.64230782
[71,] -4.36115325 3.11441059
[72,] -2.47040522 -4.36115325
[73,] 0.50388015 -2.47040522
[74,] 2.10845321 0.50388015
[75,] 4.80506352 2.10845321
[76,] 0.60377835 4.80506352
[77,] 0.84174752 0.60377835
[78,] -5.57826375 0.84174752
[79,] 4.15469365 -5.57826375
[80,] -3.27983147 4.15469365
[81,] -0.32272493 -3.27983147
[82,] -0.38778633 -0.32272493
[83,] 2.97163345 -0.38778633
[84,] -3.07528374 2.97163345
[85,] -0.36193371 -3.07528374
[86,] 1.82660301 -0.36193371
[87,] -2.16799784 1.82660301
[88,] -5.35692615 -2.16799784
[89,] 0.04746640 -5.35692615
[90,] -3.36465335 0.04746640
[91,] 1.69936522 -3.36465335
[92,] -2.79145127 1.69936522
[93,] -0.69674443 -2.79145127
[94,] -2.78902791 -0.69674443
[95,] 2.69968700 -2.78902791
[96,] 1.75932605 2.69968700
[97,] 0.56674451 1.75932605
[98,] 1.27288322 0.56674451
[99,] -2.96840572 1.27288322
[100,] 3.03757648 -2.96840572
[101,] 1.22343965 3.03757648
[102,] -0.30679996 1.22343965
[103,] 0.09704796 -0.30679996
[104,] -3.23030125 0.09704796
[105,] 7.52973347 -3.23030125
[106,] 2.00089248 7.52973347
[107,] 3.63273949 2.00089248
[108,] 1.34943721 3.63273949
[109,] 6.82819712 1.34943721
[110,] -5.25411684 6.82819712
[111,] -3.31204003 -5.25411684
[112,] -6.03317083 -3.31204003
[113,] -1.38090011 -6.03317083
[114,] 3.39174257 -1.38090011
[115,] 1.60872648 3.39174257
[116,] -2.67874347 1.60872648
[117,] -2.26655463 -2.67874347
[118,] -0.80509087 -2.26655463
[119,] 3.06080902 -0.80509087
[120,] -1.35780556 3.06080902
[121,] -1.51310119 -1.35780556
[122,] 1.82268742 -1.51310119
[123,] 0.53110223 1.82268742
[124,] 0.20102931 0.53110223
[125,] -2.41295625 0.20102931
[126,] 4.05910678 -2.41295625
[127,] 6.34730586 4.05910678
[128,] -2.42607735 6.34730586
[129,] 1.17637860 -2.42607735
[130,] -3.25528889 1.17637860
[131,] -4.65240232 -3.25528889
[132,] 3.18820519 -4.65240232
[133,] -5.08319475 3.18820519
[134,] 1.54176605 -5.08319475
[135,] -1.23145878 1.54176605
[136,] -2.32418732 -1.23145878
[137,] -1.65240302 -2.32418732
[138,] -3.07150544 -1.65240302
[139,] 1.41497511 -3.07150544
[140,] -1.77288161 1.41497511
[141,] -3.72436577 -1.77288161
[142,] -5.69728914 -3.72436577
[143,] -4.52042327 -5.69728914
[144,] 0.26855836 -4.52042327
[145,] 7.05531625 0.26855836
[146,] -1.27812985 7.05531625
[147,] 0.95383053 -1.27812985
[148,] -2.20909273 0.95383053
[149,] 1.22328722 -2.20909273
[150,] 2.99170281 1.22328722
[151,] 7.19840924 2.99170281
[152,] -2.48983030 7.19840924
[153,] -2.51351496 -2.48983030
[154,] 0.38513890 -2.51351496
[155,] 1.26743281 0.38513890
[156,] 2.65312477 1.26743281
[157,] -4.07161427 2.65312477
[158,] -2.42607735 -4.07161427
[159,] 0.47927118 -2.42607735
[160,] -1.68914423 0.47927118
[161,] -0.43413491 -1.68914423
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 4.09491661 5.27128277
2 -5.80861648 4.09491661
3 -3.38926393 -5.80861648
4 -0.76355244 -3.38926393
5 1.95396941 -0.76355244
6 4.03024521 1.95396941
7 -1.36143074 4.03024521
8 1.92995703 -1.36143074
9 0.84075927 1.92995703
10 3.12518780 0.84075927
11 1.35516671 3.12518780
12 3.46699944 1.35516671
13 3.04605609 3.46699944
14 -2.58985197 3.04605609
15 -1.85612854 -2.58985197
16 1.31746379 -1.85612854
17 -0.06184155 1.31746379
18 1.37098195 -0.06184155
19 -1.66152360 1.37098195
20 -2.61456211 -1.66152360
21 -2.82221180 -2.61456211
22 1.61047301 -2.82221180
23 1.02805575 1.61047301
24 3.34875389 1.02805575
25 6.80871676 3.34875389
26 -0.23859859 6.80871676
27 -2.72390709 -0.23859859
28 -0.93788094 -2.72390709
29 0.46349933 -0.93788094
30 -1.86898244 0.46349933
31 -6.94235568 -1.86898244
32 3.01874039 -6.94235568
33 -1.38778633 3.01874039
34 1.52769583 -1.38778633
35 -0.24501506 1.52769583
36 -3.87773713 -0.24501506
37 1.40038823 -3.87773713
38 -4.62029071 1.40038823
39 0.69847066 -4.62029071
40 1.93494945 0.69847066
41 -0.38496884 1.93494945
42 2.25106029 -0.38496884
43 0.42362077 2.25106029
44 5.53676444 0.42362077
45 4.16361902 5.53676444
46 2.59761387 4.16361902
47 -1.12152419 2.59761387
48 -0.99382246 -1.12152419
49 3.93510258 -0.99382246
50 -3.60125721 3.93510258
51 -0.70742864 -3.60125721
52 -1.66234510 -0.70742864
53 -1.37434344 -1.66234510
54 -0.36597783 -1.37434344
55 3.31201268 -0.36597783
56 4.61352371 3.31201268
57 -5.30035729 4.61352371
58 2.11111819 -5.30035729
59 0.72287525 2.11111819
60 -1.22565797 0.72287525
61 3.57111878 -1.22565797
62 -1.03699272 3.57111878
63 -4.05524576 -1.03699272
64 -0.16668780 -4.05524576
65 -0.43678635 -0.16668780
66 1.32397617 -0.43678635
67 -2.51578069 1.32397617
68 3.71036596 -2.51578069
69 -1.64230782 3.71036596
70 3.11441059 -1.64230782
71 -4.36115325 3.11441059
72 -2.47040522 -4.36115325
73 0.50388015 -2.47040522
74 2.10845321 0.50388015
75 4.80506352 2.10845321
76 0.60377835 4.80506352
77 0.84174752 0.60377835
78 -5.57826375 0.84174752
79 4.15469365 -5.57826375
80 -3.27983147 4.15469365
81 -0.32272493 -3.27983147
82 -0.38778633 -0.32272493
83 2.97163345 -0.38778633
84 -3.07528374 2.97163345
85 -0.36193371 -3.07528374
86 1.82660301 -0.36193371
87 -2.16799784 1.82660301
88 -5.35692615 -2.16799784
89 0.04746640 -5.35692615
90 -3.36465335 0.04746640
91 1.69936522 -3.36465335
92 -2.79145127 1.69936522
93 -0.69674443 -2.79145127
94 -2.78902791 -0.69674443
95 2.69968700 -2.78902791
96 1.75932605 2.69968700
97 0.56674451 1.75932605
98 1.27288322 0.56674451
99 -2.96840572 1.27288322
100 3.03757648 -2.96840572
101 1.22343965 3.03757648
102 -0.30679996 1.22343965
103 0.09704796 -0.30679996
104 -3.23030125 0.09704796
105 7.52973347 -3.23030125
106 2.00089248 7.52973347
107 3.63273949 2.00089248
108 1.34943721 3.63273949
109 6.82819712 1.34943721
110 -5.25411684 6.82819712
111 -3.31204003 -5.25411684
112 -6.03317083 -3.31204003
113 -1.38090011 -6.03317083
114 3.39174257 -1.38090011
115 1.60872648 3.39174257
116 -2.67874347 1.60872648
117 -2.26655463 -2.67874347
118 -0.80509087 -2.26655463
119 3.06080902 -0.80509087
120 -1.35780556 3.06080902
121 -1.51310119 -1.35780556
122 1.82268742 -1.51310119
123 0.53110223 1.82268742
124 0.20102931 0.53110223
125 -2.41295625 0.20102931
126 4.05910678 -2.41295625
127 6.34730586 4.05910678
128 -2.42607735 6.34730586
129 1.17637860 -2.42607735
130 -3.25528889 1.17637860
131 -4.65240232 -3.25528889
132 3.18820519 -4.65240232
133 -5.08319475 3.18820519
134 1.54176605 -5.08319475
135 -1.23145878 1.54176605
136 -2.32418732 -1.23145878
137 -1.65240302 -2.32418732
138 -3.07150544 -1.65240302
139 1.41497511 -3.07150544
140 -1.77288161 1.41497511
141 -3.72436577 -1.77288161
142 -5.69728914 -3.72436577
143 -4.52042327 -5.69728914
144 0.26855836 -4.52042327
145 7.05531625 0.26855836
146 -1.27812985 7.05531625
147 0.95383053 -1.27812985
148 -2.20909273 0.95383053
149 1.22328722 -2.20909273
150 2.99170281 1.22328722
151 7.19840924 2.99170281
152 -2.48983030 7.19840924
153 -2.51351496 -2.48983030
154 0.38513890 -2.51351496
155 1.26743281 0.38513890
156 2.65312477 1.26743281
157 -4.07161427 2.65312477
158 -2.42607735 -4.07161427
159 0.47927118 -2.42607735
160 -1.68914423 0.47927118
161 -0.43413491 -1.68914423
> 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/7126m1323961837.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/8smeh1323961837.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/9fz4m1323961837.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/10p6p81323961837.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/11i54m1323961837.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/1264pt1323961837.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/13rg3z1323961837.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/146o771323961837.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/15qeuj1323961837.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/16180g1323961837.tab")
+ }
>
> try(system("convert tmp/1psln1323961837.ps tmp/1psln1323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/27q131323961837.ps tmp/27q131323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/3jcfv1323961837.ps tmp/3jcfv1323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/431z21323961837.ps tmp/431z21323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/5mnra1323961837.ps tmp/5mnra1323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/67qk81323961837.ps tmp/67qk81323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/7126m1323961837.ps tmp/7126m1323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/8smeh1323961837.ps tmp/8smeh1323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fz4m1323961837.ps tmp/9fz4m1323961837.png",intern=TRUE))
character(0)
> try(system("convert tmp/10p6p81323961837.ps tmp/10p6p81323961837.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.149 0.613 6.851