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(13
+ ,1
+ ,12
+ ,14
+ ,16
+ ,1
+ ,11
+ ,18
+ ,19
+ ,1
+ ,15
+ ,11
+ ,15
+ ,0
+ ,6
+ ,12
+ ,14
+ ,1
+ ,13
+ ,16
+ ,13
+ ,1
+ ,10
+ ,18
+ ,19
+ ,1
+ ,12
+ ,14
+ ,15
+ ,1
+ ,14
+ ,14
+ ,14
+ ,1
+ ,12
+ ,15
+ ,15
+ ,1
+ ,6
+ ,15
+ ,16
+ ,0
+ ,10
+ ,17
+ ,16
+ ,1
+ ,12
+ ,19
+ ,16
+ ,0
+ ,12
+ ,10
+ ,16
+ ,1
+ ,11
+ ,16
+ ,17
+ ,1
+ ,15
+ ,18
+ ,15
+ ,0
+ ,12
+ ,14
+ ,15
+ ,0
+ ,10
+ ,14
+ ,20
+ ,1
+ ,12
+ ,17
+ ,18
+ ,0
+ ,11
+ ,14
+ ,16
+ ,1
+ ,12
+ ,16
+ ,16
+ ,0
+ ,11
+ ,18
+ ,16
+ ,1
+ ,12
+ ,11
+ ,19
+ ,1
+ ,13
+ ,14
+ ,16
+ ,1
+ ,11
+ ,12
+ ,17
+ ,0
+ ,9
+ ,17
+ ,17
+ ,1
+ ,13
+ ,9
+ ,16
+ ,0
+ ,10
+ ,16
+ ,15
+ ,1
+ ,14
+ ,14
+ ,16
+ ,1
+ ,12
+ ,15
+ ,14
+ ,0
+ ,10
+ ,11
+ ,15
+ ,1
+ ,12
+ ,16
+ ,12
+ ,0
+ ,8
+ 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,13
+ ,12
+ ,1
+ ,8
+ ,12
+ ,13
+ ,1
+ ,8
+ ,13)
+ ,dim=c(4
+ ,162)
+ ,dimnames=list(c('Learning'
+ ,'Gender'
+ ,'Software'
+ ,'Happiness')
+ ,1:162))
> y <- array(NA,dim=c(4,162),dimnames=list(c('Learning','Gender','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 = '1'
> #'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
Learning Gender Software Happiness
1 13 1 12 14
2 16 1 11 18
3 19 1 15 11
4 15 0 6 12
5 14 1 13 16
6 13 1 10 18
7 19 1 12 14
8 15 1 14 14
9 14 1 12 15
10 15 1 6 15
11 16 0 10 17
12 16 1 12 19
13 16 0 12 10
14 16 1 11 16
15 17 1 15 18
16 15 0 12 14
17 15 0 10 14
18 20 1 12 17
19 18 0 11 14
20 16 1 12 16
21 16 0 11 18
22 16 1 12 11
23 19 1 13 14
24 16 1 11 12
25 17 0 9 17
26 17 1 13 9
27 16 0 10 16
28 15 1 14 14
29 16 1 12 15
30 14 0 10 11
31 15 1 12 16
32 12 0 8 13
33 14 1 10 17
34 16 1 12 15
35 14 0 12 14
36 7 0 7 16
37 10 0 6 9
38 14 0 12 15
39 16 1 10 17
40 16 0 10 13
41 16 0 10 15
42 14 1 12 16
43 20 0 15 16
44 14 0 10 12
45 14 1 10 12
46 11 1 12 11
47 14 1 13 15
48 15 1 11 15
49 16 1 11 17
50 14 0 12 13
51 16 1 14 16
52 14 0 10 14
53 12 0 12 11
54 16 1 13 12
55 9 0 5 12
56 14 1 6 15
57 16 1 12 16
58 16 1 12 15
59 15 0 11 12
60 16 1 10 12
61 12 0 7 8
62 16 0 12 13
63 16 1 14 11
64 14 1 11 14
65 16 1 12 15
66 17 0 13 10
67 18 1 14 11
68 18 0 11 12
69 12 1 12 15
70 16 0 12 15
71 10 0 8 14
72 14 1 11 16
73 18 1 14 15
74 18 0 14 15
75 16 0 12 13
76 17 1 9 12
77 16 1 13 17
78 16 1 11 13
79 13 0 12 15
80 16 0 12 13
81 16 0 12 15
82 20 0 12 16
83 16 1 12 15
84 15 0 12 16
85 15 1 11 15
86 16 1 10 14
87 14 0 9 15
88 16 1 12 14
89 16 1 12 13
90 15 1 12 7
91 12 1 9 17
92 17 1 15 13
93 16 1 12 15
94 15 1 12 14
95 13 1 12 13
96 16 1 10 16
97 16 1 13 12
98 16 1 9 14
99 16 0 12 17
100 14 0 10 15
101 16 1 14 17
102 16 0 11 12
103 20 1 15 16
104 15 0 11 11
105 16 1 11 15
106 13 0 12 9
107 17 1 12 16
108 16 0 12 15
109 16 0 11 10
110 12 1 7 10
111 16 1 12 15
112 16 1 14 11
113 17 1 11 13
114 13 0 11 14
115 12 1 10 18
116 18 0 13 16
117 14 1 13 14
118 14 1 8 14
119 13 1 11 14
120 16 1 12 14
121 13 1 11 12
122 16 1 13 14
123 13 1 12 15
124 16 1 14 15
125 15 1 13 15
126 16 1 15 13
127 15 0 10 17
128 17 1 11 17
129 15 1 9 19
130 12 1 11 15
131 16 0 10 13
132 10 0 11 9
133 16 1 8 15
134 12 0 11 15
135 14 0 12 15
136 15 1 12 16
137 13 0 9 11
138 15 0 11 14
139 11 1 10 11
140 12 1 8 15
141 8 0 9 13
142 16 1 8 15
143 15 0 9 16
144 17 1 15 14
145 16 0 11 15
146 10 1 8 16
147 18 1 13 16
148 13 0 12 11
149 16 0 12 12
150 13 0 9 9
151 10 1 7 16
152 15 1 13 13
153 16 0 9 16
154 16 1 6 12
155 14 1 8 9
156 10 1 8 13
157 17 1 15 13
158 13 1 6 14
159 15 1 9 19
160 16 1 11 13
161 12 1 8 12
162 13 1 8 13
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gender Software Happiness
6.78553 0.02652 0.56266 0.13736
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.9218 -1.1583 0.2318 1.2354 4.2649
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.78553 1.14544 5.924 1.90e-08 ***
Gender 0.02652 0.31384 0.085 0.9328
Software 0.56266 0.07023 8.012 2.33e-13 ***
Happiness 0.13736 0.06455 2.128 0.0349 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.881 on 158 degrees of freedom
Multiple R-squared: 0.3181, Adjusted R-squared: 0.3051
F-statistic: 24.57 on 3 and 158 DF, p-value: 4.217e-13
> 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.93495111 0.13009778 0.06504889
[2,] 0.89830518 0.20338964 0.10169482
[3,] 0.86293967 0.27412065 0.13706033
[4,] 0.79464435 0.41071130 0.20535565
[5,] 0.77397301 0.45205398 0.22602699
[6,] 0.74064254 0.51871492 0.25935746
[7,] 0.67886480 0.64227041 0.32113520
[8,] 0.60457835 0.79084330 0.39542165
[9,] 0.54509255 0.90981490 0.45490745
[10,] 0.48009982 0.96019965 0.51990018
[11,] 0.39869300 0.79738600 0.60130700
[12,] 0.72777928 0.54444144 0.27222072
[13,] 0.75293377 0.49413247 0.24706623
[14,] 0.69005165 0.61989671 0.30994835
[15,] 0.62385617 0.75228766 0.37614383
[16,] 0.55613851 0.88772297 0.44386149
[17,] 0.62203511 0.75592977 0.37796489
[18,] 0.56052224 0.87895553 0.43947776
[19,] 0.55814614 0.88370773 0.44185386
[20,] 0.50112009 0.99775982 0.49887991
[21,] 0.44331607 0.88663214 0.55668393
[22,] 0.43328722 0.86657445 0.56671278
[23,] 0.37225488 0.74450976 0.62774512
[24,] 0.37361154 0.74722308 0.62638846
[25,] 0.33331443 0.66662885 0.66668557
[26,] 0.41339321 0.82678641 0.58660679
[27,] 0.38204301 0.76408601 0.61795699
[28,] 0.32750110 0.65500220 0.67249890
[29,] 0.33345573 0.66691147 0.66654427
[30,] 0.86985571 0.26028859 0.13014429
[31,] 0.88176362 0.23647275 0.11823638
[32,] 0.87285440 0.25429120 0.12714560
[33,] 0.85239257 0.29521486 0.14760743
[34,] 0.84234817 0.31530365 0.15765183
[35,] 0.82726613 0.34546774 0.17273387
[36,] 0.82580793 0.34838414 0.17419207
[37,] 0.84635416 0.30729169 0.15364584
[38,] 0.81690395 0.36619209 0.18309605
[39,] 0.78321472 0.43357055 0.21678528
[40,] 0.90028910 0.19942179 0.09971090
[41,] 0.90694457 0.18611086 0.09305543
[42,] 0.88443377 0.23113246 0.11556623
[43,] 0.86181297 0.27637405 0.13818703
[44,] 0.85164803 0.29670393 0.14835197
[45,] 0.82801052 0.34397895 0.17198948
[46,] 0.79759733 0.40480533 0.20240267
[47,] 0.84797992 0.30404015 0.15202008
[48,] 0.81822820 0.36354360 0.18177180
[49,] 0.83057667 0.33884666 0.16942333
[50,] 0.82416057 0.35167886 0.17583943
[51,] 0.79191597 0.41616806 0.20808403
[52,] 0.75729428 0.48541144 0.24270572
[53,] 0.72018090 0.55963821 0.27981910
[54,] 0.71759664 0.56480672 0.28240336
[55,] 0.67654201 0.64691599 0.32345799
[56,] 0.63872403 0.72255194 0.36127597
[57,] 0.59438169 0.81123661 0.40561831
[58,] 0.56050219 0.87899563 0.43949781
[59,] 0.51548117 0.96903766 0.48451883
[60,] 0.49837051 0.99674102 0.50162949
[61,] 0.49103872 0.98207744 0.50896128
[62,] 0.58531134 0.82937732 0.41468866
[63,] 0.70004129 0.59991742 0.29995871
[64,] 0.66072063 0.67855874 0.33927937
[65,] 0.73428877 0.53142247 0.26571123
[66,] 0.71076585 0.57846829 0.28923415
[67,] 0.68735357 0.62529287 0.31264643
[68,] 0.66403687 0.67192626 0.33596313
[69,] 0.62724155 0.74551689 0.37275845
[70,] 0.72297186 0.55405628 0.27702814
[71,] 0.68578106 0.62843789 0.31421894
[72,] 0.66122187 0.67755626 0.33877813
[73,] 0.69568111 0.60863778 0.30431889
[74,] 0.66064236 0.67871528 0.33935764
[75,] 0.62016929 0.75966142 0.37983071
[76,] 0.78503257 0.42993486 0.21496743
[77,] 0.75178288 0.49643424 0.24821712
[78,] 0.71910254 0.56179492 0.28089746
[79,] 0.67931015 0.64137971 0.32068985
[80,] 0.66926880 0.66146241 0.33073120
[81,] 0.62732697 0.74534606 0.37267303
[82,] 0.58724594 0.82550813 0.41275406
[83,] 0.54878813 0.90242375 0.45121187
[84,] 0.51159444 0.97681113 0.48840556
[85,] 0.52985931 0.94028139 0.47014069
[86,] 0.48637515 0.97275031 0.51362485
[87,] 0.44310123 0.88620247 0.55689877
[88,] 0.40050898 0.80101796 0.59949102
[89,] 0.42008557 0.84017115 0.57991443
[90,] 0.39843276 0.79686552 0.60156724
[91,] 0.35731150 0.71462299 0.64268850
[92,] 0.37468388 0.74936776 0.62531612
[93,] 0.33175795 0.66351591 0.66824205
[94,] 0.29233851 0.58467702 0.70766149
[95,] 0.26257112 0.52514224 0.73742888
[96,] 0.25169026 0.50338053 0.74830974
[97,] 0.29386416 0.58772831 0.70613584
[98,] 0.26354189 0.52708379 0.73645811
[99,] 0.23776609 0.47553217 0.76223391
[100,] 0.22531027 0.45062054 0.77468973
[101,] 0.20970426 0.41940851 0.79029574
[102,] 0.18150550 0.36301100 0.81849450
[103,] 0.18880145 0.37760290 0.81119855
[104,] 0.15833605 0.31667210 0.84166395
[105,] 0.13379351 0.26758703 0.86620649
[106,] 0.11253155 0.22506310 0.88746845
[107,] 0.13210960 0.26421920 0.86789040
[108,] 0.12461892 0.24923785 0.87538108
[109,] 0.16424518 0.32849037 0.83575482
[110,] 0.17072277 0.34144555 0.82927723
[111,] 0.16322406 0.32644812 0.83677594
[112,] 0.13859556 0.27719112 0.86140444
[113,] 0.13188195 0.26376391 0.86811805
[114,] 0.11164190 0.22328380 0.88835810
[115,] 0.09862794 0.19725588 0.90137206
[116,] 0.07923804 0.15847607 0.92076196
[117,] 0.08868421 0.17736841 0.91131579
[118,] 0.07021254 0.14042508 0.92978746
[119,] 0.05724658 0.11449316 0.94275342
[120,] 0.04476053 0.08952107 0.95523947
[121,] 0.03381893 0.06763786 0.96618107
[122,] 0.03096852 0.06193705 0.96903148
[123,] 0.02273817 0.04547635 0.97726183
[124,] 0.03245942 0.06491884 0.96754058
[125,] 0.03747865 0.07495730 0.96252135
[126,] 0.06724500 0.13448999 0.93275500
[127,] 0.08340186 0.16680371 0.91659814
[128,] 0.09963457 0.19926914 0.90036543
[129,] 0.08478669 0.16957338 0.91521331
[130,] 0.06520392 0.13040785 0.93479608
[131,] 0.04768623 0.09537247 0.95231377
[132,] 0.03430046 0.06860093 0.96569954
[133,] 0.04593226 0.09186452 0.95406774
[134,] 0.03743560 0.07487120 0.96256440
[135,] 0.25872394 0.51744789 0.74127606
[136,] 0.30575589 0.61151178 0.69424411
[137,] 0.25122206 0.50244412 0.74877794
[138,] 0.19415353 0.38830707 0.80584647
[139,] 0.15381085 0.30762169 0.84618915
[140,] 0.26484406 0.52968811 0.73515594
[141,] 0.26294717 0.52589434 0.73705283
[142,] 0.29341017 0.58682033 0.70658983
[143,] 0.21910983 0.43821967 0.78089017
[144,] 0.22059657 0.44119314 0.77940343
[145,] 0.31680053 0.63360106 0.68319947
[146,] 0.23193833 0.46387666 0.76806167
[147,] 0.15339230 0.30678460 0.84660770
[148,] 0.38946153 0.77892305 0.61053847
[149,] 0.38624708 0.77249415 0.61375292
> postscript(file="/var/wessaorg/rcomp/tmp/11fr91322180152.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/220y21322180152.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/3l7qi1322180152.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/4cigo1322180152.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/5k2dn1322180152.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
-2.48691631 0.52631944 2.23717792 3.19026303 -2.32428440 -1.91102325
7 8 9 10 11 12
3.51308369 -1.61223094 -1.62427170 2.75167216 1.25285684 -0.17369326
13 14 15 16 17 18
1.08902994 0.80103022 -0.72430980 -0.46039161 0.66492301 4.10101752
19 20 21 22 23 24
3.10226570 0.23837291 0.55284414 0.92514985 2.95042637 1.35045177
25 26 27 28 29 30
2.81551415 1.63720332 1.39021223 -1.61223094 0.37572830 0.07698917
31 32 33 34 35 36
-0.76162709 -1.07240698 -0.77366786 0.37572830 -1.46039161 -5.92181584
37 38 39 40 41 42
-1.39767081 -1.59774700 1.22633214 1.80227840 1.52756762 -1.76162709
43 44 45 46 47 48
2.57692568 -0.06036622 -0.08689092 -4.07485015 -2.18692901 -0.06161439
49 50 51 52 53 54
0.66367483 -1.32303623 -0.88694171 -0.33507699 -3.04832545 0.22513715
55 56 57 58 59 60
-2.24707966 1.75167216 0.23837291 0.37572830 0.37697647 1.91310908
61 62 63 64 65 66
0.17702727 0.67696377 -0.20016477 -0.92425900 0.37572830 1.52637263
67 68 69 70 71 72
1.79983523 3.37697647 -3.62427170 0.40225300 -3.20976237 -1.19896978
73 74 75 76 77 78
1.25041367 1.27693838 0.67696377 3.47576639 -0.46163979 1.21309638
79 80 81 82 83 84
-2.59774700 0.67696377 0.40225300 4.26489761 0.37572830 -0.73510239
85 86 87 88 89 90
-0.06161439 1.63839831 0.09022493 0.51308369 0.65043907 0.47457140
91 92 93 94 95 96
-2.21101055 -0.03753286 0.37572830 -0.48691631 -2.34956093 1.36368753
97 98 99 100 101 102
0.22513715 2.20105562 0.12754222 -0.47243238 -1.02429710 1.37697647
103 104 105 106 107 108
2.55040098 0.51433186 0.93838561 -1.77361467 1.23837291 0.40225300
109 110 111 112 113 114
1.65168725 -0.12420821 0.37572830 -0.20016477 2.21309638 -1.89773430
115 116 117 118 119 120
-2.91102325 1.70224030 -2.04957363 0.76371293 -1.92425900 0.51308369
121 122 123 124 125 126
-1.64954823 -0.04957363 -2.62427170 -0.74958633 -1.18692901 -1.03753286
127 128 129 130 131 132
0.25285684 1.66367483 0.51427868 -3.06161439 1.80227840 -4.21095736
133 134 135 136 137 138
2.62635754 -3.03508969 -1.59774700 -0.76162709 -0.36035352 0.10226570
139 140 141 142 143 144
-2.94953553 -1.37364246 -5.63506429 2.62635754 0.95286954 -0.17488825
145 146 147 148 149 150
0.96491031 -3.51099785 1.67571560 -2.04832545 0.81431916 -0.08564274
151 152 153 154 155 156
-2.94834054 -0.91221824 1.95286954 4.16373833 1.45048987 -3.09893168
157 158 159 160 161 162
-0.03753286 0.88902755 0.51427868 1.21309638 -0.96157629 -0.09893168
> postscript(file="/var/wessaorg/rcomp/tmp/6y8w61322180152.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 -2.48691631 NA
1 0.52631944 -2.48691631
2 2.23717792 0.52631944
3 3.19026303 2.23717792
4 -2.32428440 3.19026303
5 -1.91102325 -2.32428440
6 3.51308369 -1.91102325
7 -1.61223094 3.51308369
8 -1.62427170 -1.61223094
9 2.75167216 -1.62427170
10 1.25285684 2.75167216
11 -0.17369326 1.25285684
12 1.08902994 -0.17369326
13 0.80103022 1.08902994
14 -0.72430980 0.80103022
15 -0.46039161 -0.72430980
16 0.66492301 -0.46039161
17 4.10101752 0.66492301
18 3.10226570 4.10101752
19 0.23837291 3.10226570
20 0.55284414 0.23837291
21 0.92514985 0.55284414
22 2.95042637 0.92514985
23 1.35045177 2.95042637
24 2.81551415 1.35045177
25 1.63720332 2.81551415
26 1.39021223 1.63720332
27 -1.61223094 1.39021223
28 0.37572830 -1.61223094
29 0.07698917 0.37572830
30 -0.76162709 0.07698917
31 -1.07240698 -0.76162709
32 -0.77366786 -1.07240698
33 0.37572830 -0.77366786
34 -1.46039161 0.37572830
35 -5.92181584 -1.46039161
36 -1.39767081 -5.92181584
37 -1.59774700 -1.39767081
38 1.22633214 -1.59774700
39 1.80227840 1.22633214
40 1.52756762 1.80227840
41 -1.76162709 1.52756762
42 2.57692568 -1.76162709
43 -0.06036622 2.57692568
44 -0.08689092 -0.06036622
45 -4.07485015 -0.08689092
46 -2.18692901 -4.07485015
47 -0.06161439 -2.18692901
48 0.66367483 -0.06161439
49 -1.32303623 0.66367483
50 -0.88694171 -1.32303623
51 -0.33507699 -0.88694171
52 -3.04832545 -0.33507699
53 0.22513715 -3.04832545
54 -2.24707966 0.22513715
55 1.75167216 -2.24707966
56 0.23837291 1.75167216
57 0.37572830 0.23837291
58 0.37697647 0.37572830
59 1.91310908 0.37697647
60 0.17702727 1.91310908
61 0.67696377 0.17702727
62 -0.20016477 0.67696377
63 -0.92425900 -0.20016477
64 0.37572830 -0.92425900
65 1.52637263 0.37572830
66 1.79983523 1.52637263
67 3.37697647 1.79983523
68 -3.62427170 3.37697647
69 0.40225300 -3.62427170
70 -3.20976237 0.40225300
71 -1.19896978 -3.20976237
72 1.25041367 -1.19896978
73 1.27693838 1.25041367
74 0.67696377 1.27693838
75 3.47576639 0.67696377
76 -0.46163979 3.47576639
77 1.21309638 -0.46163979
78 -2.59774700 1.21309638
79 0.67696377 -2.59774700
80 0.40225300 0.67696377
81 4.26489761 0.40225300
82 0.37572830 4.26489761
83 -0.73510239 0.37572830
84 -0.06161439 -0.73510239
85 1.63839831 -0.06161439
86 0.09022493 1.63839831
87 0.51308369 0.09022493
88 0.65043907 0.51308369
89 0.47457140 0.65043907
90 -2.21101055 0.47457140
91 -0.03753286 -2.21101055
92 0.37572830 -0.03753286
93 -0.48691631 0.37572830
94 -2.34956093 -0.48691631
95 1.36368753 -2.34956093
96 0.22513715 1.36368753
97 2.20105562 0.22513715
98 0.12754222 2.20105562
99 -0.47243238 0.12754222
100 -1.02429710 -0.47243238
101 1.37697647 -1.02429710
102 2.55040098 1.37697647
103 0.51433186 2.55040098
104 0.93838561 0.51433186
105 -1.77361467 0.93838561
106 1.23837291 -1.77361467
107 0.40225300 1.23837291
108 1.65168725 0.40225300
109 -0.12420821 1.65168725
110 0.37572830 -0.12420821
111 -0.20016477 0.37572830
112 2.21309638 -0.20016477
113 -1.89773430 2.21309638
114 -2.91102325 -1.89773430
115 1.70224030 -2.91102325
116 -2.04957363 1.70224030
117 0.76371293 -2.04957363
118 -1.92425900 0.76371293
119 0.51308369 -1.92425900
120 -1.64954823 0.51308369
121 -0.04957363 -1.64954823
122 -2.62427170 -0.04957363
123 -0.74958633 -2.62427170
124 -1.18692901 -0.74958633
125 -1.03753286 -1.18692901
126 0.25285684 -1.03753286
127 1.66367483 0.25285684
128 0.51427868 1.66367483
129 -3.06161439 0.51427868
130 1.80227840 -3.06161439
131 -4.21095736 1.80227840
132 2.62635754 -4.21095736
133 -3.03508969 2.62635754
134 -1.59774700 -3.03508969
135 -0.76162709 -1.59774700
136 -0.36035352 -0.76162709
137 0.10226570 -0.36035352
138 -2.94953553 0.10226570
139 -1.37364246 -2.94953553
140 -5.63506429 -1.37364246
141 2.62635754 -5.63506429
142 0.95286954 2.62635754
143 -0.17488825 0.95286954
144 0.96491031 -0.17488825
145 -3.51099785 0.96491031
146 1.67571560 -3.51099785
147 -2.04832545 1.67571560
148 0.81431916 -2.04832545
149 -0.08564274 0.81431916
150 -2.94834054 -0.08564274
151 -0.91221824 -2.94834054
152 1.95286954 -0.91221824
153 4.16373833 1.95286954
154 1.45048987 4.16373833
155 -3.09893168 1.45048987
156 -0.03753286 -3.09893168
157 0.88902755 -0.03753286
158 0.51427868 0.88902755
159 1.21309638 0.51427868
160 -0.96157629 1.21309638
161 -0.09893168 -0.96157629
162 NA -0.09893168
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.52631944 -2.48691631
[2,] 2.23717792 0.52631944
[3,] 3.19026303 2.23717792
[4,] -2.32428440 3.19026303
[5,] -1.91102325 -2.32428440
[6,] 3.51308369 -1.91102325
[7,] -1.61223094 3.51308369
[8,] -1.62427170 -1.61223094
[9,] 2.75167216 -1.62427170
[10,] 1.25285684 2.75167216
[11,] -0.17369326 1.25285684
[12,] 1.08902994 -0.17369326
[13,] 0.80103022 1.08902994
[14,] -0.72430980 0.80103022
[15,] -0.46039161 -0.72430980
[16,] 0.66492301 -0.46039161
[17,] 4.10101752 0.66492301
[18,] 3.10226570 4.10101752
[19,] 0.23837291 3.10226570
[20,] 0.55284414 0.23837291
[21,] 0.92514985 0.55284414
[22,] 2.95042637 0.92514985
[23,] 1.35045177 2.95042637
[24,] 2.81551415 1.35045177
[25,] 1.63720332 2.81551415
[26,] 1.39021223 1.63720332
[27,] -1.61223094 1.39021223
[28,] 0.37572830 -1.61223094
[29,] 0.07698917 0.37572830
[30,] -0.76162709 0.07698917
[31,] -1.07240698 -0.76162709
[32,] -0.77366786 -1.07240698
[33,] 0.37572830 -0.77366786
[34,] -1.46039161 0.37572830
[35,] -5.92181584 -1.46039161
[36,] -1.39767081 -5.92181584
[37,] -1.59774700 -1.39767081
[38,] 1.22633214 -1.59774700
[39,] 1.80227840 1.22633214
[40,] 1.52756762 1.80227840
[41,] -1.76162709 1.52756762
[42,] 2.57692568 -1.76162709
[43,] -0.06036622 2.57692568
[44,] -0.08689092 -0.06036622
[45,] -4.07485015 -0.08689092
[46,] -2.18692901 -4.07485015
[47,] -0.06161439 -2.18692901
[48,] 0.66367483 -0.06161439
[49,] -1.32303623 0.66367483
[50,] -0.88694171 -1.32303623
[51,] -0.33507699 -0.88694171
[52,] -3.04832545 -0.33507699
[53,] 0.22513715 -3.04832545
[54,] -2.24707966 0.22513715
[55,] 1.75167216 -2.24707966
[56,] 0.23837291 1.75167216
[57,] 0.37572830 0.23837291
[58,] 0.37697647 0.37572830
[59,] 1.91310908 0.37697647
[60,] 0.17702727 1.91310908
[61,] 0.67696377 0.17702727
[62,] -0.20016477 0.67696377
[63,] -0.92425900 -0.20016477
[64,] 0.37572830 -0.92425900
[65,] 1.52637263 0.37572830
[66,] 1.79983523 1.52637263
[67,] 3.37697647 1.79983523
[68,] -3.62427170 3.37697647
[69,] 0.40225300 -3.62427170
[70,] -3.20976237 0.40225300
[71,] -1.19896978 -3.20976237
[72,] 1.25041367 -1.19896978
[73,] 1.27693838 1.25041367
[74,] 0.67696377 1.27693838
[75,] 3.47576639 0.67696377
[76,] -0.46163979 3.47576639
[77,] 1.21309638 -0.46163979
[78,] -2.59774700 1.21309638
[79,] 0.67696377 -2.59774700
[80,] 0.40225300 0.67696377
[81,] 4.26489761 0.40225300
[82,] 0.37572830 4.26489761
[83,] -0.73510239 0.37572830
[84,] -0.06161439 -0.73510239
[85,] 1.63839831 -0.06161439
[86,] 0.09022493 1.63839831
[87,] 0.51308369 0.09022493
[88,] 0.65043907 0.51308369
[89,] 0.47457140 0.65043907
[90,] -2.21101055 0.47457140
[91,] -0.03753286 -2.21101055
[92,] 0.37572830 -0.03753286
[93,] -0.48691631 0.37572830
[94,] -2.34956093 -0.48691631
[95,] 1.36368753 -2.34956093
[96,] 0.22513715 1.36368753
[97,] 2.20105562 0.22513715
[98,] 0.12754222 2.20105562
[99,] -0.47243238 0.12754222
[100,] -1.02429710 -0.47243238
[101,] 1.37697647 -1.02429710
[102,] 2.55040098 1.37697647
[103,] 0.51433186 2.55040098
[104,] 0.93838561 0.51433186
[105,] -1.77361467 0.93838561
[106,] 1.23837291 -1.77361467
[107,] 0.40225300 1.23837291
[108,] 1.65168725 0.40225300
[109,] -0.12420821 1.65168725
[110,] 0.37572830 -0.12420821
[111,] -0.20016477 0.37572830
[112,] 2.21309638 -0.20016477
[113,] -1.89773430 2.21309638
[114,] -2.91102325 -1.89773430
[115,] 1.70224030 -2.91102325
[116,] -2.04957363 1.70224030
[117,] 0.76371293 -2.04957363
[118,] -1.92425900 0.76371293
[119,] 0.51308369 -1.92425900
[120,] -1.64954823 0.51308369
[121,] -0.04957363 -1.64954823
[122,] -2.62427170 -0.04957363
[123,] -0.74958633 -2.62427170
[124,] -1.18692901 -0.74958633
[125,] -1.03753286 -1.18692901
[126,] 0.25285684 -1.03753286
[127,] 1.66367483 0.25285684
[128,] 0.51427868 1.66367483
[129,] -3.06161439 0.51427868
[130,] 1.80227840 -3.06161439
[131,] -4.21095736 1.80227840
[132,] 2.62635754 -4.21095736
[133,] -3.03508969 2.62635754
[134,] -1.59774700 -3.03508969
[135,] -0.76162709 -1.59774700
[136,] -0.36035352 -0.76162709
[137,] 0.10226570 -0.36035352
[138,] -2.94953553 0.10226570
[139,] -1.37364246 -2.94953553
[140,] -5.63506429 -1.37364246
[141,] 2.62635754 -5.63506429
[142,] 0.95286954 2.62635754
[143,] -0.17488825 0.95286954
[144,] 0.96491031 -0.17488825
[145,] -3.51099785 0.96491031
[146,] 1.67571560 -3.51099785
[147,] -2.04832545 1.67571560
[148,] 0.81431916 -2.04832545
[149,] -0.08564274 0.81431916
[150,] -2.94834054 -0.08564274
[151,] -0.91221824 -2.94834054
[152,] 1.95286954 -0.91221824
[153,] 4.16373833 1.95286954
[154,] 1.45048987 4.16373833
[155,] -3.09893168 1.45048987
[156,] -0.03753286 -3.09893168
[157,] 0.88902755 -0.03753286
[158,] 0.51427868 0.88902755
[159,] 1.21309638 0.51427868
[160,] -0.96157629 1.21309638
[161,] -0.09893168 -0.96157629
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.52631944 -2.48691631
2 2.23717792 0.52631944
3 3.19026303 2.23717792
4 -2.32428440 3.19026303
5 -1.91102325 -2.32428440
6 3.51308369 -1.91102325
7 -1.61223094 3.51308369
8 -1.62427170 -1.61223094
9 2.75167216 -1.62427170
10 1.25285684 2.75167216
11 -0.17369326 1.25285684
12 1.08902994 -0.17369326
13 0.80103022 1.08902994
14 -0.72430980 0.80103022
15 -0.46039161 -0.72430980
16 0.66492301 -0.46039161
17 4.10101752 0.66492301
18 3.10226570 4.10101752
19 0.23837291 3.10226570
20 0.55284414 0.23837291
21 0.92514985 0.55284414
22 2.95042637 0.92514985
23 1.35045177 2.95042637
24 2.81551415 1.35045177
25 1.63720332 2.81551415
26 1.39021223 1.63720332
27 -1.61223094 1.39021223
28 0.37572830 -1.61223094
29 0.07698917 0.37572830
30 -0.76162709 0.07698917
31 -1.07240698 -0.76162709
32 -0.77366786 -1.07240698
33 0.37572830 -0.77366786
34 -1.46039161 0.37572830
35 -5.92181584 -1.46039161
36 -1.39767081 -5.92181584
37 -1.59774700 -1.39767081
38 1.22633214 -1.59774700
39 1.80227840 1.22633214
40 1.52756762 1.80227840
41 -1.76162709 1.52756762
42 2.57692568 -1.76162709
43 -0.06036622 2.57692568
44 -0.08689092 -0.06036622
45 -4.07485015 -0.08689092
46 -2.18692901 -4.07485015
47 -0.06161439 -2.18692901
48 0.66367483 -0.06161439
49 -1.32303623 0.66367483
50 -0.88694171 -1.32303623
51 -0.33507699 -0.88694171
52 -3.04832545 -0.33507699
53 0.22513715 -3.04832545
54 -2.24707966 0.22513715
55 1.75167216 -2.24707966
56 0.23837291 1.75167216
57 0.37572830 0.23837291
58 0.37697647 0.37572830
59 1.91310908 0.37697647
60 0.17702727 1.91310908
61 0.67696377 0.17702727
62 -0.20016477 0.67696377
63 -0.92425900 -0.20016477
64 0.37572830 -0.92425900
65 1.52637263 0.37572830
66 1.79983523 1.52637263
67 3.37697647 1.79983523
68 -3.62427170 3.37697647
69 0.40225300 -3.62427170
70 -3.20976237 0.40225300
71 -1.19896978 -3.20976237
72 1.25041367 -1.19896978
73 1.27693838 1.25041367
74 0.67696377 1.27693838
75 3.47576639 0.67696377
76 -0.46163979 3.47576639
77 1.21309638 -0.46163979
78 -2.59774700 1.21309638
79 0.67696377 -2.59774700
80 0.40225300 0.67696377
81 4.26489761 0.40225300
82 0.37572830 4.26489761
83 -0.73510239 0.37572830
84 -0.06161439 -0.73510239
85 1.63839831 -0.06161439
86 0.09022493 1.63839831
87 0.51308369 0.09022493
88 0.65043907 0.51308369
89 0.47457140 0.65043907
90 -2.21101055 0.47457140
91 -0.03753286 -2.21101055
92 0.37572830 -0.03753286
93 -0.48691631 0.37572830
94 -2.34956093 -0.48691631
95 1.36368753 -2.34956093
96 0.22513715 1.36368753
97 2.20105562 0.22513715
98 0.12754222 2.20105562
99 -0.47243238 0.12754222
100 -1.02429710 -0.47243238
101 1.37697647 -1.02429710
102 2.55040098 1.37697647
103 0.51433186 2.55040098
104 0.93838561 0.51433186
105 -1.77361467 0.93838561
106 1.23837291 -1.77361467
107 0.40225300 1.23837291
108 1.65168725 0.40225300
109 -0.12420821 1.65168725
110 0.37572830 -0.12420821
111 -0.20016477 0.37572830
112 2.21309638 -0.20016477
113 -1.89773430 2.21309638
114 -2.91102325 -1.89773430
115 1.70224030 -2.91102325
116 -2.04957363 1.70224030
117 0.76371293 -2.04957363
118 -1.92425900 0.76371293
119 0.51308369 -1.92425900
120 -1.64954823 0.51308369
121 -0.04957363 -1.64954823
122 -2.62427170 -0.04957363
123 -0.74958633 -2.62427170
124 -1.18692901 -0.74958633
125 -1.03753286 -1.18692901
126 0.25285684 -1.03753286
127 1.66367483 0.25285684
128 0.51427868 1.66367483
129 -3.06161439 0.51427868
130 1.80227840 -3.06161439
131 -4.21095736 1.80227840
132 2.62635754 -4.21095736
133 -3.03508969 2.62635754
134 -1.59774700 -3.03508969
135 -0.76162709 -1.59774700
136 -0.36035352 -0.76162709
137 0.10226570 -0.36035352
138 -2.94953553 0.10226570
139 -1.37364246 -2.94953553
140 -5.63506429 -1.37364246
141 2.62635754 -5.63506429
142 0.95286954 2.62635754
143 -0.17488825 0.95286954
144 0.96491031 -0.17488825
145 -3.51099785 0.96491031
146 1.67571560 -3.51099785
147 -2.04832545 1.67571560
148 0.81431916 -2.04832545
149 -0.08564274 0.81431916
150 -2.94834054 -0.08564274
151 -0.91221824 -2.94834054
152 1.95286954 -0.91221824
153 4.16373833 1.95286954
154 1.45048987 4.16373833
155 -3.09893168 1.45048987
156 -0.03753286 -3.09893168
157 0.88902755 -0.03753286
158 0.51427868 0.88902755
159 1.21309638 0.51427868
160 -0.96157629 1.21309638
161 -0.09893168 -0.96157629
> 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/71tat1322180152.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/8ez2g1322180152.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/9euph1322180152.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/10vojh1322180152.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/11v9z71322180152.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/12sgwc1322180152.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/13ja0i1322180152.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/14jwok1322180152.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/15qze41322180152.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/16ygkd1322180153.tab")
+ }
>
> try(system("convert tmp/11fr91322180152.ps tmp/11fr91322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/220y21322180152.ps tmp/220y21322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/3l7qi1322180152.ps tmp/3l7qi1322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/4cigo1322180152.ps tmp/4cigo1322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/5k2dn1322180152.ps tmp/5k2dn1322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/6y8w61322180152.ps tmp/6y8w61322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/71tat1322180152.ps tmp/71tat1322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ez2g1322180152.ps tmp/8ez2g1322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/9euph1322180152.ps tmp/9euph1322180152.png",intern=TRUE))
character(0)
> try(system("convert tmp/10vojh1322180152.ps tmp/10vojh1322180152.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.041 0.615 5.689