R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(41
+ ,13
+ ,14
+ ,12
+ ,39
+ ,16
+ ,18
+ ,11
+ ,30
+ ,19
+ ,11
+ ,14
+ ,31
+ ,15
+ ,12
+ ,12
+ ,34
+ ,14
+ ,16
+ ,21
+ ,35
+ ,13
+ ,18
+ ,12
+ ,39
+ ,19
+ ,14
+ ,22
+ ,34
+ ,15
+ ,14
+ ,11
+ ,36
+ ,14
+ ,15
+ ,10
+ ,37
+ ,15
+ ,15
+ ,13
+ ,38
+ ,16
+ ,17
+ ,10
+ ,36
+ ,16
+ ,19
+ ,8
+ ,38
+ ,16
+ ,10
+ ,15
+ ,39
+ ,16
+ ,16
+ ,14
+ ,33
+ ,17
+ ,18
+ ,10
+ ,32
+ ,15
+ ,14
+ ,14
+ ,36
+ ,15
+ ,14
+ ,14
+ ,38
+ ,20
+ ,17
+ ,11
+ ,39
+ ,18
+ ,14
+ ,10
+ ,32
+ ,16
+ ,16
+ ,13
+ ,32
+ ,16
+ ,18
+ ,7
+ ,31
+ ,16
+ ,11
+ ,14
+ ,39
+ ,19
+ ,14
+ ,12
+ ,37
+ ,16
+ ,12
+ ,14
+ ,39
+ ,17
+ ,17
+ ,11
+ ,41
+ ,17
+ ,9
+ ,9
+ ,36
+ ,16
+ ,16
+ ,11
+ ,33
+ ,15
+ ,14
+ ,15
+ ,33
+ ,16
+ ,15
+ ,14
+ ,34
+ ,14
+ ,11
+ ,13
+ ,31
+ ,15
+ ,16
+ ,9
+ ,27
+ ,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16
+ ,13
+ ,9
+ ,32
+ ,12
+ ,12
+ ,18
+ ,34
+ ,13
+ ,13
+ ,16)
+ ,dim=c(4
+ ,162)
+ ,dimnames=list(c('Connected'
+ ,'Learning'
+ ,'Happiness'
+ ,'Depression')
+ ,1:162))
> y <- array(NA,dim=c(4,162),dimnames=list(c('Connected','Learning','Happiness','Depression'),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'
> 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
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Learning Connected Happiness Depression
1 13 41 14 12
2 16 39 18 11
3 19 30 11 14
4 15 31 12 12
5 14 34 16 21
6 13 35 18 12
7 19 39 14 22
8 15 34 14 11
9 14 36 15 10
10 15 37 15 13
11 16 38 17 10
12 16 36 19 8
13 16 38 10 15
14 16 39 16 14
15 17 33 18 10
16 15 32 14 14
17 15 36 14 14
18 20 38 17 11
19 18 39 14 10
20 16 32 16 13
21 16 32 18 7
22 16 31 11 14
23 19 39 14 12
24 16 37 12 14
25 17 39 17 11
26 17 41 9 9
27 16 36 16 11
28 15 33 14 15
29 16 33 15 14
30 14 34 11 13
31 15 31 16 9
32 12 27 13 15
33 14 37 17 10
34 16 34 15 11
35 14 34 14 13
36 7 32 16 8
37 10 29 9 20
38 14 36 15 12
39 16 29 17 10
40 16 35 13 10
41 16 37 15 9
42 14 34 16 14
43 20 38 16 8
44 14 35 12 14
45 14 38 12 11
46 11 37 11 13
47 14 38 15 9
48 15 33 15 11
49 16 36 17 15
50 14 38 13 11
51 16 32 16 10
52 14 32 14 14
53 12 32 11 18
54 16 34 12 14
55 9 32 12 11
56 14 37 15 12
57 16 39 16 13
58 16 29 15 9
59 15 37 12 10
60 16 35 12 15
61 12 30 8 20
62 16 38 13 12
63 16 34 11 12
64 14 31 14 14
65 16 34 15 13
66 17 35 10 11
67 18 36 11 17
68 18 30 12 12
69 12 39 15 13
70 16 35 15 14
71 10 38 14 13
72 14 31 16 15
73 18 34 15 13
74 18 38 15 10
75 16 34 13 11
76 17 39 12 19
77 16 37 17 13
78 16 34 13 17
79 13 28 15 13
80 16 37 13 9
81 16 33 15 11
82 20 37 16 10
83 16 35 15 9
84 15 37 16 12
85 15 32 15 12
86 16 33 14 13
87 14 38 15 13
88 16 33 14 12
89 16 29 13 15
90 15 33 7 22
91 12 31 17 13
92 17 36 13 15
93 16 35 15 13
94 15 32 14 15
95 13 29 13 10
96 16 39 16 11
97 16 37 12 16
98 16 35 14 11
99 16 37 17 11
100 14 32 15 10
101 16 38 17 10
102 16 37 12 16
103 20 36 16 12
104 15 32 11 11
105 16 33 15 16
106 13 40 9 19
107 17 38 16 11
108 16 41 15 16
109 16 36 10 15
110 12 43 10 24
111 16 30 15 14
112 16 31 11 15
113 17 32 13 11
114 13 32 14 15
115 12 37 18 12
116 18 37 16 10
117 14 33 14 14
118 14 34 14 13
119 13 33 14 9
120 16 38 14 15
121 13 33 12 15
122 16 31 14 14
123 13 38 15 11
124 16 37 15 8
125 15 33 15 11
126 16 31 13 11
127 15 39 17 8
128 17 44 17 10
129 15 33 19 11
130 12 35 15 13
131 16 32 13 11
132 10 28 9 20
133 16 40 15 10
134 12 27 15 15
135 14 37 15 12
136 15 32 16 14
137 13 28 11 23
138 15 34 14 14
139 11 30 11 16
140 12 35 15 11
141 8 31 13 12
142 16 32 15 10
143 15 30 16 14
144 17 30 14 12
145 16 31 15 12
146 10 40 16 11
147 18 32 16 12
148 13 36 11 13
149 16 32 12 11
150 13 35 9 19
151 10 38 16 12
152 15 42 13 17
153 16 34 16 9
154 16 35 12 12
155 14 35 9 19
156 10 33 13 18
157 17 36 13 15
158 13 32 14 14
159 15 33 19 11
160 16 34 13 9
161 12 32 12 18
162 13 34 13 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Connected Happiness Depression
11.52815 0.12283 0.05766 -0.12692
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.3659 -1.2898 0.3314 1.2338 4.9295
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 11.52815 2.49683 4.617 8.01e-06 ***
Connected 0.12283 0.05128 2.395 0.0178 *
Happiness 0.05766 0.08761 0.658 0.5115
Depression -0.12692 0.06449 -1.968 0.0508 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.171 on 158 degrees of freedom
Multiple R-squared: 0.09163, Adjusted R-squared: 0.07439
F-statistic: 5.313 on 3 and 158 DF, p-value: 0.001628
> 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.86791022 0.26417957 0.13208978
[2,] 0.76874721 0.46250558 0.23125279
[3,] 0.65776363 0.68447274 0.34223637
[4,] 0.53381144 0.93237713 0.46618856
[5,] 0.52720608 0.94558785 0.47279392
[6,] 0.53704559 0.92590882 0.46295441
[7,] 0.43753238 0.87506475 0.56246762
[8,] 0.35211289 0.70422577 0.64788711
[9,] 0.33603590 0.67207180 0.66396410
[10,] 0.27676084 0.55352168 0.72323916
[11,] 0.21414398 0.42828795 0.78585602
[12,] 0.51543633 0.96912735 0.48456367
[13,] 0.51798240 0.96403520 0.48201760
[14,] 0.44500217 0.89000434 0.55499783
[15,] 0.37476471 0.74952942 0.62523529
[16,] 0.31163925 0.62327850 0.68836075
[17,] 0.36979639 0.73959277 0.63020361
[18,] 0.30932392 0.61864784 0.69067608
[19,] 0.26175391 0.52350781 0.73824609
[20,] 0.21078296 0.42156593 0.78921704
[21,] 0.16566047 0.33132094 0.83433953
[22,] 0.13395989 0.26791979 0.86604011
[23,] 0.10369576 0.20739152 0.89630424
[24,] 0.10305148 0.20610295 0.89694852
[25,] 0.07822859 0.15645719 0.92177141
[26,] 0.09722224 0.19444449 0.90277776
[27,] 0.09650366 0.19300733 0.90349634
[28,] 0.07433483 0.14866967 0.92566517
[29,] 0.06531929 0.13063859 0.93468071
[30,] 0.64628291 0.70743417 0.35371709
[31,] 0.76136865 0.47726270 0.23863135
[32,] 0.73794933 0.52410133 0.26205067
[33,] 0.73076646 0.53846708 0.26923354
[34,] 0.68941732 0.62116536 0.31058268
[35,] 0.64099220 0.71801560 0.35900780
[36,] 0.60238990 0.79522020 0.39761010
[37,] 0.69927245 0.60145511 0.30072755
[38,] 0.66568632 0.66862735 0.33431368
[39,] 0.65380663 0.69238675 0.34619337
[40,] 0.77541827 0.44916346 0.22458173
[41,] 0.76711400 0.46577200 0.23288600
[42,] 0.72709578 0.54580844 0.27290422
[43,] 0.68962352 0.62075296 0.31037648
[44,] 0.66964767 0.66070465 0.33035233
[45,] 0.63580663 0.72838675 0.36419337
[46,] 0.59086603 0.81826795 0.40913397
[47,] 0.57918904 0.84162191 0.42081096
[48,] 0.55070954 0.89858091 0.44929046
[49,] 0.77443420 0.45113161 0.22556580
[50,] 0.75597313 0.48805373 0.24402687
[51,] 0.71968209 0.56063581 0.28031791
[52,] 0.70673829 0.58652342 0.29326171
[53,] 0.66764506 0.66470989 0.33235494
[54,] 0.64029529 0.71940942 0.35970471
[55,] 0.60652302 0.78695397 0.39347698
[56,] 0.56281692 0.87436616 0.43718308
[57,] 0.53610319 0.92779363 0.46389681
[58,] 0.49011697 0.98023394 0.50988303
[59,] 0.45461199 0.90922397 0.54538801
[60,] 0.45375798 0.90751596 0.54624202
[61,] 0.51855904 0.96288191 0.48144096
[62,] 0.60996583 0.78006835 0.39003417
[63,] 0.68954295 0.62091409 0.31045705
[64,] 0.65729463 0.68541074 0.34270537
[65,] 0.83979434 0.32041131 0.16020566
[66,] 0.81123979 0.37752042 0.18876021
[67,] 0.83942688 0.32114624 0.16057312
[68,] 0.83915631 0.32168737 0.16084369
[69,] 0.81505400 0.36989199 0.18494600
[70,] 0.82061022 0.35877956 0.17938978
[71,] 0.79299292 0.41401415 0.20700708
[72,] 0.78085258 0.43829483 0.21914742
[73,] 0.75552322 0.48895356 0.24447678
[74,] 0.71898873 0.56202255 0.28101127
[75,] 0.68715375 0.62569250 0.31284625
[76,] 0.79520952 0.40958095 0.20479048
[77,] 0.76279277 0.47441445 0.23720723
[78,] 0.72863737 0.54272526 0.27136263
[79,] 0.68980851 0.62038297 0.31019149
[80,] 0.66313532 0.67372935 0.33686468
[81,] 0.63892250 0.72215499 0.36107750
[82,] 0.60759819 0.78480361 0.39240181
[83,] 0.60344788 0.79310424 0.39655212
[84,] 0.59200980 0.81598039 0.40799020
[85,] 0.61134884 0.77730232 0.38865116
[86,] 0.61871730 0.76256541 0.38128270
[87,] 0.58539239 0.82921522 0.41460761
[88,] 0.54597543 0.90804914 0.45402457
[89,] 0.52605660 0.94788680 0.47394340
[90,] 0.48193025 0.96386051 0.51806975
[91,] 0.46033600 0.92067201 0.53966400
[92,] 0.42111415 0.84222829 0.57888585
[93,] 0.37935974 0.75871949 0.62064026
[94,] 0.34558594 0.69117188 0.65441406
[95,] 0.30461566 0.60923132 0.69538434
[96,] 0.28792174 0.57584348 0.71207826
[97,] 0.47612871 0.95225743 0.52387129
[98,] 0.42956106 0.85912212 0.57043894
[99,] 0.42541775 0.85083549 0.57458225
[100,] 0.40409300 0.80818600 0.59590700
[101,] 0.38875766 0.77751532 0.61124234
[102,] 0.38286724 0.76573448 0.61713276
[103,] 0.36689199 0.73378398 0.63310801
[104,] 0.36928567 0.73857135 0.63071433
[105,] 0.35838188 0.71676376 0.64161812
[106,] 0.35564615 0.71129230 0.64435385
[107,] 0.35805927 0.71611853 0.64194073
[108,] 0.32369474 0.64738947 0.67630526
[109,] 0.36992392 0.73984784 0.63007608
[110,] 0.39967791 0.79935581 0.60032209
[111,] 0.35350409 0.70700818 0.64649591
[112,] 0.31035758 0.62071516 0.68964242
[113,] 0.31127214 0.62254428 0.68872786
[114,] 0.30804155 0.61608310 0.69195845
[115,] 0.27220456 0.54440911 0.72779544
[116,] 0.26416219 0.52832437 0.73583781
[117,] 0.25933276 0.51866553 0.74066724
[118,] 0.21832376 0.43664753 0.78167624
[119,] 0.18082356 0.36164713 0.81917644
[120,] 0.15875251 0.31750502 0.84124749
[121,] 0.13147996 0.26295993 0.86852004
[122,] 0.12261878 0.24523755 0.87738122
[123,] 0.09733632 0.19467264 0.90266368
[124,] 0.09971802 0.19943605 0.90028198
[125,] 0.08414011 0.16828023 0.91585989
[126,] 0.09415904 0.18831807 0.90584096
[127,] 0.08057257 0.16114513 0.91942743
[128,] 0.07805335 0.15610669 0.92194665
[129,] 0.06005521 0.12011043 0.93994479
[130,] 0.04592691 0.09185383 0.95407309
[131,] 0.03324500 0.06649001 0.96675500
[132,] 0.02529511 0.05059021 0.97470489
[133,] 0.03153976 0.06307951 0.96846024
[134,] 0.03338162 0.06676325 0.96661838
[135,] 0.40472414 0.80944828 0.59527586
[136,] 0.33709731 0.67419463 0.66290269
[137,] 0.27336423 0.54672845 0.72663577
[138,] 0.23871999 0.47743999 0.76128001
[139,] 0.19235065 0.38470129 0.80764935
[140,] 0.36545579 0.73091159 0.63454421
[141,] 0.54284184 0.91431631 0.45715816
[142,] 0.57047075 0.85905851 0.42952925
[143,] 0.47559090 0.95118181 0.52440910
[144,] 0.38085537 0.76171073 0.61914463
[145,] 0.91196792 0.17606416 0.08803208
[146,] 0.95959264 0.08081472 0.04040736
[147,] 0.91582294 0.16835412 0.08417706
[148,] 0.83463850 0.33072300 0.16536150
[149,] 0.70595317 0.58809365 0.29404683
> postscript(file="/var/wessaorg/rcomp/tmp/19hgw1355136857.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/29yyk1355136857.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/390xa1355136857.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/4rds51355136857.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/5or5j1355136857.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.84846075 0.03966582 4.92949667 0.49517549 0.03830529 -2.34208747
7 8 9 10 11 12
4.66637018 -0.11554963 -1.54578675 -0.28786952 0.09323724 -0.03024183
13 14 15 16 17 18
1.13140850 0.53572653 1.64974441 0.51086519 0.01953507 4.22015382
19 20 21 22 23 24
2.14337113 1.26863765 0.39182718 1.80666414 3.39720431 1.01201349
25 26 27 28 29 30
1.09732130 1.05906686 0.52347436 0.51494925 1.33037719 -0.68875003
31 32 33 34 35 36
-0.11619617 -1.69040010 -1.78393023 0.82679489 -0.86171646 -8.36594529
37 38 39 40 41 42
-3.07086032 -1.29195358 1.19873000 0.69235673 0.20446413 -0.85011082
43 44 45 46 47 48
3.89705954 -0.74232145 -1.49156880 -4.05724762 -1.91836840 -0.05037258
49 50 51 52 53 54
0.97348523 -1.54922428 0.88788789 -0.48913481 -1.80850203 1.38051108
55 56 57 58 59 60
-5.75457362 -1.41478611 0.40880995 1.18712437 -0.49565286 1.38459514
61 62 63 64 65 66
-1.13603738 0.57769231 1.18433338 -0.36630228 1.08062807 1.99223974
67 68 69 70 71 72
3.57325126 3.61800802 -3.53353458 1.08471213 -5.35304658 -0.35469664
73 74 75 76 77 78
3.08062807 2.20854819 0.94210584 2.40093137 0.59681953 1.70360537
79 80 81 82 83 84
-1.18237675 0.31977508 0.94962742 4.27372524 0.45012919 -0.47244158
85 86 87 88 89 90
0.19937654 1.26111607 -1.41070205 1.13419949 2.06393484 1.80695369
91 92 93 94 95 96
-2.66618529 2.20410713 0.95779554 0.63778178 -1.57064810 0.15497677
97 98 99 100 101 102
1.26584667 0.76161784 0.34298635 -1.05445664 0.09323724 1.26584667
103 104 105 106 107 108
4.65039095 0.30308185 1.58421036 -1.54893473 1.27780930 0.60155012
109 110 111 112 113 114
1.37707356 -2.34050486 1.69887477 1.93358073 2.18777090 -1.36221822
115 116 117 118 119 120
-3.58775253 2.27372524 -0.61196734 -0.86171646 -2.24655028 0.90078660
121 122 123 124 125 126
-1.36973980 1.63369772 -2.66453523 0.07754754 -0.05037258 1.31060343
127 128 129 130 131 132
-1.28342847 0.35624206 -0.28099448 -3.04220446 1.18777090 -2.94802779
133 134 135 136 137 138
-0.03711687 -1.80571105 -1.41478611 0.39555424 0.31741102 0.26520013
139 140 141 142 143 144
-2.81667015 -3.29603764 -6.56247998 0.94554336 0.64121930 2.50269707
145 146 147 148 149 150
1.32220907 -5.96785576 3.14172106 -1.93441509 1.24542638 -0.93477209
151 152 153 154 155 156
-5.59527411 -0.27905487 0.51530624 1.00384538 0.06522791 -4.04664551
157 158 159 160 161 162
2.20410713 -1.48913481 -0.28099448 0.68827267 -1.86615751 -1.42331122
> postscript(file="/var/wessaorg/rcomp/tmp/66g031355136857.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.84846075 NA
1 0.03966582 -2.84846075
2 4.92949667 0.03966582
3 0.49517549 4.92949667
4 0.03830529 0.49517549
5 -2.34208747 0.03830529
6 4.66637018 -2.34208747
7 -0.11554963 4.66637018
8 -1.54578675 -0.11554963
9 -0.28786952 -1.54578675
10 0.09323724 -0.28786952
11 -0.03024183 0.09323724
12 1.13140850 -0.03024183
13 0.53572653 1.13140850
14 1.64974441 0.53572653
15 0.51086519 1.64974441
16 0.01953507 0.51086519
17 4.22015382 0.01953507
18 2.14337113 4.22015382
19 1.26863765 2.14337113
20 0.39182718 1.26863765
21 1.80666414 0.39182718
22 3.39720431 1.80666414
23 1.01201349 3.39720431
24 1.09732130 1.01201349
25 1.05906686 1.09732130
26 0.52347436 1.05906686
27 0.51494925 0.52347436
28 1.33037719 0.51494925
29 -0.68875003 1.33037719
30 -0.11619617 -0.68875003
31 -1.69040010 -0.11619617
32 -1.78393023 -1.69040010
33 0.82679489 -1.78393023
34 -0.86171646 0.82679489
35 -8.36594529 -0.86171646
36 -3.07086032 -8.36594529
37 -1.29195358 -3.07086032
38 1.19873000 -1.29195358
39 0.69235673 1.19873000
40 0.20446413 0.69235673
41 -0.85011082 0.20446413
42 3.89705954 -0.85011082
43 -0.74232145 3.89705954
44 -1.49156880 -0.74232145
45 -4.05724762 -1.49156880
46 -1.91836840 -4.05724762
47 -0.05037258 -1.91836840
48 0.97348523 -0.05037258
49 -1.54922428 0.97348523
50 0.88788789 -1.54922428
51 -0.48913481 0.88788789
52 -1.80850203 -0.48913481
53 1.38051108 -1.80850203
54 -5.75457362 1.38051108
55 -1.41478611 -5.75457362
56 0.40880995 -1.41478611
57 1.18712437 0.40880995
58 -0.49565286 1.18712437
59 1.38459514 -0.49565286
60 -1.13603738 1.38459514
61 0.57769231 -1.13603738
62 1.18433338 0.57769231
63 -0.36630228 1.18433338
64 1.08062807 -0.36630228
65 1.99223974 1.08062807
66 3.57325126 1.99223974
67 3.61800802 3.57325126
68 -3.53353458 3.61800802
69 1.08471213 -3.53353458
70 -5.35304658 1.08471213
71 -0.35469664 -5.35304658
72 3.08062807 -0.35469664
73 2.20854819 3.08062807
74 0.94210584 2.20854819
75 2.40093137 0.94210584
76 0.59681953 2.40093137
77 1.70360537 0.59681953
78 -1.18237675 1.70360537
79 0.31977508 -1.18237675
80 0.94962742 0.31977508
81 4.27372524 0.94962742
82 0.45012919 4.27372524
83 -0.47244158 0.45012919
84 0.19937654 -0.47244158
85 1.26111607 0.19937654
86 -1.41070205 1.26111607
87 1.13419949 -1.41070205
88 2.06393484 1.13419949
89 1.80695369 2.06393484
90 -2.66618529 1.80695369
91 2.20410713 -2.66618529
92 0.95779554 2.20410713
93 0.63778178 0.95779554
94 -1.57064810 0.63778178
95 0.15497677 -1.57064810
96 1.26584667 0.15497677
97 0.76161784 1.26584667
98 0.34298635 0.76161784
99 -1.05445664 0.34298635
100 0.09323724 -1.05445664
101 1.26584667 0.09323724
102 4.65039095 1.26584667
103 0.30308185 4.65039095
104 1.58421036 0.30308185
105 -1.54893473 1.58421036
106 1.27780930 -1.54893473
107 0.60155012 1.27780930
108 1.37707356 0.60155012
109 -2.34050486 1.37707356
110 1.69887477 -2.34050486
111 1.93358073 1.69887477
112 2.18777090 1.93358073
113 -1.36221822 2.18777090
114 -3.58775253 -1.36221822
115 2.27372524 -3.58775253
116 -0.61196734 2.27372524
117 -0.86171646 -0.61196734
118 -2.24655028 -0.86171646
119 0.90078660 -2.24655028
120 -1.36973980 0.90078660
121 1.63369772 -1.36973980
122 -2.66453523 1.63369772
123 0.07754754 -2.66453523
124 -0.05037258 0.07754754
125 1.31060343 -0.05037258
126 -1.28342847 1.31060343
127 0.35624206 -1.28342847
128 -0.28099448 0.35624206
129 -3.04220446 -0.28099448
130 1.18777090 -3.04220446
131 -2.94802779 1.18777090
132 -0.03711687 -2.94802779
133 -1.80571105 -0.03711687
134 -1.41478611 -1.80571105
135 0.39555424 -1.41478611
136 0.31741102 0.39555424
137 0.26520013 0.31741102
138 -2.81667015 0.26520013
139 -3.29603764 -2.81667015
140 -6.56247998 -3.29603764
141 0.94554336 -6.56247998
142 0.64121930 0.94554336
143 2.50269707 0.64121930
144 1.32220907 2.50269707
145 -5.96785576 1.32220907
146 3.14172106 -5.96785576
147 -1.93441509 3.14172106
148 1.24542638 -1.93441509
149 -0.93477209 1.24542638
150 -5.59527411 -0.93477209
151 -0.27905487 -5.59527411
152 0.51530624 -0.27905487
153 1.00384538 0.51530624
154 0.06522791 1.00384538
155 -4.04664551 0.06522791
156 2.20410713 -4.04664551
157 -1.48913481 2.20410713
158 -0.28099448 -1.48913481
159 0.68827267 -0.28099448
160 -1.86615751 0.68827267
161 -1.42331122 -1.86615751
162 NA -1.42331122
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.03966582 -2.84846075
[2,] 4.92949667 0.03966582
[3,] 0.49517549 4.92949667
[4,] 0.03830529 0.49517549
[5,] -2.34208747 0.03830529
[6,] 4.66637018 -2.34208747
[7,] -0.11554963 4.66637018
[8,] -1.54578675 -0.11554963
[9,] -0.28786952 -1.54578675
[10,] 0.09323724 -0.28786952
[11,] -0.03024183 0.09323724
[12,] 1.13140850 -0.03024183
[13,] 0.53572653 1.13140850
[14,] 1.64974441 0.53572653
[15,] 0.51086519 1.64974441
[16,] 0.01953507 0.51086519
[17,] 4.22015382 0.01953507
[18,] 2.14337113 4.22015382
[19,] 1.26863765 2.14337113
[20,] 0.39182718 1.26863765
[21,] 1.80666414 0.39182718
[22,] 3.39720431 1.80666414
[23,] 1.01201349 3.39720431
[24,] 1.09732130 1.01201349
[25,] 1.05906686 1.09732130
[26,] 0.52347436 1.05906686
[27,] 0.51494925 0.52347436
[28,] 1.33037719 0.51494925
[29,] -0.68875003 1.33037719
[30,] -0.11619617 -0.68875003
[31,] -1.69040010 -0.11619617
[32,] -1.78393023 -1.69040010
[33,] 0.82679489 -1.78393023
[34,] -0.86171646 0.82679489
[35,] -8.36594529 -0.86171646
[36,] -3.07086032 -8.36594529
[37,] -1.29195358 -3.07086032
[38,] 1.19873000 -1.29195358
[39,] 0.69235673 1.19873000
[40,] 0.20446413 0.69235673
[41,] -0.85011082 0.20446413
[42,] 3.89705954 -0.85011082
[43,] -0.74232145 3.89705954
[44,] -1.49156880 -0.74232145
[45,] -4.05724762 -1.49156880
[46,] -1.91836840 -4.05724762
[47,] -0.05037258 -1.91836840
[48,] 0.97348523 -0.05037258
[49,] -1.54922428 0.97348523
[50,] 0.88788789 -1.54922428
[51,] -0.48913481 0.88788789
[52,] -1.80850203 -0.48913481
[53,] 1.38051108 -1.80850203
[54,] -5.75457362 1.38051108
[55,] -1.41478611 -5.75457362
[56,] 0.40880995 -1.41478611
[57,] 1.18712437 0.40880995
[58,] -0.49565286 1.18712437
[59,] 1.38459514 -0.49565286
[60,] -1.13603738 1.38459514
[61,] 0.57769231 -1.13603738
[62,] 1.18433338 0.57769231
[63,] -0.36630228 1.18433338
[64,] 1.08062807 -0.36630228
[65,] 1.99223974 1.08062807
[66,] 3.57325126 1.99223974
[67,] 3.61800802 3.57325126
[68,] -3.53353458 3.61800802
[69,] 1.08471213 -3.53353458
[70,] -5.35304658 1.08471213
[71,] -0.35469664 -5.35304658
[72,] 3.08062807 -0.35469664
[73,] 2.20854819 3.08062807
[74,] 0.94210584 2.20854819
[75,] 2.40093137 0.94210584
[76,] 0.59681953 2.40093137
[77,] 1.70360537 0.59681953
[78,] -1.18237675 1.70360537
[79,] 0.31977508 -1.18237675
[80,] 0.94962742 0.31977508
[81,] 4.27372524 0.94962742
[82,] 0.45012919 4.27372524
[83,] -0.47244158 0.45012919
[84,] 0.19937654 -0.47244158
[85,] 1.26111607 0.19937654
[86,] -1.41070205 1.26111607
[87,] 1.13419949 -1.41070205
[88,] 2.06393484 1.13419949
[89,] 1.80695369 2.06393484
[90,] -2.66618529 1.80695369
[91,] 2.20410713 -2.66618529
[92,] 0.95779554 2.20410713
[93,] 0.63778178 0.95779554
[94,] -1.57064810 0.63778178
[95,] 0.15497677 -1.57064810
[96,] 1.26584667 0.15497677
[97,] 0.76161784 1.26584667
[98,] 0.34298635 0.76161784
[99,] -1.05445664 0.34298635
[100,] 0.09323724 -1.05445664
[101,] 1.26584667 0.09323724
[102,] 4.65039095 1.26584667
[103,] 0.30308185 4.65039095
[104,] 1.58421036 0.30308185
[105,] -1.54893473 1.58421036
[106,] 1.27780930 -1.54893473
[107,] 0.60155012 1.27780930
[108,] 1.37707356 0.60155012
[109,] -2.34050486 1.37707356
[110,] 1.69887477 -2.34050486
[111,] 1.93358073 1.69887477
[112,] 2.18777090 1.93358073
[113,] -1.36221822 2.18777090
[114,] -3.58775253 -1.36221822
[115,] 2.27372524 -3.58775253
[116,] -0.61196734 2.27372524
[117,] -0.86171646 -0.61196734
[118,] -2.24655028 -0.86171646
[119,] 0.90078660 -2.24655028
[120,] -1.36973980 0.90078660
[121,] 1.63369772 -1.36973980
[122,] -2.66453523 1.63369772
[123,] 0.07754754 -2.66453523
[124,] -0.05037258 0.07754754
[125,] 1.31060343 -0.05037258
[126,] -1.28342847 1.31060343
[127,] 0.35624206 -1.28342847
[128,] -0.28099448 0.35624206
[129,] -3.04220446 -0.28099448
[130,] 1.18777090 -3.04220446
[131,] -2.94802779 1.18777090
[132,] -0.03711687 -2.94802779
[133,] -1.80571105 -0.03711687
[134,] -1.41478611 -1.80571105
[135,] 0.39555424 -1.41478611
[136,] 0.31741102 0.39555424
[137,] 0.26520013 0.31741102
[138,] -2.81667015 0.26520013
[139,] -3.29603764 -2.81667015
[140,] -6.56247998 -3.29603764
[141,] 0.94554336 -6.56247998
[142,] 0.64121930 0.94554336
[143,] 2.50269707 0.64121930
[144,] 1.32220907 2.50269707
[145,] -5.96785576 1.32220907
[146,] 3.14172106 -5.96785576
[147,] -1.93441509 3.14172106
[148,] 1.24542638 -1.93441509
[149,] -0.93477209 1.24542638
[150,] -5.59527411 -0.93477209
[151,] -0.27905487 -5.59527411
[152,] 0.51530624 -0.27905487
[153,] 1.00384538 0.51530624
[154,] 0.06522791 1.00384538
[155,] -4.04664551 0.06522791
[156,] 2.20410713 -4.04664551
[157,] -1.48913481 2.20410713
[158,] -0.28099448 -1.48913481
[159,] 0.68827267 -0.28099448
[160,] -1.86615751 0.68827267
[161,] -1.42331122 -1.86615751
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.03966582 -2.84846075
2 4.92949667 0.03966582
3 0.49517549 4.92949667
4 0.03830529 0.49517549
5 -2.34208747 0.03830529
6 4.66637018 -2.34208747
7 -0.11554963 4.66637018
8 -1.54578675 -0.11554963
9 -0.28786952 -1.54578675
10 0.09323724 -0.28786952
11 -0.03024183 0.09323724
12 1.13140850 -0.03024183
13 0.53572653 1.13140850
14 1.64974441 0.53572653
15 0.51086519 1.64974441
16 0.01953507 0.51086519
17 4.22015382 0.01953507
18 2.14337113 4.22015382
19 1.26863765 2.14337113
20 0.39182718 1.26863765
21 1.80666414 0.39182718
22 3.39720431 1.80666414
23 1.01201349 3.39720431
24 1.09732130 1.01201349
25 1.05906686 1.09732130
26 0.52347436 1.05906686
27 0.51494925 0.52347436
28 1.33037719 0.51494925
29 -0.68875003 1.33037719
30 -0.11619617 -0.68875003
31 -1.69040010 -0.11619617
32 -1.78393023 -1.69040010
33 0.82679489 -1.78393023
34 -0.86171646 0.82679489
35 -8.36594529 -0.86171646
36 -3.07086032 -8.36594529
37 -1.29195358 -3.07086032
38 1.19873000 -1.29195358
39 0.69235673 1.19873000
40 0.20446413 0.69235673
41 -0.85011082 0.20446413
42 3.89705954 -0.85011082
43 -0.74232145 3.89705954
44 -1.49156880 -0.74232145
45 -4.05724762 -1.49156880
46 -1.91836840 -4.05724762
47 -0.05037258 -1.91836840
48 0.97348523 -0.05037258
49 -1.54922428 0.97348523
50 0.88788789 -1.54922428
51 -0.48913481 0.88788789
52 -1.80850203 -0.48913481
53 1.38051108 -1.80850203
54 -5.75457362 1.38051108
55 -1.41478611 -5.75457362
56 0.40880995 -1.41478611
57 1.18712437 0.40880995
58 -0.49565286 1.18712437
59 1.38459514 -0.49565286
60 -1.13603738 1.38459514
61 0.57769231 -1.13603738
62 1.18433338 0.57769231
63 -0.36630228 1.18433338
64 1.08062807 -0.36630228
65 1.99223974 1.08062807
66 3.57325126 1.99223974
67 3.61800802 3.57325126
68 -3.53353458 3.61800802
69 1.08471213 -3.53353458
70 -5.35304658 1.08471213
71 -0.35469664 -5.35304658
72 3.08062807 -0.35469664
73 2.20854819 3.08062807
74 0.94210584 2.20854819
75 2.40093137 0.94210584
76 0.59681953 2.40093137
77 1.70360537 0.59681953
78 -1.18237675 1.70360537
79 0.31977508 -1.18237675
80 0.94962742 0.31977508
81 4.27372524 0.94962742
82 0.45012919 4.27372524
83 -0.47244158 0.45012919
84 0.19937654 -0.47244158
85 1.26111607 0.19937654
86 -1.41070205 1.26111607
87 1.13419949 -1.41070205
88 2.06393484 1.13419949
89 1.80695369 2.06393484
90 -2.66618529 1.80695369
91 2.20410713 -2.66618529
92 0.95779554 2.20410713
93 0.63778178 0.95779554
94 -1.57064810 0.63778178
95 0.15497677 -1.57064810
96 1.26584667 0.15497677
97 0.76161784 1.26584667
98 0.34298635 0.76161784
99 -1.05445664 0.34298635
100 0.09323724 -1.05445664
101 1.26584667 0.09323724
102 4.65039095 1.26584667
103 0.30308185 4.65039095
104 1.58421036 0.30308185
105 -1.54893473 1.58421036
106 1.27780930 -1.54893473
107 0.60155012 1.27780930
108 1.37707356 0.60155012
109 -2.34050486 1.37707356
110 1.69887477 -2.34050486
111 1.93358073 1.69887477
112 2.18777090 1.93358073
113 -1.36221822 2.18777090
114 -3.58775253 -1.36221822
115 2.27372524 -3.58775253
116 -0.61196734 2.27372524
117 -0.86171646 -0.61196734
118 -2.24655028 -0.86171646
119 0.90078660 -2.24655028
120 -1.36973980 0.90078660
121 1.63369772 -1.36973980
122 -2.66453523 1.63369772
123 0.07754754 -2.66453523
124 -0.05037258 0.07754754
125 1.31060343 -0.05037258
126 -1.28342847 1.31060343
127 0.35624206 -1.28342847
128 -0.28099448 0.35624206
129 -3.04220446 -0.28099448
130 1.18777090 -3.04220446
131 -2.94802779 1.18777090
132 -0.03711687 -2.94802779
133 -1.80571105 -0.03711687
134 -1.41478611 -1.80571105
135 0.39555424 -1.41478611
136 0.31741102 0.39555424
137 0.26520013 0.31741102
138 -2.81667015 0.26520013
139 -3.29603764 -2.81667015
140 -6.56247998 -3.29603764
141 0.94554336 -6.56247998
142 0.64121930 0.94554336
143 2.50269707 0.64121930
144 1.32220907 2.50269707
145 -5.96785576 1.32220907
146 3.14172106 -5.96785576
147 -1.93441509 3.14172106
148 1.24542638 -1.93441509
149 -0.93477209 1.24542638
150 -5.59527411 -0.93477209
151 -0.27905487 -5.59527411
152 0.51530624 -0.27905487
153 1.00384538 0.51530624
154 0.06522791 1.00384538
155 -4.04664551 0.06522791
156 2.20410713 -4.04664551
157 -1.48913481 2.20410713
158 -0.28099448 -1.48913481
159 0.68827267 -0.28099448
160 -1.86615751 0.68827267
161 -1.42331122 -1.86615751
> 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/7q7wb1355136857.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/8r6rv1355136857.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/9nsvh1355136857.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/10lcpu1355136857.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/11x7u11355136857.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/12vm851355136857.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/13rdr51355136857.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/14x1o51355136857.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/15ucgg1355136857.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/16vzs81355136857.tab")
+ }
>
> try(system("convert tmp/19hgw1355136857.ps tmp/19hgw1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/29yyk1355136857.ps tmp/29yyk1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/390xa1355136857.ps tmp/390xa1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rds51355136857.ps tmp/4rds51355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/5or5j1355136857.ps tmp/5or5j1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/66g031355136857.ps tmp/66g031355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/7q7wb1355136857.ps tmp/7q7wb1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/8r6rv1355136857.ps tmp/8r6rv1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/9nsvh1355136857.ps tmp/9nsvh1355136857.png",intern=TRUE))
character(0)
> try(system("convert tmp/10lcpu1355136857.ps tmp/10lcpu1355136857.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.749 0.919 8.711