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(12
+ ,14
+ ,11
+ ,18
+ ,15
+ ,11
+ ,6
+ ,12
+ ,13
+ ,16
+ ,10
+ ,18
+ ,12
+ ,14
+ ,14
+ ,14
+ ,12
+ ,15
+ ,6
+ ,15
+ ,10
+ ,17
+ ,12
+ ,19
+ ,12
+ ,10
+ ,11
+ ,16
+ ,15
+ ,18
+ ,12
+ ,14
+ ,10
+ ,14
+ ,12
+ ,17
+ ,11
+ ,14
+ ,12
+ ,16
+ ,11
+ ,18
+ ,12
+ ,11
+ ,13
+ ,14
+ ,11
+ ,12
+ ,9
+ ,17
+ ,13
+ ,9
+ ,10
+ ,16
+ ,14
+ ,14
+ ,12
+ ,15
+ ,10
+ ,11
+ ,12
+ ,16
+ ,8
+ ,13
+ ,10
+ ,17
+ ,12
+ ,15
+ ,12
+ ,14
+ ,7
+ ,16
+ ,6
+ ,9
+ ,12
+ ,15
+ ,10
+ ,17
+ ,10
+ ,13
+ ,10
+ ,15
+ ,12
+ ,16
+ ,15
+ ,16
+ ,10
+ ,12
+ ,10
+ ,12
+ ,12
+ ,11
+ ,13
+ ,15
+ ,11
+ ,15
+ ,11
+ ,17
+ ,12
+ ,13
+ ,14
+ ,16
+ ,10
+ ,14
+ ,12
+ ,11
+ ,13
+ ,12
+ ,5
+ ,12
+ ,6
+ ,15
+ ,12
+ ,16
+ ,12
+ ,15
+ ,11
+ ,12
+ ,10
+ ,12
+ ,7
+ ,8
+ ,12
+ ,13
+ ,14
+ ,11
+ ,11
+ ,14
+ ,12
+ ,15
+ ,13
+ ,10
+ ,14
+ ,11
+ ,11
+ ,12
+ ,12
+ ,15
+ ,12
+ ,15
+ ,8
+ ,14
+ ,11
+ ,16
+ ,14
+ ,15
+ ,14
+ ,15
+ ,12
+ ,13
+ ,9
+ ,12
+ ,13
+ ,17
+ ,11
+ ,13
+ ,12
+ ,15
+ ,12
+ ,13
+ ,12
+ ,15
+ ,12
+ ,16
+ ,12
+ ,15
+ ,12
+ ,16
+ ,11
+ ,15
+ ,10
+ ,14
+ ,9
+ ,15
+ ,12
+ ,14
+ ,12
+ ,13
+ ,12
+ ,7
+ ,9
+ ,17
+ ,15
+ ,13
+ ,12
+ ,15
+ ,12
+ ,14
+ ,12
+ ,13
+ ,10
+ ,16
+ ,13
+ ,12
+ ,9
+ ,14
+ ,12
+ ,17
+ ,10
+ ,15
+ ,14
+ ,17
+ ,11
+ ,12
+ ,15
+ ,16
+ ,11
+ ,11
+ ,11
+ ,15
+ ,12
+ ,9
+ ,12
+ ,16
+ ,12
+ ,15
+ ,11
+ ,10
+ ,7
+ ,10
+ ,12
+ ,15
+ ,14
+ ,11
+ ,11
+ ,13
+ ,11
+ ,14
+ ,10
+ ,18
+ ,13
+ ,16
+ ,13
+ ,14
+ ,8
+ ,14
+ ,11
+ ,14
+ ,12
+ ,14
+ ,11
+ ,12
+ ,13
+ ,14
+ ,12
+ ,15
+ ,14
+ ,15
+ ,13
+ ,15
+ ,15
+ ,13
+ ,10
+ ,17
+ ,11
+ ,17
+ ,9
+ ,19
+ ,11
+ ,15
+ ,10
+ ,13
+ ,11
+ ,9
+ ,8
+ ,15
+ ,11
+ ,15
+ ,12
+ ,15
+ ,12
+ ,16
+ ,9
+ ,11
+ ,11
+ ,14
+ ,10
+ ,11
+ ,8
+ ,15
+ ,9
+ ,13
+ ,8
+ ,15
+ ,9
+ ,16
+ ,15
+ ,14
+ ,11
+ ,15
+ ,8
+ ,16
+ ,13
+ ,16
+ ,12
+ ,11
+ ,12
+ ,12
+ ,9
+ ,9
+ ,7
+ ,16
+ ,13
+ ,13
+ ,9
+ ,16
+ ,6
+ ,12
+ ,8
+ ,9
+ ,8
+ ,13
+ ,15
+ ,13
+ ,6
+ ,14
+ ,9
+ ,19
+ ,11
+ ,13
+ ,8
+ ,12
+ ,8
+ ,13)
+ ,dim=c(2
+ ,162)
+ ,dimnames=list(c('Software'
+ ,'Happiness')
+ ,1:162))
> y <- array(NA,dim=c(2,162),dimnames=list(c('Software','Happiness'),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
Happiness Software
1 14 12
2 18 11
3 11 15
4 12 6
5 16 13
6 18 10
7 14 12
8 14 14
9 15 12
10 15 6
11 17 10
12 19 12
13 10 12
14 16 11
15 18 15
16 14 12
17 14 10
18 17 12
19 14 11
20 16 12
21 18 11
22 11 12
23 14 13
24 12 11
25 17 9
26 9 13
27 16 10
28 14 14
29 15 12
30 11 10
31 16 12
32 13 8
33 17 10
34 15 12
35 14 12
36 16 7
37 9 6
38 15 12
39 17 10
40 13 10
41 15 10
42 16 12
43 16 15
44 12 10
45 12 10
46 11 12
47 15 13
48 15 11
49 17 11
50 13 12
51 16 14
52 14 10
53 11 12
54 12 13
55 12 5
56 15 6
57 16 12
58 15 12
59 12 11
60 12 10
61 8 7
62 13 12
63 11 14
64 14 11
65 15 12
66 10 13
67 11 14
68 12 11
69 15 12
70 15 12
71 14 8
72 16 11
73 15 14
74 15 14
75 13 12
76 12 9
77 17 13
78 13 11
79 15 12
80 13 12
81 15 12
82 16 12
83 15 12
84 16 12
85 15 11
86 14 10
87 15 9
88 14 12
89 13 12
90 7 12
91 17 9
92 13 15
93 15 12
94 14 12
95 13 12
96 16 10
97 12 13
98 14 9
99 17 12
100 15 10
101 17 14
102 12 11
103 16 15
104 11 11
105 15 11
106 9 12
107 16 12
108 15 12
109 10 11
110 10 7
111 15 12
112 11 14
113 13 11
114 14 11
115 18 10
116 16 13
117 14 13
118 14 8
119 14 11
120 14 12
121 12 11
122 14 13
123 15 12
124 15 14
125 15 13
126 13 15
127 17 10
128 17 11
129 19 9
130 15 11
131 13 10
132 9 11
133 15 8
134 15 11
135 15 12
136 16 12
137 11 9
138 14 11
139 11 10
140 15 8
141 13 9
142 15 8
143 16 9
144 14 15
145 15 11
146 16 8
147 16 13
148 11 12
149 12 12
150 9 9
151 16 7
152 13 13
153 16 9
154 12 6
155 9 8
156 13 8
157 13 15
158 14 6
159 19 9
160 13 11
161 12 8
162 13 8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Software
13.14381 0.08079
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.1133 -1.3557 0.1694 1.7049 5.1290
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13.14381 0.96893 13.565 <2e-16 ***
Software 0.08079 0.08605 0.939 0.349
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.338 on 160 degrees of freedom
Multiple R-squared: 0.005479, Adjusted R-squared: -0.0007363
F-statistic: 0.8815 on 1 and 160 DF, p-value: 0.3492
> 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.8850415 0.2299170 0.11495852
[2,] 0.9143543 0.1712914 0.08564570
[3,] 0.8561293 0.2877414 0.14387069
[4,] 0.7791665 0.4416670 0.22083349
[5,] 0.6889628 0.6220744 0.31103721
[6,] 0.5904006 0.8191987 0.40959935
[7,] 0.5713919 0.8572161 0.42860805
[8,] 0.7285469 0.5429062 0.27145308
[9,] 0.8863390 0.2273221 0.11366104
[10,] 0.8522384 0.2955233 0.14776163
[11,] 0.8779799 0.2440402 0.12202012
[12,] 0.8419200 0.3161600 0.15808000
[13,] 0.7993868 0.4012264 0.20061318
[14,] 0.7841927 0.4316146 0.21580732
[15,] 0.7372626 0.5254749 0.26273743
[16,] 0.6894107 0.6211785 0.31058926
[17,] 0.7255722 0.5488555 0.27442776
[18,] 0.8125253 0.3749493 0.18747466
[19,] 0.7723478 0.4553044 0.22765222
[20,] 0.7874226 0.4251548 0.21257738
[21,] 0.7825098 0.4349803 0.21749016
[22,] 0.9227127 0.1545747 0.07728733
[23,] 0.9066112 0.1867775 0.09338877
[24,] 0.8799544 0.2400912 0.12004558
[25,] 0.8496175 0.3007650 0.15038248
[26,] 0.8874697 0.2250607 0.11253034
[27,] 0.8703032 0.2593936 0.12969678
[28,] 0.8536380 0.2927240 0.14636200
[29,] 0.8561281 0.2877437 0.14387186
[30,] 0.8245282 0.3509436 0.17547179
[31,] 0.7889914 0.4220173 0.21100864
[32,] 0.7648779 0.4702441 0.23512205
[33,] 0.8939762 0.2120476 0.10602380
[34,] 0.8696083 0.2607834 0.13039169
[35,] 0.8763781 0.2472438 0.12362191
[36,] 0.8573381 0.2853238 0.14266189
[37,] 0.8296049 0.3407903 0.17039513
[38,] 0.8104193 0.3791613 0.18958065
[39,] 0.7855404 0.4289191 0.21445957
[40,] 0.7835695 0.4328610 0.21643049
[41,] 0.7799222 0.4401557 0.22007783
[42,] 0.8163269 0.3673463 0.18367314
[43,] 0.7840387 0.4319226 0.21596129
[44,] 0.7503746 0.4992509 0.24962545
[45,] 0.7627749 0.4744502 0.23722508
[46,] 0.7378614 0.5242772 0.26213860
[47,] 0.7135543 0.5728915 0.28644573
[48,] 0.6719682 0.6560635 0.32803177
[49,] 0.7152667 0.5694666 0.28473329
[50,] 0.7165359 0.5669281 0.28346407
[51,] 0.6953644 0.6092712 0.30463559
[52,] 0.6656456 0.6687088 0.33435442
[53,] 0.6456219 0.7087562 0.35437811
[54,] 0.6057055 0.7885890 0.39429451
[55,] 0.6001352 0.7997296 0.39986479
[56,] 0.5902063 0.8195874 0.40979371
[57,] 0.7850995 0.4298011 0.21490054
[58,] 0.7597597 0.4804807 0.24024033
[59,] 0.7970015 0.4059970 0.20299850
[60,] 0.7629893 0.4740215 0.23701074
[61,] 0.7309084 0.5381833 0.26909164
[62,] 0.8079178 0.3841644 0.19208221
[63,] 0.8358692 0.3282616 0.16413079
[64,] 0.8282153 0.3435694 0.17178468
[65,] 0.8020327 0.3959346 0.19796728
[66,] 0.7736054 0.4527892 0.22639459
[67,] 0.7382579 0.5234842 0.26174208
[68,] 0.7265377 0.5469246 0.27346228
[69,] 0.6912774 0.6174453 0.30872263
[70,] 0.6542886 0.6914229 0.34571145
[71,] 0.6213502 0.7572996 0.37864981
[72,] 0.6051239 0.7897522 0.39487608
[73,] 0.6232108 0.7535784 0.37678921
[74,] 0.5879606 0.8240789 0.41203944
[75,] 0.5499929 0.9000143 0.45000714
[76,] 0.5149908 0.9700184 0.48500921
[77,] 0.4765099 0.9530198 0.52349009
[78,] 0.4608917 0.9217834 0.53910830
[79,] 0.4230280 0.8460559 0.57697203
[80,] 0.4081500 0.8163000 0.59184999
[81,] 0.3725012 0.7450024 0.62749879
[82,] 0.3305825 0.6611649 0.66941753
[83,] 0.2997076 0.5994152 0.70029238
[84,] 0.2618824 0.5237647 0.73811763
[85,] 0.2337770 0.4675540 0.76622302
[86,] 0.5722717 0.8554565 0.42772826
[87,] 0.6063217 0.7873566 0.39367829
[88,] 0.5756265 0.8487470 0.42437348
[89,] 0.5373539 0.9252922 0.46264611
[90,] 0.4918058 0.9836116 0.50819419
[91,] 0.4557200 0.9114401 0.54427997
[92,] 0.4451192 0.8902384 0.55488080
[93,] 0.4375288 0.8750577 0.56247117
[94,] 0.3927385 0.7854769 0.60726154
[95,] 0.4162694 0.8325388 0.58373058
[96,] 0.3810250 0.7620500 0.61897498
[97,] 0.4001681 0.8003361 0.59983193
[98,] 0.3861051 0.7722101 0.61389493
[99,] 0.3684274 0.7368548 0.63157261
[100,] 0.3930767 0.7861533 0.60692335
[101,] 0.3571804 0.7143609 0.64281956
[102,] 0.5201354 0.9597291 0.47986456
[103,] 0.5056081 0.9887837 0.49439185
[104,] 0.4662350 0.9324700 0.53376501
[105,] 0.5542670 0.8914660 0.44573299
[106,] 0.6326556 0.7346887 0.36734436
[107,] 0.5938140 0.8123719 0.40618597
[108,] 0.6311996 0.7376007 0.36880037
[109,] 0.5932922 0.8134156 0.40670780
[110,] 0.5443694 0.9112613 0.45563064
[111,] 0.6380221 0.7239559 0.36197794
[112,] 0.6223852 0.7552296 0.37761480
[113,] 0.5732471 0.8535057 0.42675286
[114,] 0.5227742 0.9544516 0.47722581
[115,] 0.4714186 0.9428373 0.52858136
[116,] 0.4203058 0.8406116 0.57969420
[117,] 0.4052284 0.8104568 0.59477162
[118,] 0.3554045 0.7108091 0.64459547
[119,] 0.3151012 0.6302024 0.68489878
[120,] 0.2765496 0.5530991 0.72345044
[121,] 0.2413291 0.4826581 0.75867094
[122,] 0.2083712 0.4167424 0.79162881
[123,] 0.2335951 0.4671902 0.76640491
[124,] 0.2638219 0.5276439 0.73617805
[125,] 0.4631683 0.9263366 0.53683172
[126,] 0.4244182 0.8488364 0.57558180
[127,] 0.3732019 0.7464038 0.62679808
[128,] 0.5484384 0.9031233 0.45156164
[129,] 0.5072062 0.9855876 0.49279381
[130,] 0.4632129 0.9264258 0.53678711
[131,] 0.4197597 0.8395195 0.58024025
[132,] 0.4196484 0.8392968 0.58035158
[133,] 0.4336203 0.8672407 0.56637966
[134,] 0.3729764 0.7459527 0.62702365
[135,] 0.3885449 0.7770898 0.61145509
[136,] 0.3431000 0.6861999 0.65690005
[137,] 0.2876144 0.5752288 0.71238561
[138,] 0.2470319 0.4940638 0.75296810
[139,] 0.2447290 0.4894579 0.75527104
[140,] 0.1938949 0.3877899 0.80610505
[141,] 0.1643481 0.3286963 0.83565186
[142,] 0.1686903 0.3373807 0.83130967
[143,] 0.1882101 0.3764202 0.81178988
[144,] 0.1699236 0.3398471 0.83007643
[145,] 0.1324645 0.2649290 0.86753549
[146,] 0.2535984 0.5071969 0.74640157
[147,] 0.2551159 0.5102319 0.74488406
[148,] 0.1880693 0.3761386 0.81193069
[149,] 0.1927617 0.3855234 0.80723831
[150,] 0.1357847 0.2715694 0.86421532
[151,] 0.3187806 0.6375612 0.68121938
[152,] 0.2231817 0.4463635 0.77681827
[153,] 0.1361600 0.2723200 0.86383998
> postscript(file="/var/wessaorg/rcomp/tmp/1mcyo1321577814.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/21xsi1321577814.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/3u7dc1321577814.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/4ib6j1321577814.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/5yfv31321577814.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.11334286 3.96745154 -3.35572607 -1.62857644 1.80586273 4.04824594
7 8 9 10 11 12
-0.11334286 -0.27493167 0.88665714 1.37142356 3.04824594 4.88665714
13 14 15 16 17 18
-4.11334286 1.96745154 3.64427393 -0.11334286 0.04824594 2.88665714
19 20 21 22 23 24
-0.03254846 1.88665714 3.96745154 -3.11334286 -0.19413727 -2.03254846
25 26 27 28 29 30
3.12904035 -5.19413727 2.04824594 -0.27493167 0.88665714 -2.95175406
31 32 33 34 35 36
1.88665714 -0.79016525 3.04824594 0.88665714 -0.11334286 2.29062915
37 38 39 40 41 42
-4.62857644 0.88665714 3.04824594 -0.95175406 1.04824594 1.88665714
43 44 45 46 47 48
1.64427393 -1.95175406 -1.95175406 -3.11334286 0.80586273 0.96745154
49 50 51 52 53 54
2.96745154 -1.11334286 1.72506833 0.04824594 -3.11334286 -2.19413727
55 56 57 58 59 60
-1.54778204 1.37142356 1.88665714 0.88665714 -2.03254846 -1.95175406
61 62 63 64 65 66
-5.70937085 -1.11334286 -3.27493167 -0.03254846 0.88665714 -4.19413727
67 68 69 70 71 72
-3.27493167 -2.03254846 0.88665714 0.88665714 0.20983475 1.96745154
73 74 75 76 77 78
0.72506833 0.72506833 -1.11334286 -1.87095965 2.80586273 -1.03254846
79 80 81 82 83 84
0.88665714 -1.11334286 0.88665714 1.88665714 0.88665714 1.88665714
85 86 87 88 89 90
0.96745154 0.04824594 1.12904035 -0.11334286 -1.11334286 -7.11334286
91 92 93 94 95 96
3.12904035 -1.35572607 0.88665714 -0.11334286 -1.11334286 2.04824594
97 98 99 100 101 102
-2.19413727 0.12904035 2.88665714 1.04824594 2.72506833 -2.03254846
103 104 105 106 107 108
1.64427393 -3.03254846 0.96745154 -5.11334286 1.88665714 0.88665714
109 110 111 112 113 114
-4.03254846 -3.70937085 0.88665714 -3.27493167 -1.03254846 -0.03254846
115 116 117 118 119 120
4.04824594 1.80586273 -0.19413727 0.20983475 -0.03254846 -0.11334286
121 122 123 124 125 126
-2.03254846 -0.19413727 0.88665714 0.72506833 0.80586273 -1.35572607
127 128 129 130 131 132
3.04824594 2.96745154 5.12904035 0.96745154 -0.95175406 -5.03254846
133 134 135 136 137 138
1.20983475 0.96745154 0.88665714 1.88665714 -2.87095965 -0.03254846
139 140 141 142 143 144
-2.95175406 1.20983475 -0.87095965 1.20983475 2.12904035 -0.35572607
145 146 147 148 149 150
0.96745154 2.20983475 1.80586273 -3.11334286 -2.11334286 -4.87095965
151 152 153 154 155 156
2.29062915 -1.19413727 2.12904035 -1.62857644 -4.79016525 -0.79016525
157 158 159 160 161 162
-1.35572607 0.37142356 5.12904035 -1.03254846 -1.79016525 -0.79016525
> postscript(file="/var/wessaorg/rcomp/tmp/60zz61321577814.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.11334286 NA
1 3.96745154 -0.11334286
2 -3.35572607 3.96745154
3 -1.62857644 -3.35572607
4 1.80586273 -1.62857644
5 4.04824594 1.80586273
6 -0.11334286 4.04824594
7 -0.27493167 -0.11334286
8 0.88665714 -0.27493167
9 1.37142356 0.88665714
10 3.04824594 1.37142356
11 4.88665714 3.04824594
12 -4.11334286 4.88665714
13 1.96745154 -4.11334286
14 3.64427393 1.96745154
15 -0.11334286 3.64427393
16 0.04824594 -0.11334286
17 2.88665714 0.04824594
18 -0.03254846 2.88665714
19 1.88665714 -0.03254846
20 3.96745154 1.88665714
21 -3.11334286 3.96745154
22 -0.19413727 -3.11334286
23 -2.03254846 -0.19413727
24 3.12904035 -2.03254846
25 -5.19413727 3.12904035
26 2.04824594 -5.19413727
27 -0.27493167 2.04824594
28 0.88665714 -0.27493167
29 -2.95175406 0.88665714
30 1.88665714 -2.95175406
31 -0.79016525 1.88665714
32 3.04824594 -0.79016525
33 0.88665714 3.04824594
34 -0.11334286 0.88665714
35 2.29062915 -0.11334286
36 -4.62857644 2.29062915
37 0.88665714 -4.62857644
38 3.04824594 0.88665714
39 -0.95175406 3.04824594
40 1.04824594 -0.95175406
41 1.88665714 1.04824594
42 1.64427393 1.88665714
43 -1.95175406 1.64427393
44 -1.95175406 -1.95175406
45 -3.11334286 -1.95175406
46 0.80586273 -3.11334286
47 0.96745154 0.80586273
48 2.96745154 0.96745154
49 -1.11334286 2.96745154
50 1.72506833 -1.11334286
51 0.04824594 1.72506833
52 -3.11334286 0.04824594
53 -2.19413727 -3.11334286
54 -1.54778204 -2.19413727
55 1.37142356 -1.54778204
56 1.88665714 1.37142356
57 0.88665714 1.88665714
58 -2.03254846 0.88665714
59 -1.95175406 -2.03254846
60 -5.70937085 -1.95175406
61 -1.11334286 -5.70937085
62 -3.27493167 -1.11334286
63 -0.03254846 -3.27493167
64 0.88665714 -0.03254846
65 -4.19413727 0.88665714
66 -3.27493167 -4.19413727
67 -2.03254846 -3.27493167
68 0.88665714 -2.03254846
69 0.88665714 0.88665714
70 0.20983475 0.88665714
71 1.96745154 0.20983475
72 0.72506833 1.96745154
73 0.72506833 0.72506833
74 -1.11334286 0.72506833
75 -1.87095965 -1.11334286
76 2.80586273 -1.87095965
77 -1.03254846 2.80586273
78 0.88665714 -1.03254846
79 -1.11334286 0.88665714
80 0.88665714 -1.11334286
81 1.88665714 0.88665714
82 0.88665714 1.88665714
83 1.88665714 0.88665714
84 0.96745154 1.88665714
85 0.04824594 0.96745154
86 1.12904035 0.04824594
87 -0.11334286 1.12904035
88 -1.11334286 -0.11334286
89 -7.11334286 -1.11334286
90 3.12904035 -7.11334286
91 -1.35572607 3.12904035
92 0.88665714 -1.35572607
93 -0.11334286 0.88665714
94 -1.11334286 -0.11334286
95 2.04824594 -1.11334286
96 -2.19413727 2.04824594
97 0.12904035 -2.19413727
98 2.88665714 0.12904035
99 1.04824594 2.88665714
100 2.72506833 1.04824594
101 -2.03254846 2.72506833
102 1.64427393 -2.03254846
103 -3.03254846 1.64427393
104 0.96745154 -3.03254846
105 -5.11334286 0.96745154
106 1.88665714 -5.11334286
107 0.88665714 1.88665714
108 -4.03254846 0.88665714
109 -3.70937085 -4.03254846
110 0.88665714 -3.70937085
111 -3.27493167 0.88665714
112 -1.03254846 -3.27493167
113 -0.03254846 -1.03254846
114 4.04824594 -0.03254846
115 1.80586273 4.04824594
116 -0.19413727 1.80586273
117 0.20983475 -0.19413727
118 -0.03254846 0.20983475
119 -0.11334286 -0.03254846
120 -2.03254846 -0.11334286
121 -0.19413727 -2.03254846
122 0.88665714 -0.19413727
123 0.72506833 0.88665714
124 0.80586273 0.72506833
125 -1.35572607 0.80586273
126 3.04824594 -1.35572607
127 2.96745154 3.04824594
128 5.12904035 2.96745154
129 0.96745154 5.12904035
130 -0.95175406 0.96745154
131 -5.03254846 -0.95175406
132 1.20983475 -5.03254846
133 0.96745154 1.20983475
134 0.88665714 0.96745154
135 1.88665714 0.88665714
136 -2.87095965 1.88665714
137 -0.03254846 -2.87095965
138 -2.95175406 -0.03254846
139 1.20983475 -2.95175406
140 -0.87095965 1.20983475
141 1.20983475 -0.87095965
142 2.12904035 1.20983475
143 -0.35572607 2.12904035
144 0.96745154 -0.35572607
145 2.20983475 0.96745154
146 1.80586273 2.20983475
147 -3.11334286 1.80586273
148 -2.11334286 -3.11334286
149 -4.87095965 -2.11334286
150 2.29062915 -4.87095965
151 -1.19413727 2.29062915
152 2.12904035 -1.19413727
153 -1.62857644 2.12904035
154 -4.79016525 -1.62857644
155 -0.79016525 -4.79016525
156 -1.35572607 -0.79016525
157 0.37142356 -1.35572607
158 5.12904035 0.37142356
159 -1.03254846 5.12904035
160 -1.79016525 -1.03254846
161 -0.79016525 -1.79016525
162 NA -0.79016525
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.96745154 -0.11334286
[2,] -3.35572607 3.96745154
[3,] -1.62857644 -3.35572607
[4,] 1.80586273 -1.62857644
[5,] 4.04824594 1.80586273
[6,] -0.11334286 4.04824594
[7,] -0.27493167 -0.11334286
[8,] 0.88665714 -0.27493167
[9,] 1.37142356 0.88665714
[10,] 3.04824594 1.37142356
[11,] 4.88665714 3.04824594
[12,] -4.11334286 4.88665714
[13,] 1.96745154 -4.11334286
[14,] 3.64427393 1.96745154
[15,] -0.11334286 3.64427393
[16,] 0.04824594 -0.11334286
[17,] 2.88665714 0.04824594
[18,] -0.03254846 2.88665714
[19,] 1.88665714 -0.03254846
[20,] 3.96745154 1.88665714
[21,] -3.11334286 3.96745154
[22,] -0.19413727 -3.11334286
[23,] -2.03254846 -0.19413727
[24,] 3.12904035 -2.03254846
[25,] -5.19413727 3.12904035
[26,] 2.04824594 -5.19413727
[27,] -0.27493167 2.04824594
[28,] 0.88665714 -0.27493167
[29,] -2.95175406 0.88665714
[30,] 1.88665714 -2.95175406
[31,] -0.79016525 1.88665714
[32,] 3.04824594 -0.79016525
[33,] 0.88665714 3.04824594
[34,] -0.11334286 0.88665714
[35,] 2.29062915 -0.11334286
[36,] -4.62857644 2.29062915
[37,] 0.88665714 -4.62857644
[38,] 3.04824594 0.88665714
[39,] -0.95175406 3.04824594
[40,] 1.04824594 -0.95175406
[41,] 1.88665714 1.04824594
[42,] 1.64427393 1.88665714
[43,] -1.95175406 1.64427393
[44,] -1.95175406 -1.95175406
[45,] -3.11334286 -1.95175406
[46,] 0.80586273 -3.11334286
[47,] 0.96745154 0.80586273
[48,] 2.96745154 0.96745154
[49,] -1.11334286 2.96745154
[50,] 1.72506833 -1.11334286
[51,] 0.04824594 1.72506833
[52,] -3.11334286 0.04824594
[53,] -2.19413727 -3.11334286
[54,] -1.54778204 -2.19413727
[55,] 1.37142356 -1.54778204
[56,] 1.88665714 1.37142356
[57,] 0.88665714 1.88665714
[58,] -2.03254846 0.88665714
[59,] -1.95175406 -2.03254846
[60,] -5.70937085 -1.95175406
[61,] -1.11334286 -5.70937085
[62,] -3.27493167 -1.11334286
[63,] -0.03254846 -3.27493167
[64,] 0.88665714 -0.03254846
[65,] -4.19413727 0.88665714
[66,] -3.27493167 -4.19413727
[67,] -2.03254846 -3.27493167
[68,] 0.88665714 -2.03254846
[69,] 0.88665714 0.88665714
[70,] 0.20983475 0.88665714
[71,] 1.96745154 0.20983475
[72,] 0.72506833 1.96745154
[73,] 0.72506833 0.72506833
[74,] -1.11334286 0.72506833
[75,] -1.87095965 -1.11334286
[76,] 2.80586273 -1.87095965
[77,] -1.03254846 2.80586273
[78,] 0.88665714 -1.03254846
[79,] -1.11334286 0.88665714
[80,] 0.88665714 -1.11334286
[81,] 1.88665714 0.88665714
[82,] 0.88665714 1.88665714
[83,] 1.88665714 0.88665714
[84,] 0.96745154 1.88665714
[85,] 0.04824594 0.96745154
[86,] 1.12904035 0.04824594
[87,] -0.11334286 1.12904035
[88,] -1.11334286 -0.11334286
[89,] -7.11334286 -1.11334286
[90,] 3.12904035 -7.11334286
[91,] -1.35572607 3.12904035
[92,] 0.88665714 -1.35572607
[93,] -0.11334286 0.88665714
[94,] -1.11334286 -0.11334286
[95,] 2.04824594 -1.11334286
[96,] -2.19413727 2.04824594
[97,] 0.12904035 -2.19413727
[98,] 2.88665714 0.12904035
[99,] 1.04824594 2.88665714
[100,] 2.72506833 1.04824594
[101,] -2.03254846 2.72506833
[102,] 1.64427393 -2.03254846
[103,] -3.03254846 1.64427393
[104,] 0.96745154 -3.03254846
[105,] -5.11334286 0.96745154
[106,] 1.88665714 -5.11334286
[107,] 0.88665714 1.88665714
[108,] -4.03254846 0.88665714
[109,] -3.70937085 -4.03254846
[110,] 0.88665714 -3.70937085
[111,] -3.27493167 0.88665714
[112,] -1.03254846 -3.27493167
[113,] -0.03254846 -1.03254846
[114,] 4.04824594 -0.03254846
[115,] 1.80586273 4.04824594
[116,] -0.19413727 1.80586273
[117,] 0.20983475 -0.19413727
[118,] -0.03254846 0.20983475
[119,] -0.11334286 -0.03254846
[120,] -2.03254846 -0.11334286
[121,] -0.19413727 -2.03254846
[122,] 0.88665714 -0.19413727
[123,] 0.72506833 0.88665714
[124,] 0.80586273 0.72506833
[125,] -1.35572607 0.80586273
[126,] 3.04824594 -1.35572607
[127,] 2.96745154 3.04824594
[128,] 5.12904035 2.96745154
[129,] 0.96745154 5.12904035
[130,] -0.95175406 0.96745154
[131,] -5.03254846 -0.95175406
[132,] 1.20983475 -5.03254846
[133,] 0.96745154 1.20983475
[134,] 0.88665714 0.96745154
[135,] 1.88665714 0.88665714
[136,] -2.87095965 1.88665714
[137,] -0.03254846 -2.87095965
[138,] -2.95175406 -0.03254846
[139,] 1.20983475 -2.95175406
[140,] -0.87095965 1.20983475
[141,] 1.20983475 -0.87095965
[142,] 2.12904035 1.20983475
[143,] -0.35572607 2.12904035
[144,] 0.96745154 -0.35572607
[145,] 2.20983475 0.96745154
[146,] 1.80586273 2.20983475
[147,] -3.11334286 1.80586273
[148,] -2.11334286 -3.11334286
[149,] -4.87095965 -2.11334286
[150,] 2.29062915 -4.87095965
[151,] -1.19413727 2.29062915
[152,] 2.12904035 -1.19413727
[153,] -1.62857644 2.12904035
[154,] -4.79016525 -1.62857644
[155,] -0.79016525 -4.79016525
[156,] -1.35572607 -0.79016525
[157,] 0.37142356 -1.35572607
[158,] 5.12904035 0.37142356
[159,] -1.03254846 5.12904035
[160,] -1.79016525 -1.03254846
[161,] -0.79016525 -1.79016525
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.96745154 -0.11334286
2 -3.35572607 3.96745154
3 -1.62857644 -3.35572607
4 1.80586273 -1.62857644
5 4.04824594 1.80586273
6 -0.11334286 4.04824594
7 -0.27493167 -0.11334286
8 0.88665714 -0.27493167
9 1.37142356 0.88665714
10 3.04824594 1.37142356
11 4.88665714 3.04824594
12 -4.11334286 4.88665714
13 1.96745154 -4.11334286
14 3.64427393 1.96745154
15 -0.11334286 3.64427393
16 0.04824594 -0.11334286
17 2.88665714 0.04824594
18 -0.03254846 2.88665714
19 1.88665714 -0.03254846
20 3.96745154 1.88665714
21 -3.11334286 3.96745154
22 -0.19413727 -3.11334286
23 -2.03254846 -0.19413727
24 3.12904035 -2.03254846
25 -5.19413727 3.12904035
26 2.04824594 -5.19413727
27 -0.27493167 2.04824594
28 0.88665714 -0.27493167
29 -2.95175406 0.88665714
30 1.88665714 -2.95175406
31 -0.79016525 1.88665714
32 3.04824594 -0.79016525
33 0.88665714 3.04824594
34 -0.11334286 0.88665714
35 2.29062915 -0.11334286
36 -4.62857644 2.29062915
37 0.88665714 -4.62857644
38 3.04824594 0.88665714
39 -0.95175406 3.04824594
40 1.04824594 -0.95175406
41 1.88665714 1.04824594
42 1.64427393 1.88665714
43 -1.95175406 1.64427393
44 -1.95175406 -1.95175406
45 -3.11334286 -1.95175406
46 0.80586273 -3.11334286
47 0.96745154 0.80586273
48 2.96745154 0.96745154
49 -1.11334286 2.96745154
50 1.72506833 -1.11334286
51 0.04824594 1.72506833
52 -3.11334286 0.04824594
53 -2.19413727 -3.11334286
54 -1.54778204 -2.19413727
55 1.37142356 -1.54778204
56 1.88665714 1.37142356
57 0.88665714 1.88665714
58 -2.03254846 0.88665714
59 -1.95175406 -2.03254846
60 -5.70937085 -1.95175406
61 -1.11334286 -5.70937085
62 -3.27493167 -1.11334286
63 -0.03254846 -3.27493167
64 0.88665714 -0.03254846
65 -4.19413727 0.88665714
66 -3.27493167 -4.19413727
67 -2.03254846 -3.27493167
68 0.88665714 -2.03254846
69 0.88665714 0.88665714
70 0.20983475 0.88665714
71 1.96745154 0.20983475
72 0.72506833 1.96745154
73 0.72506833 0.72506833
74 -1.11334286 0.72506833
75 -1.87095965 -1.11334286
76 2.80586273 -1.87095965
77 -1.03254846 2.80586273
78 0.88665714 -1.03254846
79 -1.11334286 0.88665714
80 0.88665714 -1.11334286
81 1.88665714 0.88665714
82 0.88665714 1.88665714
83 1.88665714 0.88665714
84 0.96745154 1.88665714
85 0.04824594 0.96745154
86 1.12904035 0.04824594
87 -0.11334286 1.12904035
88 -1.11334286 -0.11334286
89 -7.11334286 -1.11334286
90 3.12904035 -7.11334286
91 -1.35572607 3.12904035
92 0.88665714 -1.35572607
93 -0.11334286 0.88665714
94 -1.11334286 -0.11334286
95 2.04824594 -1.11334286
96 -2.19413727 2.04824594
97 0.12904035 -2.19413727
98 2.88665714 0.12904035
99 1.04824594 2.88665714
100 2.72506833 1.04824594
101 -2.03254846 2.72506833
102 1.64427393 -2.03254846
103 -3.03254846 1.64427393
104 0.96745154 -3.03254846
105 -5.11334286 0.96745154
106 1.88665714 -5.11334286
107 0.88665714 1.88665714
108 -4.03254846 0.88665714
109 -3.70937085 -4.03254846
110 0.88665714 -3.70937085
111 -3.27493167 0.88665714
112 -1.03254846 -3.27493167
113 -0.03254846 -1.03254846
114 4.04824594 -0.03254846
115 1.80586273 4.04824594
116 -0.19413727 1.80586273
117 0.20983475 -0.19413727
118 -0.03254846 0.20983475
119 -0.11334286 -0.03254846
120 -2.03254846 -0.11334286
121 -0.19413727 -2.03254846
122 0.88665714 -0.19413727
123 0.72506833 0.88665714
124 0.80586273 0.72506833
125 -1.35572607 0.80586273
126 3.04824594 -1.35572607
127 2.96745154 3.04824594
128 5.12904035 2.96745154
129 0.96745154 5.12904035
130 -0.95175406 0.96745154
131 -5.03254846 -0.95175406
132 1.20983475 -5.03254846
133 0.96745154 1.20983475
134 0.88665714 0.96745154
135 1.88665714 0.88665714
136 -2.87095965 1.88665714
137 -0.03254846 -2.87095965
138 -2.95175406 -0.03254846
139 1.20983475 -2.95175406
140 -0.87095965 1.20983475
141 1.20983475 -0.87095965
142 2.12904035 1.20983475
143 -0.35572607 2.12904035
144 0.96745154 -0.35572607
145 2.20983475 0.96745154
146 1.80586273 2.20983475
147 -3.11334286 1.80586273
148 -2.11334286 -3.11334286
149 -4.87095965 -2.11334286
150 2.29062915 -4.87095965
151 -1.19413727 2.29062915
152 2.12904035 -1.19413727
153 -1.62857644 2.12904035
154 -4.79016525 -1.62857644
155 -0.79016525 -4.79016525
156 -1.35572607 -0.79016525
157 0.37142356 -1.35572607
158 5.12904035 0.37142356
159 -1.03254846 5.12904035
160 -1.79016525 -1.03254846
161 -0.79016525 -1.79016525
> 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/7nmeh1321577814.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/8vwoi1321577814.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/98n6a1321577814.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/10lztf1321577814.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/1166rp1321577814.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/12iy8g1321577814.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/13e4jf1321577814.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/144ilr1321577814.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/155z811321577814.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/16vxj41321577814.tab")
+ }
>
> try(system("convert tmp/1mcyo1321577814.ps tmp/1mcyo1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/21xsi1321577814.ps tmp/21xsi1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/3u7dc1321577814.ps tmp/3u7dc1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ib6j1321577814.ps tmp/4ib6j1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/5yfv31321577814.ps tmp/5yfv31321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/60zz61321577814.ps tmp/60zz61321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/7nmeh1321577814.ps tmp/7nmeh1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/8vwoi1321577814.ps tmp/8vwoi1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/98n6a1321577814.ps tmp/98n6a1321577814.png",intern=TRUE))
character(0)
> try(system("convert tmp/10lztf1321577814.ps tmp/10lztf1321577814.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.615 0.480 5.137