R version 2.12.0 (2010-10-15)
Copyright (C) 2010 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
+ ,41
+ ,38
+ ,14
+ ,12
+ ,16
+ ,39
+ ,32
+ ,18
+ ,11
+ ,19
+ ,30
+ ,35
+ ,11
+ ,14
+ ,15
+ ,31
+ ,33
+ ,12
+ ,12
+ ,14
+ ,34
+ ,37
+ ,16
+ ,21
+ ,13
+ ,35
+ ,29
+ ,18
+ ,12
+ ,19
+ ,39
+ ,31
+ ,14
+ ,22
+ ,15
+ ,34
+ ,36
+ ,14
+ ,11
+ ,14
+ ,36
+ ,35
+ ,15
+ ,10
+ ,15
+ ,37
+ ,38
+ ,15
+ ,13
+ ,16
+ ,38
+ ,31
+ ,17
+ ,10
+ ,16
+ ,36
+ ,34
+ ,19
+ ,8
+ ,16
+ ,38
+ ,35
+ ,10
+ ,15
+ ,16
+ ,39
+ ,38
+ ,16
+ ,14
+ ,17
+ ,33
+ ,37
+ ,18
+ ,10
+ ,15
+ ,32
+ ,33
+ ,14
+ ,14
+ ,15
+ ,36
+ ,32
+ ,14
+ ,14
+ ,20
+ ,38
+ ,38
+ ,17
+ ,11
+ ,18
+ ,39
+ ,38
+ ,14
+ ,10
+ ,16
+ ,32
+ ,32
+ ,16
+ ,13
+ ,16
+ ,32
+ ,33
+ ,18
+ ,7
+ ,16
+ ,31
+ ,31
+ ,11
+ ,14
+ ,19
+ ,39
+ ,38
+ ,14
+ ,12
+ ,16
+ ,37
+ ,39
+ ,12
+ ,14
+ ,17
+ ,39
+ ,32
+ ,17
+ ,11
+ ,17
+ ,41
+ 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+ ,dim=c(5
+ ,162)
+ ,dimnames=list(c('Learning'
+ ,'Connected'
+ ,'Separate'
+ ,'Happiness'
+ ,'Depression
')
+ ,1:162))
> y <- array(NA,dim=c(5,162),dimnames=list(c('Learning','Connected','Separate','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 = '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 Connected Separate Happiness Depression\r
1 13 41 38 14 12
2 16 39 32 18 11
3 19 30 35 11 14
4 15 31 33 12 12
5 14 34 37 16 21
6 13 35 29 18 12
7 19 39 31 14 22
8 15 34 36 14 11
9 14 36 35 15 10
10 15 37 38 15 13
11 16 38 31 17 10
12 16 36 34 19 8
13 16 38 35 10 15
14 16 39 38 16 14
15 17 33 37 18 10
16 15 32 33 14 14
17 15 36 32 14 14
18 20 38 38 17 11
19 18 39 38 14 10
20 16 32 32 16 13
21 16 32 33 18 7
22 16 31 31 11 14
23 19 39 38 14 12
24 16 37 39 12 14
25 17 39 32 17 11
26 17 41 32 9 9
27 16 36 35 16 11
28 15 33 37 14 15
29 16 33 33 15 14
30 14 34 33 11 13
31 15 31 28 16 9
32 12 27 32 13 15
33 14 37 31 17 10
34 16 34 37 15 11
35 14 34 30 14 13
36 7 32 33 16 8
37 10 29 31 9 20
38 14 36 33 15 12
39 16 29 31 17 10
40 16 35 33 13 10
41 16 37 32 15 9
42 14 34 33 16 14
43 20 38 32 16 8
44 14 35 33 12 14
45 14 38 28 12 11
46 11 37 35 11 13
47 14 38 39 15 9
48 15 33 34 15 11
49 16 36 38 17 15
50 14 38 32 13 11
51 16 32 38 16 10
52 14 32 30 14 14
53 12 32 33 11 18
54 16 34 38 12 14
55 9 32 32 12 11
56 14 37 32 15 12
57 16 39 34 16 13
58 16 29 34 15 9
59 15 37 36 12 10
60 16 35 34 12 15
61 12 30 28 8 20
62 16 38 34 13 12
63 16 34 35 11 12
64 14 31 35 14 14
65 16 34 31 15 13
66 17 35 37 10 11
67 18 36 35 11 17
68 18 30 27 12 12
69 12 39 40 15 13
70 16 35 37 15 14
71 10 38 36 14 13
72 14 31 38 16 15
73 18 34 39 15 13
74 18 38 41 15 10
75 16 34 27 13 11
76 17 39 30 12 19
77 16 37 37 17 13
78 16 34 31 13 17
79 13 28 31 15 13
80 16 37 27 13 9
81 16 33 36 15 11
82 20 37 38 16 10
83 16 35 37 15 9
84 15 37 33 16 12
85 15 32 34 15 12
86 16 33 31 14 13
87 14 38 39 15 13
88 16 33 34 14 12
89 16 29 32 13 15
90 15 33 33 7 22
91 12 31 36 17 13
92 17 36 32 13 15
93 16 35 41 15 13
94 15 32 28 14 15
95 13 29 30 13 10
96 16 39 36 16 11
97 16 37 35 12 16
98 16 35 31 14 11
99 16 37 34 17 11
100 14 32 36 15 10
101 16 38 36 17 10
102 16 37 35 12 16
103 20 36 37 16 12
104 15 32 28 11 11
105 16 33 39 15 16
106 13 40 32 9 19
107 17 38 35 16 11
108 16 41 39 15 16
109 16 36 35 10 15
110 12 43 42 10 24
111 16 30 34 15 14
112 16 31 33 11 15
113 17 32 41 13 11
114 13 32 33 14 15
115 12 37 34 18 12
116 18 37 32 16 10
117 14 33 40 14 14
118 14 34 40 14 13
119 13 33 35 14 9
120 16 38 36 14 15
121 13 33 37 12 15
122 16 31 27 14 14
123 13 38 39 15 11
124 16 37 38 15 8
125 15 33 31 15 11
126 16 31 33 13 11
127 15 39 32 17 8
128 17 44 39 17 10
129 15 33 36 19 11
130 12 35 33 15 13
131 16 32 33 13 11
132 10 28 32 9 20
133 16 40 37 15 10
134 12 27 30 15 15
135 14 37 38 15 12
136 15 32 29 16 14
137 13 28 22 11 23
138 15 34 35 14 14
139 11 30 35 11 16
140 12 35 34 15 11
141 8 31 35 13 12
142 16 32 34 15 10
143 15 30 34 16 14
144 17 30 35 14 12
145 16 31 23 15 12
146 10 40 31 16 11
147 18 32 27 16 12
148 13 36 36 11 13
149 16 32 31 12 11
150 13 35 32 9 19
151 10 38 39 16 12
152 15 42 37 13 17
153 16 34 38 16 9
154 16 35 39 12 12
155 14 35 34 9 19
156 10 33 31 13 18
157 17 36 32 13 15
158 13 32 37 14 14
159 15 33 36 19 11
160 16 34 32 13 9
161 12 32 35 12 18
162 13 34 36 13 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Connected Separate Happiness `Depression\r`
11.67931 0.12593 -0.00830 0.05915 -0.12665
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.3685 -1.3147 0.3027 1.2244 4.9556
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 11.67931 2.67951 4.359 2.36e-05 ***
Connected 0.12593 0.05502 2.289 0.0234 *
Separate -0.00830 0.05229 -0.159 0.8741
Happiness 0.05915 0.08839 0.669 0.5043
`Depression\r` -0.12665 0.06471 -1.957 0.0521 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.177 on 157 degrees of freedom
Multiple R-squared: 0.09178, Adjusted R-squared: 0.06864
F-statistic: 3.966 on 4 and 157 DF, p-value: 0.004287
> 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.72971234 0.54057532 0.27028766
[2,] 0.58343886 0.83312228 0.41656114
[3,] 0.48166963 0.96333927 0.51833037
[4,] 0.40322920 0.80645841 0.59677080
[5,] 0.51268032 0.97463936 0.48731968
[6,] 0.41796661 0.83593321 0.58203339
[7,] 0.36811798 0.73623595 0.63188202
[8,] 0.39429788 0.78859577 0.60570212
[9,] 0.33341647 0.66683293 0.66658353
[10,] 0.26691436 0.53382872 0.73308564
[11,] 0.57425336 0.85149327 0.42574664
[12,] 0.56202197 0.87595606 0.43797803
[13,] 0.48858386 0.97716772 0.51141614
[14,] 0.41607503 0.83215006 0.58392497
[15,] 0.34927616 0.69855231 0.65072384
[16,] 0.39076116 0.78152232 0.60923884
[17,] 0.33420953 0.66841905 0.66579047
[18,] 0.29160531 0.58321063 0.70839469
[19,] 0.23826478 0.47652955 0.76173522
[20,] 0.18871012 0.37742023 0.81128988
[21,] 0.15684029 0.31368057 0.84315971
[22,] 0.12254446 0.24508891 0.87745554
[23,] 0.11844597 0.23689194 0.88155403
[24,] 0.08927464 0.17854928 0.91072536
[25,] 0.10903816 0.21807631 0.89096184
[26,] 0.10179627 0.20359254 0.89820373
[27,] 0.07759021 0.15518042 0.92240979
[28,] 0.06327998 0.12655996 0.93672002
[29,] 0.65159150 0.69681700 0.34840850
[30,] 0.75084206 0.49831589 0.24915794
[31,] 0.72326144 0.55347712 0.27673856
[32,] 0.72009594 0.55980812 0.27990406
[33,] 0.67878031 0.64243939 0.32121969
[34,] 0.63047368 0.73905263 0.36952632
[35,] 0.58989737 0.82020526 0.41010263
[36,] 0.70046681 0.59906637 0.29953319
[37,] 0.66461530 0.67076941 0.33538470
[38,] 0.63486232 0.73027536 0.36513768
[39,] 0.76736832 0.46526336 0.23263168
[40,] 0.77066466 0.45867068 0.22933534
[41,] 0.73042890 0.53914221 0.26957110
[42,] 0.69309567 0.61380867 0.30690433
[43,] 0.66984777 0.66030447 0.33015223
[44,] 0.62975185 0.74049631 0.37024815
[45,] 0.58298134 0.83403731 0.41701866
[46,] 0.57005142 0.85989716 0.42994858
[47,] 0.53459563 0.93080874 0.46540437
[48,] 0.75974233 0.48051534 0.24025767
[49,] 0.73728167 0.52543666 0.26271833
[50,] 0.69817811 0.60364378 0.30182189
[51,] 0.67958386 0.64083228 0.32041614
[52,] 0.63902680 0.72194640 0.36097320
[53,] 0.61061702 0.77876597 0.38938298
[54,] 0.57357179 0.85285642 0.42642821
[55,] 0.52888419 0.94223163 0.47111581
[56,] 0.49730402 0.99460804 0.50269598
[57,] 0.45182286 0.90364571 0.54817714
[58,] 0.42045817 0.84091634 0.57954183
[59,] 0.40856843 0.81713685 0.59143157
[60,] 0.46988646 0.93977292 0.53011354
[61,] 0.59480073 0.81039853 0.40519927
[62,] 0.68986410 0.62027180 0.31013590
[63,] 0.65691571 0.68616858 0.34308429
[64,] 0.84149528 0.31700943 0.15850472
[65,] 0.81406890 0.37186220 0.18593110
[66,] 0.84094537 0.31810927 0.15905463
[67,] 0.83929566 0.32140868 0.16070434
[68,] 0.81762058 0.36475885 0.18237942
[69,] 0.82099183 0.35801634 0.17900817
[70,] 0.79352999 0.41294002 0.20647001
[71,] 0.78042302 0.43915397 0.21957698
[72,] 0.75455703 0.49088594 0.24544297
[73,] 0.71989112 0.56021775 0.28010888
[74,] 0.68771956 0.62456088 0.31228044
[75,] 0.79456852 0.41086296 0.20543148
[76,] 0.76187232 0.47625536 0.23812768
[77,] 0.72680424 0.54639153 0.27319576
[78,] 0.68767190 0.62465621 0.31232810
[79,] 0.66012899 0.67974201 0.33987101
[80,] 0.63814936 0.72370128 0.36185064
[81,] 0.60641741 0.78716518 0.39358259
[82,] 0.60274123 0.79451755 0.39725877
[83,] 0.59118549 0.81762902 0.40881451
[84,] 0.60865901 0.78268199 0.39134099
[85,] 0.61316897 0.77366206 0.38683103
[86,] 0.58340149 0.83319702 0.41659851
[87,] 0.54184454 0.91631093 0.45815546
[88,] 0.52313974 0.95372051 0.47686026
[89,] 0.47848060 0.95696120 0.52151940
[90,] 0.45602120 0.91204240 0.54397880
[91,] 0.41532676 0.83065352 0.58467324
[92,] 0.37272623 0.74545246 0.62727377
[93,] 0.33824788 0.67649577 0.66175212
[94,] 0.29729189 0.59458379 0.70270811
[95,] 0.27994898 0.55989796 0.72005102
[96,] 0.46894229 0.93788458 0.53105771
[97,] 0.42321859 0.84643717 0.57678141
[98,] 0.43226429 0.86452858 0.56773571
[99,] 0.41071752 0.82143504 0.58928248
[100,] 0.39256851 0.78513701 0.60743149
[101,] 0.39343793 0.78687587 0.60656207
[102,] 0.37372489 0.74744979 0.62627511
[103,] 0.38921143 0.77842286 0.61078857
[104,] 0.38523458 0.77046916 0.61476542
[105,] 0.38150139 0.76300277 0.61849861
[106,] 0.41392645 0.82785290 0.58607355
[107,] 0.37630016 0.75260032 0.62369984
[108,] 0.42630436 0.85260872 0.57369564
[109,] 0.43856546 0.87713092 0.56143454
[110,] 0.40123537 0.80247075 0.59876463
[111,] 0.36197726 0.72395452 0.63802274
[112,] 0.36247125 0.72494250 0.63752875
[113,] 0.36565760 0.73131521 0.63434240
[114,] 0.32505651 0.65011302 0.67494349
[115,] 0.29859732 0.59719465 0.70140268
[116,] 0.28528965 0.57057931 0.71471035
[117,] 0.24300982 0.48601963 0.75699018
[118,] 0.20184076 0.40368151 0.79815924
[119,] 0.17722201 0.35444403 0.82277799
[120,] 0.15365424 0.30730847 0.84634576
[121,] 0.14400656 0.28801311 0.85599344
[122,] 0.11831814 0.23663628 0.88168186
[123,] 0.12347306 0.24694612 0.87652694
[124,] 0.10320043 0.20640087 0.89679957
[125,] 0.10805314 0.21610629 0.89194686
[126,] 0.09134310 0.18268619 0.90865690
[127,] 0.08629419 0.17258839 0.91370581
[128,] 0.06727243 0.13454487 0.93272757
[129,] 0.05001121 0.10002241 0.94998879
[130,] 0.03606652 0.07213304 0.96393348
[131,] 0.02807768 0.05615537 0.97192232
[132,] 0.03164722 0.06329443 0.96835278
[133,] 0.03355689 0.06711378 0.96644311
[134,] 0.37144716 0.74289433 0.62855284
[135,] 0.30464130 0.60928260 0.69535870
[136,] 0.24413388 0.48826776 0.75586612
[137,] 0.21913073 0.43826146 0.78086927
[138,] 0.16559480 0.33118960 0.83440520
[139,] 0.51816409 0.96367182 0.48183591
[140,] 0.50721922 0.98556157 0.49278078
[141,] 0.51252448 0.97495103 0.48747552
[142,] 0.41257396 0.82514793 0.58742604
[143,] 0.32126449 0.64252898 0.67873551
[144,] 0.84956168 0.30087665 0.15043832
[145,] 0.92479786 0.15040427 0.07520214
[146,] 0.85539851 0.28920298 0.14460149
[147,] 0.80064421 0.39871157 0.19935579
> postscript(file="/var/www/rcomp/tmp/14tii1324317776.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/www/rcomp/tmp/2iatp1324317776.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/www/rcomp/tmp/38u191324317776.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/www/rcomp/tmp/42w0a1324317776.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/www/rcomp/tmp/5788z1324317776.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.835481850 0.003313880 4.955615192 0.500636572 0.059241762 -2.391216510
7 8 9 10 11 12
4.624740634 -0.097211320 -1.543174511 -0.264266156 0.053453111 -0.041385824
13 14 15 16 17 18
1.133967790 0.551363331 1.673755112 0.509688650 -0.002335735 4.238201061
19 20 21 22 23 24
2.163087788 1.256432870 0.386546509 1.796483165 3.416380219 1.048144283
25 26 27 28 29 30
1.062468539 1.030551310 0.524317045 0.543604823 1.324602957 -0.691355657
31 32 33 34 35 36
-0.157421948 -1.683155551 -1.820615855 0.851934269 -0.893720378 -8.368497958
37 38 39 40 41 42
-3.073468157 -1.306482577 1.186832421 0.684465345 0.179347495 -0.860482736
43 44 45 46 47 48
3.867615587 -0.749795135 -1.549028124 -4.052548265 -1.888481803 -0.047035440
49 50 51 52 53 54
0.996647991 -1.574981791 0.926295712 -0.515212093 -1.806262513 1.417637139
55 56 57 58 59 60
-5.760240925 -1.440713859 0.391516124 1.203396267 -0.483341321 1.385151328
61 62 63 64 65 66
-1.165145277 0.568264920 1.198598624 -0.347779819 1.055425212 2.021776529
67 68 69 70 71 72
3.579967630 3.576766119 -3.499527729 1.105941880 -5.347643028 -0.314542178
73 74 75 76 77 78
3.121827195 2.254764908 0.887241107 2.354811058 0.609124278 1.680319390
79 80 81 82 83 84
-1.188988581 0.256155573 0.969565056 4.296640540 0.472710804 -0.491568270
85 86 87 88 89 90
0.205541809 1.240510905 -1.381896943 1.138765434 2.064982380 1.811009949
91 92 93 94 95 96
-2.643589763 2.183465138 1.012496657 0.594833626 -1.584849192 0.154824190
97 98 99 100 101 102
1.268235722 0.735356406 0.330931104 -1.031150125 0.094954350 1.268235722
103 104 105 106 107 108
4.667563756 0.265712742 1.627696875 -1.577055504 1.272454976 0.620248599
109 110 111 112 113 114
1.385829859 -2.297769711 1.710696309 1.939729877 2.255306648 -1.363665134
115 116 117 118 119 120
-3.601577340 2.246839052 -0.558140648 -0.810717898 -2.232872964 0.905649403
121 122 123 124 125 126
-1.338085859 1.585818197 -2.635189373 0.102502768 -0.071936184 1.314835698
127 128 129 130 131 132
-1.317470106 0.364268887 -0.267053580 -3.053905327 1.188904664 -2.939236875
133 134 135 136 137 138
-0.030298153 -1.818065365 -1.390912371 0.358178341 0.239389974 0.274427077
139 140 141 142 143 144
-2.791092378 -3.298897509 -6.541917591 0.952249379 0.651541650 2.524858785
145 146 147 148 149 150
1.240170116 -6.012608084 3.088285415 -1.918316982 1.231458827 -0.947400331
151 152 153 154 155 156
-5.567697817 -0.277327398 0.547787428 1.046713922 0.069200165 -4.067103361
157 158 159 160 161 162
2.183465138 -1.457110358 -0.267053580 0.675449917 -1.848816675 -1.404825586
> postscript(file="/var/www/rcomp/tmp/6v9or1324317776.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.835481850 NA
1 0.003313880 -2.835481850
2 4.955615192 0.003313880
3 0.500636572 4.955615192
4 0.059241762 0.500636572
5 -2.391216510 0.059241762
6 4.624740634 -2.391216510
7 -0.097211320 4.624740634
8 -1.543174511 -0.097211320
9 -0.264266156 -1.543174511
10 0.053453111 -0.264266156
11 -0.041385824 0.053453111
12 1.133967790 -0.041385824
13 0.551363331 1.133967790
14 1.673755112 0.551363331
15 0.509688650 1.673755112
16 -0.002335735 0.509688650
17 4.238201061 -0.002335735
18 2.163087788 4.238201061
19 1.256432870 2.163087788
20 0.386546509 1.256432870
21 1.796483165 0.386546509
22 3.416380219 1.796483165
23 1.048144283 3.416380219
24 1.062468539 1.048144283
25 1.030551310 1.062468539
26 0.524317045 1.030551310
27 0.543604823 0.524317045
28 1.324602957 0.543604823
29 -0.691355657 1.324602957
30 -0.157421948 -0.691355657
31 -1.683155551 -0.157421948
32 -1.820615855 -1.683155551
33 0.851934269 -1.820615855
34 -0.893720378 0.851934269
35 -8.368497958 -0.893720378
36 -3.073468157 -8.368497958
37 -1.306482577 -3.073468157
38 1.186832421 -1.306482577
39 0.684465345 1.186832421
40 0.179347495 0.684465345
41 -0.860482736 0.179347495
42 3.867615587 -0.860482736
43 -0.749795135 3.867615587
44 -1.549028124 -0.749795135
45 -4.052548265 -1.549028124
46 -1.888481803 -4.052548265
47 -0.047035440 -1.888481803
48 0.996647991 -0.047035440
49 -1.574981791 0.996647991
50 0.926295712 -1.574981791
51 -0.515212093 0.926295712
52 -1.806262513 -0.515212093
53 1.417637139 -1.806262513
54 -5.760240925 1.417637139
55 -1.440713859 -5.760240925
56 0.391516124 -1.440713859
57 1.203396267 0.391516124
58 -0.483341321 1.203396267
59 1.385151328 -0.483341321
60 -1.165145277 1.385151328
61 0.568264920 -1.165145277
62 1.198598624 0.568264920
63 -0.347779819 1.198598624
64 1.055425212 -0.347779819
65 2.021776529 1.055425212
66 3.579967630 2.021776529
67 3.576766119 3.579967630
68 -3.499527729 3.576766119
69 1.105941880 -3.499527729
70 -5.347643028 1.105941880
71 -0.314542178 -5.347643028
72 3.121827195 -0.314542178
73 2.254764908 3.121827195
74 0.887241107 2.254764908
75 2.354811058 0.887241107
76 0.609124278 2.354811058
77 1.680319390 0.609124278
78 -1.188988581 1.680319390
79 0.256155573 -1.188988581
80 0.969565056 0.256155573
81 4.296640540 0.969565056
82 0.472710804 4.296640540
83 -0.491568270 0.472710804
84 0.205541809 -0.491568270
85 1.240510905 0.205541809
86 -1.381896943 1.240510905
87 1.138765434 -1.381896943
88 2.064982380 1.138765434
89 1.811009949 2.064982380
90 -2.643589763 1.811009949
91 2.183465138 -2.643589763
92 1.012496657 2.183465138
93 0.594833626 1.012496657
94 -1.584849192 0.594833626
95 0.154824190 -1.584849192
96 1.268235722 0.154824190
97 0.735356406 1.268235722
98 0.330931104 0.735356406
99 -1.031150125 0.330931104
100 0.094954350 -1.031150125
101 1.268235722 0.094954350
102 4.667563756 1.268235722
103 0.265712742 4.667563756
104 1.627696875 0.265712742
105 -1.577055504 1.627696875
106 1.272454976 -1.577055504
107 0.620248599 1.272454976
108 1.385829859 0.620248599
109 -2.297769711 1.385829859
110 1.710696309 -2.297769711
111 1.939729877 1.710696309
112 2.255306648 1.939729877
113 -1.363665134 2.255306648
114 -3.601577340 -1.363665134
115 2.246839052 -3.601577340
116 -0.558140648 2.246839052
117 -0.810717898 -0.558140648
118 -2.232872964 -0.810717898
119 0.905649403 -2.232872964
120 -1.338085859 0.905649403
121 1.585818197 -1.338085859
122 -2.635189373 1.585818197
123 0.102502768 -2.635189373
124 -0.071936184 0.102502768
125 1.314835698 -0.071936184
126 -1.317470106 1.314835698
127 0.364268887 -1.317470106
128 -0.267053580 0.364268887
129 -3.053905327 -0.267053580
130 1.188904664 -3.053905327
131 -2.939236875 1.188904664
132 -0.030298153 -2.939236875
133 -1.818065365 -0.030298153
134 -1.390912371 -1.818065365
135 0.358178341 -1.390912371
136 0.239389974 0.358178341
137 0.274427077 0.239389974
138 -2.791092378 0.274427077
139 -3.298897509 -2.791092378
140 -6.541917591 -3.298897509
141 0.952249379 -6.541917591
142 0.651541650 0.952249379
143 2.524858785 0.651541650
144 1.240170116 2.524858785
145 -6.012608084 1.240170116
146 3.088285415 -6.012608084
147 -1.918316982 3.088285415
148 1.231458827 -1.918316982
149 -0.947400331 1.231458827
150 -5.567697817 -0.947400331
151 -0.277327398 -5.567697817
152 0.547787428 -0.277327398
153 1.046713922 0.547787428
154 0.069200165 1.046713922
155 -4.067103361 0.069200165
156 2.183465138 -4.067103361
157 -1.457110358 2.183465138
158 -0.267053580 -1.457110358
159 0.675449917 -0.267053580
160 -1.848816675 0.675449917
161 -1.404825586 -1.848816675
162 NA -1.404825586
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.003313880 -2.835481850
[2,] 4.955615192 0.003313880
[3,] 0.500636572 4.955615192
[4,] 0.059241762 0.500636572
[5,] -2.391216510 0.059241762
[6,] 4.624740634 -2.391216510
[7,] -0.097211320 4.624740634
[8,] -1.543174511 -0.097211320
[9,] -0.264266156 -1.543174511
[10,] 0.053453111 -0.264266156
[11,] -0.041385824 0.053453111
[12,] 1.133967790 -0.041385824
[13,] 0.551363331 1.133967790
[14,] 1.673755112 0.551363331
[15,] 0.509688650 1.673755112
[16,] -0.002335735 0.509688650
[17,] 4.238201061 -0.002335735
[18,] 2.163087788 4.238201061
[19,] 1.256432870 2.163087788
[20,] 0.386546509 1.256432870
[21,] 1.796483165 0.386546509
[22,] 3.416380219 1.796483165
[23,] 1.048144283 3.416380219
[24,] 1.062468539 1.048144283
[25,] 1.030551310 1.062468539
[26,] 0.524317045 1.030551310
[27,] 0.543604823 0.524317045
[28,] 1.324602957 0.543604823
[29,] -0.691355657 1.324602957
[30,] -0.157421948 -0.691355657
[31,] -1.683155551 -0.157421948
[32,] -1.820615855 -1.683155551
[33,] 0.851934269 -1.820615855
[34,] -0.893720378 0.851934269
[35,] -8.368497958 -0.893720378
[36,] -3.073468157 -8.368497958
[37,] -1.306482577 -3.073468157
[38,] 1.186832421 -1.306482577
[39,] 0.684465345 1.186832421
[40,] 0.179347495 0.684465345
[41,] -0.860482736 0.179347495
[42,] 3.867615587 -0.860482736
[43,] -0.749795135 3.867615587
[44,] -1.549028124 -0.749795135
[45,] -4.052548265 -1.549028124
[46,] -1.888481803 -4.052548265
[47,] -0.047035440 -1.888481803
[48,] 0.996647991 -0.047035440
[49,] -1.574981791 0.996647991
[50,] 0.926295712 -1.574981791
[51,] -0.515212093 0.926295712
[52,] -1.806262513 -0.515212093
[53,] 1.417637139 -1.806262513
[54,] -5.760240925 1.417637139
[55,] -1.440713859 -5.760240925
[56,] 0.391516124 -1.440713859
[57,] 1.203396267 0.391516124
[58,] -0.483341321 1.203396267
[59,] 1.385151328 -0.483341321
[60,] -1.165145277 1.385151328
[61,] 0.568264920 -1.165145277
[62,] 1.198598624 0.568264920
[63,] -0.347779819 1.198598624
[64,] 1.055425212 -0.347779819
[65,] 2.021776529 1.055425212
[66,] 3.579967630 2.021776529
[67,] 3.576766119 3.579967630
[68,] -3.499527729 3.576766119
[69,] 1.105941880 -3.499527729
[70,] -5.347643028 1.105941880
[71,] -0.314542178 -5.347643028
[72,] 3.121827195 -0.314542178
[73,] 2.254764908 3.121827195
[74,] 0.887241107 2.254764908
[75,] 2.354811058 0.887241107
[76,] 0.609124278 2.354811058
[77,] 1.680319390 0.609124278
[78,] -1.188988581 1.680319390
[79,] 0.256155573 -1.188988581
[80,] 0.969565056 0.256155573
[81,] 4.296640540 0.969565056
[82,] 0.472710804 4.296640540
[83,] -0.491568270 0.472710804
[84,] 0.205541809 -0.491568270
[85,] 1.240510905 0.205541809
[86,] -1.381896943 1.240510905
[87,] 1.138765434 -1.381896943
[88,] 2.064982380 1.138765434
[89,] 1.811009949 2.064982380
[90,] -2.643589763 1.811009949
[91,] 2.183465138 -2.643589763
[92,] 1.012496657 2.183465138
[93,] 0.594833626 1.012496657
[94,] -1.584849192 0.594833626
[95,] 0.154824190 -1.584849192
[96,] 1.268235722 0.154824190
[97,] 0.735356406 1.268235722
[98,] 0.330931104 0.735356406
[99,] -1.031150125 0.330931104
[100,] 0.094954350 -1.031150125
[101,] 1.268235722 0.094954350
[102,] 4.667563756 1.268235722
[103,] 0.265712742 4.667563756
[104,] 1.627696875 0.265712742
[105,] -1.577055504 1.627696875
[106,] 1.272454976 -1.577055504
[107,] 0.620248599 1.272454976
[108,] 1.385829859 0.620248599
[109,] -2.297769711 1.385829859
[110,] 1.710696309 -2.297769711
[111,] 1.939729877 1.710696309
[112,] 2.255306648 1.939729877
[113,] -1.363665134 2.255306648
[114,] -3.601577340 -1.363665134
[115,] 2.246839052 -3.601577340
[116,] -0.558140648 2.246839052
[117,] -0.810717898 -0.558140648
[118,] -2.232872964 -0.810717898
[119,] 0.905649403 -2.232872964
[120,] -1.338085859 0.905649403
[121,] 1.585818197 -1.338085859
[122,] -2.635189373 1.585818197
[123,] 0.102502768 -2.635189373
[124,] -0.071936184 0.102502768
[125,] 1.314835698 -0.071936184
[126,] -1.317470106 1.314835698
[127,] 0.364268887 -1.317470106
[128,] -0.267053580 0.364268887
[129,] -3.053905327 -0.267053580
[130,] 1.188904664 -3.053905327
[131,] -2.939236875 1.188904664
[132,] -0.030298153 -2.939236875
[133,] -1.818065365 -0.030298153
[134,] -1.390912371 -1.818065365
[135,] 0.358178341 -1.390912371
[136,] 0.239389974 0.358178341
[137,] 0.274427077 0.239389974
[138,] -2.791092378 0.274427077
[139,] -3.298897509 -2.791092378
[140,] -6.541917591 -3.298897509
[141,] 0.952249379 -6.541917591
[142,] 0.651541650 0.952249379
[143,] 2.524858785 0.651541650
[144,] 1.240170116 2.524858785
[145,] -6.012608084 1.240170116
[146,] 3.088285415 -6.012608084
[147,] -1.918316982 3.088285415
[148,] 1.231458827 -1.918316982
[149,] -0.947400331 1.231458827
[150,] -5.567697817 -0.947400331
[151,] -0.277327398 -5.567697817
[152,] 0.547787428 -0.277327398
[153,] 1.046713922 0.547787428
[154,] 0.069200165 1.046713922
[155,] -4.067103361 0.069200165
[156,] 2.183465138 -4.067103361
[157,] -1.457110358 2.183465138
[158,] -0.267053580 -1.457110358
[159,] 0.675449917 -0.267053580
[160,] -1.848816675 0.675449917
[161,] -1.404825586 -1.848816675
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.003313880 -2.835481850
2 4.955615192 0.003313880
3 0.500636572 4.955615192
4 0.059241762 0.500636572
5 -2.391216510 0.059241762
6 4.624740634 -2.391216510
7 -0.097211320 4.624740634
8 -1.543174511 -0.097211320
9 -0.264266156 -1.543174511
10 0.053453111 -0.264266156
11 -0.041385824 0.053453111
12 1.133967790 -0.041385824
13 0.551363331 1.133967790
14 1.673755112 0.551363331
15 0.509688650 1.673755112
16 -0.002335735 0.509688650
17 4.238201061 -0.002335735
18 2.163087788 4.238201061
19 1.256432870 2.163087788
20 0.386546509 1.256432870
21 1.796483165 0.386546509
22 3.416380219 1.796483165
23 1.048144283 3.416380219
24 1.062468539 1.048144283
25 1.030551310 1.062468539
26 0.524317045 1.030551310
27 0.543604823 0.524317045
28 1.324602957 0.543604823
29 -0.691355657 1.324602957
30 -0.157421948 -0.691355657
31 -1.683155551 -0.157421948
32 -1.820615855 -1.683155551
33 0.851934269 -1.820615855
34 -0.893720378 0.851934269
35 -8.368497958 -0.893720378
36 -3.073468157 -8.368497958
37 -1.306482577 -3.073468157
38 1.186832421 -1.306482577
39 0.684465345 1.186832421
40 0.179347495 0.684465345
41 -0.860482736 0.179347495
42 3.867615587 -0.860482736
43 -0.749795135 3.867615587
44 -1.549028124 -0.749795135
45 -4.052548265 -1.549028124
46 -1.888481803 -4.052548265
47 -0.047035440 -1.888481803
48 0.996647991 -0.047035440
49 -1.574981791 0.996647991
50 0.926295712 -1.574981791
51 -0.515212093 0.926295712
52 -1.806262513 -0.515212093
53 1.417637139 -1.806262513
54 -5.760240925 1.417637139
55 -1.440713859 -5.760240925
56 0.391516124 -1.440713859
57 1.203396267 0.391516124
58 -0.483341321 1.203396267
59 1.385151328 -0.483341321
60 -1.165145277 1.385151328
61 0.568264920 -1.165145277
62 1.198598624 0.568264920
63 -0.347779819 1.198598624
64 1.055425212 -0.347779819
65 2.021776529 1.055425212
66 3.579967630 2.021776529
67 3.576766119 3.579967630
68 -3.499527729 3.576766119
69 1.105941880 -3.499527729
70 -5.347643028 1.105941880
71 -0.314542178 -5.347643028
72 3.121827195 -0.314542178
73 2.254764908 3.121827195
74 0.887241107 2.254764908
75 2.354811058 0.887241107
76 0.609124278 2.354811058
77 1.680319390 0.609124278
78 -1.188988581 1.680319390
79 0.256155573 -1.188988581
80 0.969565056 0.256155573
81 4.296640540 0.969565056
82 0.472710804 4.296640540
83 -0.491568270 0.472710804
84 0.205541809 -0.491568270
85 1.240510905 0.205541809
86 -1.381896943 1.240510905
87 1.138765434 -1.381896943
88 2.064982380 1.138765434
89 1.811009949 2.064982380
90 -2.643589763 1.811009949
91 2.183465138 -2.643589763
92 1.012496657 2.183465138
93 0.594833626 1.012496657
94 -1.584849192 0.594833626
95 0.154824190 -1.584849192
96 1.268235722 0.154824190
97 0.735356406 1.268235722
98 0.330931104 0.735356406
99 -1.031150125 0.330931104
100 0.094954350 -1.031150125
101 1.268235722 0.094954350
102 4.667563756 1.268235722
103 0.265712742 4.667563756
104 1.627696875 0.265712742
105 -1.577055504 1.627696875
106 1.272454976 -1.577055504
107 0.620248599 1.272454976
108 1.385829859 0.620248599
109 -2.297769711 1.385829859
110 1.710696309 -2.297769711
111 1.939729877 1.710696309
112 2.255306648 1.939729877
113 -1.363665134 2.255306648
114 -3.601577340 -1.363665134
115 2.246839052 -3.601577340
116 -0.558140648 2.246839052
117 -0.810717898 -0.558140648
118 -2.232872964 -0.810717898
119 0.905649403 -2.232872964
120 -1.338085859 0.905649403
121 1.585818197 -1.338085859
122 -2.635189373 1.585818197
123 0.102502768 -2.635189373
124 -0.071936184 0.102502768
125 1.314835698 -0.071936184
126 -1.317470106 1.314835698
127 0.364268887 -1.317470106
128 -0.267053580 0.364268887
129 -3.053905327 -0.267053580
130 1.188904664 -3.053905327
131 -2.939236875 1.188904664
132 -0.030298153 -2.939236875
133 -1.818065365 -0.030298153
134 -1.390912371 -1.818065365
135 0.358178341 -1.390912371
136 0.239389974 0.358178341
137 0.274427077 0.239389974
138 -2.791092378 0.274427077
139 -3.298897509 -2.791092378
140 -6.541917591 -3.298897509
141 0.952249379 -6.541917591
142 0.651541650 0.952249379
143 2.524858785 0.651541650
144 1.240170116 2.524858785
145 -6.012608084 1.240170116
146 3.088285415 -6.012608084
147 -1.918316982 3.088285415
148 1.231458827 -1.918316982
149 -0.947400331 1.231458827
150 -5.567697817 -0.947400331
151 -0.277327398 -5.567697817
152 0.547787428 -0.277327398
153 1.046713922 0.547787428
154 0.069200165 1.046713922
155 -4.067103361 0.069200165
156 2.183465138 -4.067103361
157 -1.457110358 2.183465138
158 -0.267053580 -1.457110358
159 0.675449917 -0.267053580
160 -1.848816675 0.675449917
161 -1.404825586 -1.848816675
> 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/www/rcomp/tmp/7pkkt1324317776.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/www/rcomp/tmp/8q49v1324317776.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/www/rcomp/tmp/9xrdg1324317776.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/www/rcomp/tmp/10275a1324317776.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/www/rcomp/tmp/1116j31324317776.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/www/rcomp/tmp/123jda1324317776.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/www/rcomp/tmp/13sman1324317776.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/www/rcomp/tmp/14vyel1324317776.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/www/rcomp/tmp/15jze91324317776.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/www/rcomp/tmp/163n511324317776.tab")
+ }
>
> try(system("convert tmp/14tii1324317776.ps tmp/14tii1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/2iatp1324317776.ps tmp/2iatp1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/38u191324317776.ps tmp/38u191324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/42w0a1324317776.ps tmp/42w0a1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/5788z1324317776.ps tmp/5788z1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/6v9or1324317776.ps tmp/6v9or1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/7pkkt1324317776.ps tmp/7pkkt1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/8q49v1324317776.ps tmp/8q49v1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/9xrdg1324317776.ps tmp/9xrdg1324317776.png",intern=TRUE))
character(0)
> try(system("convert tmp/10275a1324317776.ps tmp/10275a1324317776.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.970 0.150 5.127