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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- '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
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
Connected Learning Happiness Depression t
1 41 13 14 12 1
2 39 16 18 11 2
3 30 19 11 14 3
4 31 15 12 12 4
5 34 14 16 21 5
6 35 13 18 12 6
7 39 19 14 22 7
8 34 15 14 11 8
9 36 14 15 10 9
10 37 15 15 13 10
11 38 16 17 10 11
12 36 16 19 8 12
13 38 16 10 15 13
14 39 16 16 14 14
15 33 17 18 10 15
16 32 15 14 14 16
17 36 15 14 14 17
18 38 20 17 11 18
19 39 18 14 10 19
20 32 16 16 13 20
21 32 16 18 7 21
22 31 16 11 14 22
23 39 19 14 12 23
24 37 16 12 14 24
25 39 17 17 11 25
26 41 17 9 9 26
27 36 16 16 11 27
28 33 15 14 15 28
29 33 16 15 14 29
30 34 14 11 13 30
31 31 15 16 9 31
32 27 12 13 15 32
33 37 14 17 10 33
34 34 16 15 11 34
35 34 14 14 13 35
36 32 7 16 8 36
37 29 10 9 20 37
38 36 14 15 12 38
39 29 16 17 10 39
40 35 16 13 10 40
41 37 16 15 9 41
42 34 14 16 14 42
43 38 20 16 8 43
44 35 14 12 14 44
45 38 14 12 11 45
46 37 11 11 13 46
47 38 14 15 9 47
48 33 15 15 11 48
49 36 16 17 15 49
50 38 14 13 11 50
51 32 16 16 10 51
52 32 14 14 14 52
53 32 12 11 18 53
54 34 16 12 14 54
55 32 9 12 11 55
56 37 14 15 12 56
57 39 16 16 13 57
58 29 16 15 9 58
59 37 15 12 10 59
60 35 16 12 15 60
61 30 12 8 20 61
62 38 16 13 12 62
63 34 16 11 12 63
64 31 14 14 14 64
65 34 16 15 13 65
66 35 17 10 11 66
67 36 18 11 17 67
68 30 18 12 12 68
69 39 12 15 13 69
70 35 16 15 14 70
71 38 10 14 13 71
72 31 14 16 15 72
73 34 18 15 13 73
74 38 18 15 10 74
75 34 16 13 11 75
76 39 17 12 19 76
77 37 16 17 13 77
78 34 16 13 17 78
79 28 13 15 13 79
80 37 16 13 9 80
81 33 16 15 11 81
82 37 20 16 10 82
83 35 16 15 9 83
84 37 15 16 12 84
85 32 15 15 12 85
86 33 16 14 13 86
87 38 14 15 13 87
88 33 16 14 12 88
89 29 16 13 15 89
90 33 15 7 22 90
91 31 12 17 13 91
92 36 17 13 15 92
93 35 16 15 13 93
94 32 15 14 15 94
95 29 13 13 10 95
96 39 16 16 11 96
97 37 16 12 16 97
98 35 16 14 11 98
99 37 16 17 11 99
100 32 14 15 10 100
101 38 16 17 10 101
102 37 16 12 16 102
103 36 20 16 12 103
104 32 15 11 11 104
105 33 16 15 16 105
106 40 13 9 19 106
107 38 17 16 11 107
108 41 16 15 16 108
109 36 16 10 15 109
110 43 12 10 24 110
111 30 16 15 14 111
112 31 16 11 15 112
113 32 17 13 11 113
114 32 13 14 15 114
115 37 12 18 12 115
116 37 18 16 10 116
117 33 14 14 14 117
118 34 14 14 13 118
119 33 13 14 9 119
120 38 16 14 15 120
121 33 13 12 15 121
122 31 16 14 14 122
123 38 13 15 11 123
124 37 16 15 8 124
125 33 15 15 11 125
126 31 16 13 11 126
127 39 15 17 8 127
128 44 17 17 10 128
129 33 15 19 11 129
130 35 12 15 13 130
131 32 16 13 11 131
132 28 10 9 20 132
133 40 16 15 10 133
134 27 12 15 15 134
135 37 14 15 12 135
136 32 15 16 14 136
137 28 13 11 23 137
138 34 15 14 14 138
139 30 11 11 16 139
140 35 12 15 11 140
141 31 8 13 12 141
142 32 16 15 10 142
143 30 15 16 14 143
144 30 17 14 12 144
145 31 16 15 12 145
146 40 10 16 11 146
147 32 18 16 12 147
148 36 13 11 13 148
149 32 16 12 11 149
150 35 13 9 19 150
151 38 10 16 12 151
152 42 15 13 17 152
153 34 16 16 9 153
154 35 16 12 12 154
155 35 14 9 19 155
156 33 10 13 18 156
157 36 17 13 15 157
158 32 13 14 14 158
159 33 15 19 11 159
160 34 16 13 9 160
161 32 12 12 18 161
162 34 13 13 16 162
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Learning Happiness Depression t
29.447454 0.266841 0.133404 -0.020420 -0.005181
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.9117 -2.4268 -0.1222 2.3210 10.0763
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 29.447454 3.426719 8.593 7.98e-15 ***
Learning 0.266841 0.120876 2.208 0.0287 *
Happiness 0.133404 0.133379 1.000 0.3188
Depression -0.020420 0.099707 -0.205 0.8380
t -0.005181 0.005692 -0.910 0.3642
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.31 on 157 degrees of freedom
Multiple R-squared: 0.06213, Adjusted R-squared: 0.03823
F-statistic: 2.6 on 4 and 157 DF, p-value: 0.03824
> 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.90850848 0.182983032 0.091491516
[2,] 0.86469164 0.270616712 0.135308356
[3,] 0.81071349 0.378573023 0.189286512
[4,] 0.72839208 0.543215846 0.271607923
[5,] 0.65755115 0.684897693 0.342448846
[6,] 0.70065813 0.598683745 0.299341873
[7,] 0.63131564 0.737368729 0.368684364
[8,] 0.65523389 0.689532225 0.344766113
[9,] 0.67883436 0.642331286 0.321165643
[10,] 0.60014587 0.799708260 0.399854130
[11,] 0.55543190 0.889136200 0.444568100
[12,] 0.55570788 0.888584240 0.444292120
[13,] 0.59837154 0.803256911 0.401628455
[14,] 0.60621730 0.787565395 0.393782697
[15,] 0.57801327 0.843973455 0.421986728
[16,] 0.60538118 0.789237634 0.394618817
[17,] 0.57864137 0.842717265 0.421358633
[18,] 0.56324440 0.873511204 0.436755602
[19,] 0.68744980 0.625100409 0.312550204
[20,] 0.62861750 0.742764991 0.371382495
[21,] 0.59856412 0.802871770 0.401435885
[22,] 0.56568304 0.868633911 0.434316956
[23,] 0.50413355 0.991732906 0.495866453
[24,] 0.52272258 0.954554844 0.477277422
[25,] 0.60702209 0.785955820 0.392977910
[26,] 0.61090247 0.778195068 0.389097534
[27,] 0.55520527 0.889589463 0.444794732
[28,] 0.50205744 0.995885122 0.497942561
[29,] 0.45819922 0.916398449 0.541800776
[30,] 0.42200663 0.844013267 0.577993366
[31,] 0.39717542 0.794350832 0.602824584
[32,] 0.50438791 0.991224177 0.495612089
[33,] 0.45377385 0.907547700 0.546226150
[34,] 0.43123113 0.862462260 0.568768870
[35,] 0.38708107 0.774162142 0.612918929
[36,] 0.34683011 0.693660220 0.653169890
[37,] 0.31556113 0.631122263 0.684438869
[38,] 0.34771052 0.695421035 0.652289483
[39,] 0.38387436 0.767748722 0.616125639
[40,] 0.38765904 0.775318081 0.612340959
[41,] 0.35144134 0.702882672 0.648558664
[42,] 0.31502536 0.630050719 0.684974641
[43,] 0.32356515 0.647130300 0.676434850
[44,] 0.32273796 0.645475918 0.677262041
[45,] 0.29438412 0.588768245 0.705615877
[46,] 0.25592106 0.511842126 0.744078937
[47,] 0.21822236 0.436444729 0.781777636
[48,] 0.18434022 0.368680447 0.815659776
[49,] 0.17719838 0.354396756 0.822801622
[50,] 0.19476899 0.389537980 0.805231010
[51,] 0.29329881 0.586597621 0.706701189
[52,] 0.27478482 0.549569645 0.725215177
[53,] 0.23664851 0.473297023 0.763351489
[54,] 0.22174084 0.443481685 0.778259157
[55,] 0.21977331 0.439546619 0.780226691
[56,] 0.18787615 0.375752308 0.812123846
[57,] 0.18243410 0.364868206 0.817565897
[58,] 0.15436666 0.308733318 0.845633341
[59,] 0.12869566 0.257391316 0.871304342
[60,] 0.10855618 0.217112357 0.891443822
[61,] 0.14444544 0.288890876 0.855554562
[62,] 0.20023862 0.400477234 0.799761383
[63,] 0.16976719 0.339534377 0.830232812
[64,] 0.20969442 0.419388834 0.790305583
[65,] 0.20950821 0.419016423 0.790491788
[66,] 0.18266914 0.365338274 0.817330863
[67,] 0.16985179 0.339703583 0.830148209
[68,] 0.14311778 0.286235569 0.856882215
[69,] 0.16665910 0.333318198 0.833340901
[70,] 0.14707645 0.294152901 0.852923550
[71,] 0.12270936 0.245418726 0.877290637
[72,] 0.18541228 0.370824559 0.814587721
[73,] 0.16979863 0.339597262 0.830201369
[74,] 0.15100544 0.302010874 0.848994563
[75,] 0.12709742 0.254194849 0.872902575
[76,] 0.10466799 0.209335971 0.895332014
[77,] 0.09392760 0.187855207 0.906072397
[78,] 0.08663455 0.173269108 0.913365446
[79,] 0.07399656 0.147993114 0.926003443
[80,] 0.07775015 0.155500306 0.922249847
[81,] 0.06618934 0.132378679 0.933810661
[82,] 0.09614384 0.192287677 0.903856161
[83,] 0.07896844 0.157936885 0.921031557
[84,] 0.07972050 0.159441007 0.920279497
[85,] 0.06601745 0.132034907 0.933982546
[86,] 0.05298617 0.105972330 0.947013835
[87,] 0.04932649 0.098652971 0.950673514
[88,] 0.06762422 0.135248443 0.932375778
[89,] 0.07205585 0.144111692 0.927944154
[90,] 0.06514384 0.130287681 0.934856160
[91,] 0.05179392 0.103587832 0.948206084
[92,] 0.04308951 0.086179030 0.956910485
[93,] 0.04035856 0.080717120 0.959641440
[94,] 0.03600153 0.072003067 0.963998466
[95,] 0.03173753 0.063475063 0.968262468
[96,] 0.02422484 0.048449678 0.975775161
[97,] 0.02108960 0.042179209 0.978910396
[98,] 0.01786815 0.035736292 0.982131854
[99,] 0.03810872 0.076217442 0.961891279
[100,] 0.03365079 0.067301575 0.966349213
[101,] 0.05865858 0.117317155 0.941341422
[102,] 0.05081519 0.101630381 0.949184810
[103,] 0.33155970 0.663119401 0.668440300
[104,] 0.35402489 0.708049772 0.645975114
[105,] 0.33285224 0.665704489 0.667147755
[106,] 0.31204162 0.624083235 0.687958383
[107,] 0.27743073 0.554861461 0.722569269
[108,] 0.25929799 0.518595976 0.740702012
[109,] 0.23007946 0.460158920 0.769920540
[110,] 0.19482693 0.389653852 0.805173074
[111,] 0.16134619 0.322692385 0.838653807
[112,] 0.13888402 0.277768043 0.861115978
[113,] 0.16322339 0.326446774 0.836776613
[114,] 0.13361767 0.267235342 0.866382329
[115,] 0.12310142 0.246202841 0.876898580
[116,] 0.12940333 0.258806660 0.870596670
[117,] 0.11136770 0.222735404 0.888632298
[118,] 0.09022539 0.180450776 0.909774612
[119,] 0.08769733 0.175394664 0.912302668
[120,] 0.09110180 0.182203603 0.908898199
[121,] 0.38563146 0.771262930 0.614368535
[122,] 0.33807819 0.676156380 0.661921810
[123,] 0.31352874 0.627057487 0.686471257
[124,] 0.27089107 0.541782133 0.729108933
[125,] 0.27110899 0.542217984 0.728891008
[126,] 0.46478615 0.929572293 0.535213854
[127,] 0.56610406 0.867791881 0.433895941
[128,] 0.62290406 0.754191872 0.377095936
[129,] 0.56650551 0.866988987 0.433494494
[130,] 0.58700055 0.825998900 0.412999450
[131,] 0.53396663 0.932066734 0.466033367
[132,] 0.54065213 0.918695736 0.459347868
[133,] 0.48314530 0.966290596 0.516854702
[134,] 0.54851850 0.902962997 0.451481499
[135,] 0.48764290 0.975285809 0.512357096
[136,] 0.51978091 0.960438186 0.480219093
[137,] 0.57736593 0.845268146 0.422634073
[138,] 0.66913824 0.661723529 0.330861764
[139,] 0.69187993 0.616240140 0.308120070
[140,] 0.81359397 0.372812057 0.186406029
[141,] 0.74476893 0.510462137 0.255231069
[142,] 0.82595815 0.348083702 0.174041851
[143,] 0.82849446 0.343011087 0.171505543
[144,] 0.86917737 0.261645258 0.130822629
[145,] 0.99718451 0.005630971 0.002815486
[146,] 0.98837455 0.023250902 0.011625451
[147,] 0.95572101 0.088557983 0.044278992
> postscript(file="/var/fisher/rcomp/tmp/1zun71355176950.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/fisher/rcomp/tmp/2l90m1355176950.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/fisher/rcomp/tmp/3xjbz1355176950.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/fisher/rcomp/tmp/4ylvq1355176950.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/fisher/rcomp/tmp/52d891355176950.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
6.46617094 3.11679149 -5.68346113 -3.78516057 -0.86297841 -0.04154352
7 8 9 10 11 12
3.10040637 -1.05166671 1.06653072 1.86612966 2.27640127 -0.02606638
13 14 15 16 17 18
3.32269168 3.50702644 -3.10312172 -2.94896275 1.05621783 1.26572123
19 20 21 22 23 24
3.18437698 -3.48230986 -3.86645661 -3.78450723 2.97909788 2.09244959
25 26 27 28 29 30
3.10250818 6.13408393 0.51311465 -1.86637603 -2.28186053 -0.22980043
31 32 33 34 35 36
-4.24016162 -6.91172647 1.92405594 -1.31721696 -0.60411056 -1.09995077
37 38 39 40 41 42
-3.71642541 1.25760706 -6.57854252 -0.03974458 1.67820754 -0.81423541
43 44 45 46 47 48
1.46738072 0.72974311 3.67366436 3.65361173 3.24297295 -1.97784789
49 50 51 52 53 54
0.57536215 3.56616292 -3.38297123 -2.49562094 -1.47486631 -0.75213303
55 56 57 58 59 60
-0.94032501 2.35085749 3.70937157 -6.23372261 2.45893173 0.29937022
61 62 63 64 65 66
-2.99236911 3.11506771 -0.61294303 -3.43345399 -1.11577946 0.24874230
67 68 69 70 71 72
0.97619623 -5.25412641 4.97230672 -0.06945679 4.64975416 -3.63839826
73 74 75 76 77 78
-1.60801676 2.33590450 -0.83800454 4.19709761 1.67957881 -0.69994415
79 80 81 82 83 84
-6.24272845 2.14705881 -2.07372974 0.71026286 -0.10420813 2.09566840
85 86 87 88 89 90
-2.76574668 -1.87358296 3.53187522 -1.88364157 -5.68379733 -0.46841132
91 92 93 94 95 96
-3.18052921 1.06490344 0.02927676 -2.52445781 -4.95428983 3.87057460
97 98 99 100 101 102
2.51147142 0.14774444 1.75271200 -2.46203658 2.74265339 2.53737431
103 104 105 106 107 108
-0.14010543 -2.15411810 -1.84729697 6.82009187 2.66072001 6.16824477
109 110 111 112 113 114
1.82002727 10.07634969 -4.85705304 -3.29783533 -2.90798350 -1.88716429
115 116 117 118 119 120
2.78998057 1.42008448 -1.15888330 -0.17412249 -0.98378005 3.34339628
121 122 123 124 125 126
-0.58409156 -3.66666233 3.94437748 2.08777584 -1.57894329 -3.57379500
127 128 129 130 131 132
4.10334986 8.61568806 -2.09183834 1.28832205 -2.54789211 -4.22427040
133 134 135 136 137 138
5.17524060 -6.65011608 2.76012324 -2.59410194 -5.20443975 -0.31693210
139 140 141 142 143 144
-2.80333509 1.29928829 -1.34093881 -2.77813419 -4.55783789 -4.86037011
145 146 147 148 149 150
-3.72175290 6.73064936 -3.37847802 2.64834887 -2.32123734 2.04803735
151 152 153 154 155 156
4.77697203 7.95025967 -0.87497194 0.72508533 1.80709928 0.32560659
157 158 159 160 161 162
1.40164108 -1.67963859 -1.93642096 -0.43849486 -1.04876810 0.51532762
> postscript(file="/var/fisher/rcomp/tmp/6kgbz1355176950.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 6.46617094 NA
1 3.11679149 6.46617094
2 -5.68346113 3.11679149
3 -3.78516057 -5.68346113
4 -0.86297841 -3.78516057
5 -0.04154352 -0.86297841
6 3.10040637 -0.04154352
7 -1.05166671 3.10040637
8 1.06653072 -1.05166671
9 1.86612966 1.06653072
10 2.27640127 1.86612966
11 -0.02606638 2.27640127
12 3.32269168 -0.02606638
13 3.50702644 3.32269168
14 -3.10312172 3.50702644
15 -2.94896275 -3.10312172
16 1.05621783 -2.94896275
17 1.26572123 1.05621783
18 3.18437698 1.26572123
19 -3.48230986 3.18437698
20 -3.86645661 -3.48230986
21 -3.78450723 -3.86645661
22 2.97909788 -3.78450723
23 2.09244959 2.97909788
24 3.10250818 2.09244959
25 6.13408393 3.10250818
26 0.51311465 6.13408393
27 -1.86637603 0.51311465
28 -2.28186053 -1.86637603
29 -0.22980043 -2.28186053
30 -4.24016162 -0.22980043
31 -6.91172647 -4.24016162
32 1.92405594 -6.91172647
33 -1.31721696 1.92405594
34 -0.60411056 -1.31721696
35 -1.09995077 -0.60411056
36 -3.71642541 -1.09995077
37 1.25760706 -3.71642541
38 -6.57854252 1.25760706
39 -0.03974458 -6.57854252
40 1.67820754 -0.03974458
41 -0.81423541 1.67820754
42 1.46738072 -0.81423541
43 0.72974311 1.46738072
44 3.67366436 0.72974311
45 3.65361173 3.67366436
46 3.24297295 3.65361173
47 -1.97784789 3.24297295
48 0.57536215 -1.97784789
49 3.56616292 0.57536215
50 -3.38297123 3.56616292
51 -2.49562094 -3.38297123
52 -1.47486631 -2.49562094
53 -0.75213303 -1.47486631
54 -0.94032501 -0.75213303
55 2.35085749 -0.94032501
56 3.70937157 2.35085749
57 -6.23372261 3.70937157
58 2.45893173 -6.23372261
59 0.29937022 2.45893173
60 -2.99236911 0.29937022
61 3.11506771 -2.99236911
62 -0.61294303 3.11506771
63 -3.43345399 -0.61294303
64 -1.11577946 -3.43345399
65 0.24874230 -1.11577946
66 0.97619623 0.24874230
67 -5.25412641 0.97619623
68 4.97230672 -5.25412641
69 -0.06945679 4.97230672
70 4.64975416 -0.06945679
71 -3.63839826 4.64975416
72 -1.60801676 -3.63839826
73 2.33590450 -1.60801676
74 -0.83800454 2.33590450
75 4.19709761 -0.83800454
76 1.67957881 4.19709761
77 -0.69994415 1.67957881
78 -6.24272845 -0.69994415
79 2.14705881 -6.24272845
80 -2.07372974 2.14705881
81 0.71026286 -2.07372974
82 -0.10420813 0.71026286
83 2.09566840 -0.10420813
84 -2.76574668 2.09566840
85 -1.87358296 -2.76574668
86 3.53187522 -1.87358296
87 -1.88364157 3.53187522
88 -5.68379733 -1.88364157
89 -0.46841132 -5.68379733
90 -3.18052921 -0.46841132
91 1.06490344 -3.18052921
92 0.02927676 1.06490344
93 -2.52445781 0.02927676
94 -4.95428983 -2.52445781
95 3.87057460 -4.95428983
96 2.51147142 3.87057460
97 0.14774444 2.51147142
98 1.75271200 0.14774444
99 -2.46203658 1.75271200
100 2.74265339 -2.46203658
101 2.53737431 2.74265339
102 -0.14010543 2.53737431
103 -2.15411810 -0.14010543
104 -1.84729697 -2.15411810
105 6.82009187 -1.84729697
106 2.66072001 6.82009187
107 6.16824477 2.66072001
108 1.82002727 6.16824477
109 10.07634969 1.82002727
110 -4.85705304 10.07634969
111 -3.29783533 -4.85705304
112 -2.90798350 -3.29783533
113 -1.88716429 -2.90798350
114 2.78998057 -1.88716429
115 1.42008448 2.78998057
116 -1.15888330 1.42008448
117 -0.17412249 -1.15888330
118 -0.98378005 -0.17412249
119 3.34339628 -0.98378005
120 -0.58409156 3.34339628
121 -3.66666233 -0.58409156
122 3.94437748 -3.66666233
123 2.08777584 3.94437748
124 -1.57894329 2.08777584
125 -3.57379500 -1.57894329
126 4.10334986 -3.57379500
127 8.61568806 4.10334986
128 -2.09183834 8.61568806
129 1.28832205 -2.09183834
130 -2.54789211 1.28832205
131 -4.22427040 -2.54789211
132 5.17524060 -4.22427040
133 -6.65011608 5.17524060
134 2.76012324 -6.65011608
135 -2.59410194 2.76012324
136 -5.20443975 -2.59410194
137 -0.31693210 -5.20443975
138 -2.80333509 -0.31693210
139 1.29928829 -2.80333509
140 -1.34093881 1.29928829
141 -2.77813419 -1.34093881
142 -4.55783789 -2.77813419
143 -4.86037011 -4.55783789
144 -3.72175290 -4.86037011
145 6.73064936 -3.72175290
146 -3.37847802 6.73064936
147 2.64834887 -3.37847802
148 -2.32123734 2.64834887
149 2.04803735 -2.32123734
150 4.77697203 2.04803735
151 7.95025967 4.77697203
152 -0.87497194 7.95025967
153 0.72508533 -0.87497194
154 1.80709928 0.72508533
155 0.32560659 1.80709928
156 1.40164108 0.32560659
157 -1.67963859 1.40164108
158 -1.93642096 -1.67963859
159 -0.43849486 -1.93642096
160 -1.04876810 -0.43849486
161 0.51532762 -1.04876810
162 NA 0.51532762
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.11679149 6.46617094
[2,] -5.68346113 3.11679149
[3,] -3.78516057 -5.68346113
[4,] -0.86297841 -3.78516057
[5,] -0.04154352 -0.86297841
[6,] 3.10040637 -0.04154352
[7,] -1.05166671 3.10040637
[8,] 1.06653072 -1.05166671
[9,] 1.86612966 1.06653072
[10,] 2.27640127 1.86612966
[11,] -0.02606638 2.27640127
[12,] 3.32269168 -0.02606638
[13,] 3.50702644 3.32269168
[14,] -3.10312172 3.50702644
[15,] -2.94896275 -3.10312172
[16,] 1.05621783 -2.94896275
[17,] 1.26572123 1.05621783
[18,] 3.18437698 1.26572123
[19,] -3.48230986 3.18437698
[20,] -3.86645661 -3.48230986
[21,] -3.78450723 -3.86645661
[22,] 2.97909788 -3.78450723
[23,] 2.09244959 2.97909788
[24,] 3.10250818 2.09244959
[25,] 6.13408393 3.10250818
[26,] 0.51311465 6.13408393
[27,] -1.86637603 0.51311465
[28,] -2.28186053 -1.86637603
[29,] -0.22980043 -2.28186053
[30,] -4.24016162 -0.22980043
[31,] -6.91172647 -4.24016162
[32,] 1.92405594 -6.91172647
[33,] -1.31721696 1.92405594
[34,] -0.60411056 -1.31721696
[35,] -1.09995077 -0.60411056
[36,] -3.71642541 -1.09995077
[37,] 1.25760706 -3.71642541
[38,] -6.57854252 1.25760706
[39,] -0.03974458 -6.57854252
[40,] 1.67820754 -0.03974458
[41,] -0.81423541 1.67820754
[42,] 1.46738072 -0.81423541
[43,] 0.72974311 1.46738072
[44,] 3.67366436 0.72974311
[45,] 3.65361173 3.67366436
[46,] 3.24297295 3.65361173
[47,] -1.97784789 3.24297295
[48,] 0.57536215 -1.97784789
[49,] 3.56616292 0.57536215
[50,] -3.38297123 3.56616292
[51,] -2.49562094 -3.38297123
[52,] -1.47486631 -2.49562094
[53,] -0.75213303 -1.47486631
[54,] -0.94032501 -0.75213303
[55,] 2.35085749 -0.94032501
[56,] 3.70937157 2.35085749
[57,] -6.23372261 3.70937157
[58,] 2.45893173 -6.23372261
[59,] 0.29937022 2.45893173
[60,] -2.99236911 0.29937022
[61,] 3.11506771 -2.99236911
[62,] -0.61294303 3.11506771
[63,] -3.43345399 -0.61294303
[64,] -1.11577946 -3.43345399
[65,] 0.24874230 -1.11577946
[66,] 0.97619623 0.24874230
[67,] -5.25412641 0.97619623
[68,] 4.97230672 -5.25412641
[69,] -0.06945679 4.97230672
[70,] 4.64975416 -0.06945679
[71,] -3.63839826 4.64975416
[72,] -1.60801676 -3.63839826
[73,] 2.33590450 -1.60801676
[74,] -0.83800454 2.33590450
[75,] 4.19709761 -0.83800454
[76,] 1.67957881 4.19709761
[77,] -0.69994415 1.67957881
[78,] -6.24272845 -0.69994415
[79,] 2.14705881 -6.24272845
[80,] -2.07372974 2.14705881
[81,] 0.71026286 -2.07372974
[82,] -0.10420813 0.71026286
[83,] 2.09566840 -0.10420813
[84,] -2.76574668 2.09566840
[85,] -1.87358296 -2.76574668
[86,] 3.53187522 -1.87358296
[87,] -1.88364157 3.53187522
[88,] -5.68379733 -1.88364157
[89,] -0.46841132 -5.68379733
[90,] -3.18052921 -0.46841132
[91,] 1.06490344 -3.18052921
[92,] 0.02927676 1.06490344
[93,] -2.52445781 0.02927676
[94,] -4.95428983 -2.52445781
[95,] 3.87057460 -4.95428983
[96,] 2.51147142 3.87057460
[97,] 0.14774444 2.51147142
[98,] 1.75271200 0.14774444
[99,] -2.46203658 1.75271200
[100,] 2.74265339 -2.46203658
[101,] 2.53737431 2.74265339
[102,] -0.14010543 2.53737431
[103,] -2.15411810 -0.14010543
[104,] -1.84729697 -2.15411810
[105,] 6.82009187 -1.84729697
[106,] 2.66072001 6.82009187
[107,] 6.16824477 2.66072001
[108,] 1.82002727 6.16824477
[109,] 10.07634969 1.82002727
[110,] -4.85705304 10.07634969
[111,] -3.29783533 -4.85705304
[112,] -2.90798350 -3.29783533
[113,] -1.88716429 -2.90798350
[114,] 2.78998057 -1.88716429
[115,] 1.42008448 2.78998057
[116,] -1.15888330 1.42008448
[117,] -0.17412249 -1.15888330
[118,] -0.98378005 -0.17412249
[119,] 3.34339628 -0.98378005
[120,] -0.58409156 3.34339628
[121,] -3.66666233 -0.58409156
[122,] 3.94437748 -3.66666233
[123,] 2.08777584 3.94437748
[124,] -1.57894329 2.08777584
[125,] -3.57379500 -1.57894329
[126,] 4.10334986 -3.57379500
[127,] 8.61568806 4.10334986
[128,] -2.09183834 8.61568806
[129,] 1.28832205 -2.09183834
[130,] -2.54789211 1.28832205
[131,] -4.22427040 -2.54789211
[132,] 5.17524060 -4.22427040
[133,] -6.65011608 5.17524060
[134,] 2.76012324 -6.65011608
[135,] -2.59410194 2.76012324
[136,] -5.20443975 -2.59410194
[137,] -0.31693210 -5.20443975
[138,] -2.80333509 -0.31693210
[139,] 1.29928829 -2.80333509
[140,] -1.34093881 1.29928829
[141,] -2.77813419 -1.34093881
[142,] -4.55783789 -2.77813419
[143,] -4.86037011 -4.55783789
[144,] -3.72175290 -4.86037011
[145,] 6.73064936 -3.72175290
[146,] -3.37847802 6.73064936
[147,] 2.64834887 -3.37847802
[148,] -2.32123734 2.64834887
[149,] 2.04803735 -2.32123734
[150,] 4.77697203 2.04803735
[151,] 7.95025967 4.77697203
[152,] -0.87497194 7.95025967
[153,] 0.72508533 -0.87497194
[154,] 1.80709928 0.72508533
[155,] 0.32560659 1.80709928
[156,] 1.40164108 0.32560659
[157,] -1.67963859 1.40164108
[158,] -1.93642096 -1.67963859
[159,] -0.43849486 -1.93642096
[160,] -1.04876810 -0.43849486
[161,] 0.51532762 -1.04876810
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.11679149 6.46617094
2 -5.68346113 3.11679149
3 -3.78516057 -5.68346113
4 -0.86297841 -3.78516057
5 -0.04154352 -0.86297841
6 3.10040637 -0.04154352
7 -1.05166671 3.10040637
8 1.06653072 -1.05166671
9 1.86612966 1.06653072
10 2.27640127 1.86612966
11 -0.02606638 2.27640127
12 3.32269168 -0.02606638
13 3.50702644 3.32269168
14 -3.10312172 3.50702644
15 -2.94896275 -3.10312172
16 1.05621783 -2.94896275
17 1.26572123 1.05621783
18 3.18437698 1.26572123
19 -3.48230986 3.18437698
20 -3.86645661 -3.48230986
21 -3.78450723 -3.86645661
22 2.97909788 -3.78450723
23 2.09244959 2.97909788
24 3.10250818 2.09244959
25 6.13408393 3.10250818
26 0.51311465 6.13408393
27 -1.86637603 0.51311465
28 -2.28186053 -1.86637603
29 -0.22980043 -2.28186053
30 -4.24016162 -0.22980043
31 -6.91172647 -4.24016162
32 1.92405594 -6.91172647
33 -1.31721696 1.92405594
34 -0.60411056 -1.31721696
35 -1.09995077 -0.60411056
36 -3.71642541 -1.09995077
37 1.25760706 -3.71642541
38 -6.57854252 1.25760706
39 -0.03974458 -6.57854252
40 1.67820754 -0.03974458
41 -0.81423541 1.67820754
42 1.46738072 -0.81423541
43 0.72974311 1.46738072
44 3.67366436 0.72974311
45 3.65361173 3.67366436
46 3.24297295 3.65361173
47 -1.97784789 3.24297295
48 0.57536215 -1.97784789
49 3.56616292 0.57536215
50 -3.38297123 3.56616292
51 -2.49562094 -3.38297123
52 -1.47486631 -2.49562094
53 -0.75213303 -1.47486631
54 -0.94032501 -0.75213303
55 2.35085749 -0.94032501
56 3.70937157 2.35085749
57 -6.23372261 3.70937157
58 2.45893173 -6.23372261
59 0.29937022 2.45893173
60 -2.99236911 0.29937022
61 3.11506771 -2.99236911
62 -0.61294303 3.11506771
63 -3.43345399 -0.61294303
64 -1.11577946 -3.43345399
65 0.24874230 -1.11577946
66 0.97619623 0.24874230
67 -5.25412641 0.97619623
68 4.97230672 -5.25412641
69 -0.06945679 4.97230672
70 4.64975416 -0.06945679
71 -3.63839826 4.64975416
72 -1.60801676 -3.63839826
73 2.33590450 -1.60801676
74 -0.83800454 2.33590450
75 4.19709761 -0.83800454
76 1.67957881 4.19709761
77 -0.69994415 1.67957881
78 -6.24272845 -0.69994415
79 2.14705881 -6.24272845
80 -2.07372974 2.14705881
81 0.71026286 -2.07372974
82 -0.10420813 0.71026286
83 2.09566840 -0.10420813
84 -2.76574668 2.09566840
85 -1.87358296 -2.76574668
86 3.53187522 -1.87358296
87 -1.88364157 3.53187522
88 -5.68379733 -1.88364157
89 -0.46841132 -5.68379733
90 -3.18052921 -0.46841132
91 1.06490344 -3.18052921
92 0.02927676 1.06490344
93 -2.52445781 0.02927676
94 -4.95428983 -2.52445781
95 3.87057460 -4.95428983
96 2.51147142 3.87057460
97 0.14774444 2.51147142
98 1.75271200 0.14774444
99 -2.46203658 1.75271200
100 2.74265339 -2.46203658
101 2.53737431 2.74265339
102 -0.14010543 2.53737431
103 -2.15411810 -0.14010543
104 -1.84729697 -2.15411810
105 6.82009187 -1.84729697
106 2.66072001 6.82009187
107 6.16824477 2.66072001
108 1.82002727 6.16824477
109 10.07634969 1.82002727
110 -4.85705304 10.07634969
111 -3.29783533 -4.85705304
112 -2.90798350 -3.29783533
113 -1.88716429 -2.90798350
114 2.78998057 -1.88716429
115 1.42008448 2.78998057
116 -1.15888330 1.42008448
117 -0.17412249 -1.15888330
118 -0.98378005 -0.17412249
119 3.34339628 -0.98378005
120 -0.58409156 3.34339628
121 -3.66666233 -0.58409156
122 3.94437748 -3.66666233
123 2.08777584 3.94437748
124 -1.57894329 2.08777584
125 -3.57379500 -1.57894329
126 4.10334986 -3.57379500
127 8.61568806 4.10334986
128 -2.09183834 8.61568806
129 1.28832205 -2.09183834
130 -2.54789211 1.28832205
131 -4.22427040 -2.54789211
132 5.17524060 -4.22427040
133 -6.65011608 5.17524060
134 2.76012324 -6.65011608
135 -2.59410194 2.76012324
136 -5.20443975 -2.59410194
137 -0.31693210 -5.20443975
138 -2.80333509 -0.31693210
139 1.29928829 -2.80333509
140 -1.34093881 1.29928829
141 -2.77813419 -1.34093881
142 -4.55783789 -2.77813419
143 -4.86037011 -4.55783789
144 -3.72175290 -4.86037011
145 6.73064936 -3.72175290
146 -3.37847802 6.73064936
147 2.64834887 -3.37847802
148 -2.32123734 2.64834887
149 2.04803735 -2.32123734
150 4.77697203 2.04803735
151 7.95025967 4.77697203
152 -0.87497194 7.95025967
153 0.72508533 -0.87497194
154 1.80709928 0.72508533
155 0.32560659 1.80709928
156 1.40164108 0.32560659
157 -1.67963859 1.40164108
158 -1.93642096 -1.67963859
159 -0.43849486 -1.93642096
160 -1.04876810 -0.43849486
161 0.51532762 -1.04876810
> 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/fisher/rcomp/tmp/7tajp1355176950.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/fisher/rcomp/tmp/8awwy1355176950.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/fisher/rcomp/tmp/9bdi91355176950.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/fisher/rcomp/tmp/10mjot1355176950.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11xevh1355176950.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/fisher/rcomp/tmp/125vu31355176950.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/fisher/rcomp/tmp/13vnm31355176950.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/fisher/rcomp/tmp/14bzl41355176950.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/fisher/rcomp/tmp/15ru2c1355176950.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/fisher/rcomp/tmp/16mavy1355176950.tab")
+ }
>
> try(system("convert tmp/1zun71355176950.ps tmp/1zun71355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/2l90m1355176950.ps tmp/2l90m1355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/3xjbz1355176950.ps tmp/3xjbz1355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ylvq1355176950.ps tmp/4ylvq1355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/52d891355176950.ps tmp/52d891355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/6kgbz1355176950.ps tmp/6kgbz1355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/7tajp1355176950.ps tmp/7tajp1355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/8awwy1355176950.ps tmp/8awwy1355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/9bdi91355176950.ps tmp/9bdi91355176950.png",intern=TRUE))
character(0)
> try(system("convert tmp/10mjot1355176950.ps tmp/10mjot1355176950.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.544 1.499 9.046