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(15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,13
+ ,9
+ ,14
+ ,14
+ ,6
+ ,16
+ ,11
+ ,16
+ ,16
+ ,7
+ ,14
+ ,12
+ ,13
+ ,13
+ ,6
+ ,16
+ ,11
+ ,13
+ ,14
+ ,7
+ ,10
+ ,12
+ ,5
+ ,13
+ ,6
+ ,8
+ ,12
+ ,8
+ ,13
+ ,4
+ ,12
+ ,11
+ ,14
+ ,13
+ ,5
+ ,15
+ ,11
+ ,15
+ ,15
+ ,8
+ ,14
+ ,12
+ ,8
+ ,14
+ ,4
+ ,14
+ ,6
+ ,13
+ ,12
+ ,6
+ ,12
+ ,13
+ ,12
+ ,12
+ ,6
+ ,12
+ ,11
+ ,11
+ ,12
+ ,5
+ ,10
+ ,12
+ ,8
+ ,11
+ ,4
+ ,4
+ ,10
+ ,4
+ ,10
+ ,2
+ ,14
+ ,11
+ ,15
+ ,15
+ ,8
+ ,15
+ ,12
+ ,12
+ ,16
+ ,7
+ ,16
+ ,12
+ ,14
+ ,14
+ ,6
+ ,12
+ ,12
+ ,9
+ ,13
+ ,4
+ ,12
+ ,11
+ ,16
+ ,13
+ ,4
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,12
+ ,12
+ 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 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 = '3'
> #'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
KnowingPeople Popularity FindingFriends Liked Celebrity
1 12 15 10 16 6
2 7 12 9 12 6
3 11 9 12 11 4
4 11 10 12 12 6
5 14 13 9 14 6
6 16 16 11 16 7
7 13 14 12 13 6
8 13 16 11 14 7
9 5 10 12 13 6
10 8 8 12 13 4
11 14 12 11 13 5
12 15 15 11 15 8
13 8 14 12 14 4
14 13 14 6 12 6
15 12 12 13 12 6
16 11 12 11 12 5
17 8 10 12 11 4
18 4 4 10 10 2
19 15 14 11 15 8
20 12 15 12 16 7
21 14 16 12 14 6
22 9 12 12 13 4
23 16 12 11 13 4
24 10 12 12 13 4
25 8 12 12 13 5
26 14 12 12 14 4
27 6 11 6 9 4
28 16 11 5 14 6
29 11 11 12 12 6
30 7 11 14 13 6
31 13 11 12 11 4
32 7 11 9 13 2
33 14 15 11 15 7
34 17 15 11 16 6
35 15 9 11 15 7
36 8 16 12 14 4
37 8 13 10 8 4
38 11 9 12 11 4
39 16 16 11 15 6
40 10 12 12 15 6
41 5 15 9 11 3
42 8 5 15 12 3
43 8 11 11 12 6
44 15 17 11 14 5
45 6 9 15 8 4
46 16 13 12 16 6
47 16 16 9 16 6
48 16 16 12 14 6
49 19 14 9 12 6
50 14 16 11 15 6
51 15 11 12 12 6
52 11 11 11 14 5
53 14 11 6 17 6
54 12 12 10 13 6
55 15 12 12 13 6
56 14 12 13 12 5
57 13 14 11 16 6
58 11 10 10 12 5
59 8 9 11 10 4
60 11 12 7 15 5
61 9 10 11 12 4
62 10 14 11 16 6
63 4 8 7 13 6
64 15 16 12 15 7
65 17 14 14 18 6
66 12 14 11 12 4
67 12 12 12 13 4
68 15 14 11 14 6
69 13 7 12 12 3
70 15 19 12 15 6
71 14 15 12 16 4
72 8 8 12 14 5
73 15 10 15 15 6
74 12 13 11 13 7
75 14 13 13 13 3
76 10 10 10 11 5
77 7 12 12 12 3
78 16 15 13 18 8
79 12 7 14 12 4
80 15 14 11 16 6
81 7 10 11 9 4
82 9 6 7 11 4
83 15 11 11 10 5
84 7 12 12 11 4
85 15 14 12 13 6
86 14 12 10 13 7
87 14 14 12 15 7
88 8 11 8 13 4
89 8 10 7 9 5
90 14 13 11 13 6
91 10 8 11 12 4
92 12 9 11 13 5
93 15 6 9 11 6
94 12 12 12 14 5
95 13 14 13 13 5
96 12 11 9 12 4
97 10 8 11 15 2
98 8 7 12 12 3
99 6 9 9 12 5
100 13 14 12 13 5
101 7 13 12 12 5
102 13 15 12 13 6
103 4 5 14 5 2
104 14 15 11 13 5
105 13 13 12 13 5
106 13 12 8 13 5
107 6 6 12 11 2
108 7 7 12 12 4
109 5 13 12 12 3
110 14 16 11 15 8
111 13 10 11 15 6
112 16 16 12 16 7
113 16 15 10 13 6
114 7 8 13 10 3
115 14 11 8 15 5
116 11 13 12 13 6
117 17 16 11 16 7
118 5 11 10 13 3
119 10 14 13 16 8
120 11 9 10 13 3
121 10 8 10 14 3
122 9 8 7 15 4
123 12 11 10 14 5
124 15 12 8 13 7
125 7 11 12 13 6
126 13 14 12 15 6
127 8 11 12 16 6
128 16 14 11 12 5
129 15 13 13 14 6
130 6 12 12 14 5
131 6 4 8 4 4
132 12 15 11 13 6
133 8 10 12 16 4
134 11 13 13 15 6
135 13 15 12 14 6
136 14 12 10 14 5
137 14 13 12 14 6
138 10 8 10 6 4
139 4 10 13 13 6
140 16 15 11 14 6
141 12 16 12 15 8
142 15 16 12 16 7
143 12 14 10 15 6
144 14 14 11 12 6
145 11 12 11 14 2
146 16 15 11 11 5
147 14 13 8 14 5
148 14 16 11 14 6
149 15 14 12 14 6
150 9 8 11 12 4
151 15 16 12 14 6
152 14 16 12 16 8
153 15 12 12 13 6
154 10 11 8 14 5
155 14 16 12 16 8
156 9 9 11 12 4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity FindingFriends Liked Celebrity
0.70477 0.38811 -0.07209 0.26767 0.66952
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.1457 -1.5530 0.2044 1.7720 6.2812
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.70477 1.79737 0.392 0.695528
Popularity 0.38811 0.09769 3.973 0.000110 ***
FindingFriends -0.07209 0.12131 -0.594 0.553257
Liked 0.26767 0.12500 2.141 0.033851 *
Celebrity 0.66952 0.19983 3.351 0.001019 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.656 on 151 degrees of freedom
Multiple R-squared: 0.4263, Adjusted R-squared: 0.4111
F-statistic: 28.05 on 4 and 151 DF, p-value: < 2.2e-16
> 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.5315176 0.93696480 0.468482398
[2,] 0.8139124 0.37217512 0.186087561
[3,] 0.7202824 0.55943512 0.279717558
[4,] 0.6579046 0.68419074 0.342095369
[5,] 0.6820462 0.63590760 0.317953802
[6,] 0.8396970 0.32060599 0.160302993
[7,] 0.7776533 0.44469350 0.222346748
[8,] 0.7086309 0.58273829 0.291369147
[9,] 0.6267099 0.74658030 0.373290148
[10,] 0.5514772 0.89704568 0.448522838
[11,] 0.4685318 0.93706356 0.531468222
[12,] 0.4033635 0.80672697 0.596636513
[13,] 0.3581301 0.71626012 0.641869942
[14,] 0.2896638 0.57932764 0.710336180
[15,] 0.2336596 0.46731924 0.766340378
[16,] 0.4998969 0.99979381 0.500103095
[17,] 0.4309986 0.86199728 0.569001362
[18,] 0.4396817 0.87936331 0.560318344
[19,] 0.4817293 0.96345866 0.518270672
[20,] 0.4986788 0.99735761 0.501321195
[21,] 0.5698679 0.86026416 0.430132078
[22,] 0.5153708 0.96925849 0.484629246
[23,] 0.5482344 0.90353120 0.451765599
[24,] 0.6248742 0.75025168 0.375125841
[25,] 0.6317080 0.73658406 0.368292032
[26,] 0.5743976 0.85120480 0.425602400
[27,] 0.5802948 0.83941041 0.419705203
[28,] 0.5867812 0.82643767 0.413218837
[29,] 0.6440656 0.71186890 0.355934449
[30,] 0.6037171 0.79256590 0.396282948
[31,] 0.6019845 0.79603097 0.398015483
[32,] 0.5832037 0.83359259 0.416796293
[33,] 0.5800669 0.83986626 0.419933130
[34,] 0.6956764 0.60864728 0.304323641
[35,] 0.6561904 0.68761914 0.343809572
[36,] 0.6704737 0.65905254 0.329526268
[37,] 0.6602851 0.67942975 0.339714876
[38,] 0.6261742 0.74765165 0.373825825
[39,] 0.6199880 0.76002402 0.380012012
[40,] 0.5798488 0.84030249 0.420151246
[41,] 0.5819429 0.83611419 0.418057093
[42,] 0.8104238 0.37915242 0.189576211
[43,] 0.7744665 0.45106704 0.225533518
[44,] 0.8118140 0.37637195 0.188185977
[45,] 0.7773126 0.44537481 0.222687403
[46,] 0.7477959 0.50440826 0.252204132
[47,] 0.7067535 0.58649309 0.293246544
[48,] 0.7182775 0.56344490 0.281722452
[49,] 0.7364600 0.52707990 0.263539950
[50,] 0.7003078 0.59938432 0.299692162
[51,] 0.6587987 0.68240252 0.341201259
[52,] 0.6162909 0.76741821 0.383709104
[53,] 0.5820547 0.83589061 0.417945306
[54,] 0.5368919 0.92621629 0.463108143
[55,] 0.5841501 0.83169982 0.415849908
[56,] 0.8039975 0.39200502 0.196002512
[57,] 0.7694634 0.46107328 0.230536642
[58,] 0.7744962 0.45100767 0.225503835
[59,] 0.7429369 0.51412617 0.257063084
[60,] 0.7142030 0.57159406 0.285797030
[61,] 0.6923966 0.61520681 0.307603407
[62,] 0.8025772 0.39484553 0.197422764
[63,] 0.7689882 0.46202362 0.231011810
[64,] 0.7393778 0.52124449 0.260622243
[65,] 0.7240883 0.55182341 0.275911707
[66,] 0.7606446 0.47871087 0.239355433
[67,] 0.7288307 0.54233858 0.271169290
[68,] 0.7643705 0.47125904 0.235629521
[69,] 0.7286923 0.54261531 0.271307655
[70,] 0.7301772 0.53964567 0.269822835
[71,] 0.6993177 0.60136466 0.300682329
[72,] 0.7654787 0.46904254 0.234521271
[73,] 0.7390006 0.52199876 0.260999378
[74,] 0.7234688 0.55306232 0.276531160
[75,] 0.6905904 0.61881927 0.309409637
[76,] 0.7821307 0.43573851 0.217869253
[77,] 0.7977443 0.40451143 0.202255714
[78,] 0.7898901 0.42021975 0.210109876
[79,] 0.7621860 0.47562807 0.237814035
[80,] 0.7268709 0.54625814 0.273129072
[81,] 0.7477374 0.50452521 0.252262607
[82,] 0.7803364 0.43932725 0.219663623
[83,] 0.7558320 0.48833594 0.244167972
[84,] 0.7276070 0.54478598 0.272392988
[85,] 0.7167403 0.56651943 0.283259714
[86,] 0.8776259 0.24474829 0.122374145
[87,] 0.8557872 0.28842557 0.144212784
[88,] 0.8322430 0.33551406 0.167757031
[89,] 0.8088812 0.38223762 0.191118812
[90,] 0.8026560 0.39468797 0.197343985
[91,] 0.7831986 0.43360279 0.216801395
[92,] 0.8428329 0.31433423 0.157167116
[93,] 0.8145567 0.37088663 0.185443315
[94,] 0.8815302 0.23693950 0.118469750
[95,] 0.8555509 0.28889817 0.144449083
[96,] 0.8257680 0.34846392 0.174231959
[97,] 0.7964329 0.40713413 0.203567066
[98,] 0.7709515 0.45809703 0.229048514
[99,] 0.7375449 0.52491011 0.262455054
[100,] 0.7033760 0.59324794 0.296623972
[101,] 0.6705825 0.65883498 0.329417489
[102,] 0.8601212 0.27975751 0.139878753
[103,] 0.8403819 0.31923616 0.159618078
[104,] 0.8731244 0.25375128 0.126875638
[105,] 0.8539259 0.29214819 0.146074094
[106,] 0.8339723 0.33205535 0.166027675
[107,] 0.7987578 0.40248436 0.201242181
[108,] 0.7876824 0.42463522 0.212317610
[109,] 0.7529080 0.49418397 0.247091983
[110,] 0.7382311 0.52353779 0.261768894
[111,] 0.9306931 0.13861382 0.069306910
[112,] 0.9326985 0.13460297 0.067301486
[113,] 0.9207883 0.15842342 0.079211709
[114,] 0.9147961 0.17040785 0.085203924
[115,] 0.8899046 0.22019079 0.110095397
[116,] 0.8683649 0.26327025 0.131635123
[117,] 0.8772558 0.24548837 0.122744186
[118,] 0.8954690 0.20906196 0.104530979
[119,] 0.8642699 0.27146011 0.135730055
[120,] 0.8497554 0.30048918 0.150244590
[121,] 0.8448254 0.31034914 0.155174571
[122,] 0.8918895 0.21622091 0.108110454
[123,] 0.9669168 0.06616633 0.033083163
[124,] 0.9535894 0.09282117 0.046410585
[125,] 0.9601977 0.07960467 0.039802335
[126,] 0.9434043 0.11319139 0.056595693
[127,] 0.9187920 0.16241597 0.081207986
[128,] 0.8930002 0.21399960 0.106999798
[129,] 0.8925285 0.21494294 0.107471469
[130,] 0.8895202 0.22095959 0.110479793
[131,] 0.8524268 0.29514635 0.147573174
[132,] 0.9865618 0.02687642 0.013438211
[133,] 0.9848939 0.03021210 0.015106051
[134,] 0.9940319 0.01193614 0.005968071
[135,] 0.9882554 0.02348913 0.011744563
[136,] 0.9781534 0.04369318 0.021846590
[137,] 0.9605875 0.07882499 0.039412494
[138,] 0.9304924 0.13901514 0.069507568
[139,] 0.9186516 0.16269678 0.081348389
[140,] 0.9298172 0.14036560 0.070182800
[141,] 0.9086987 0.18260263 0.091301315
> postscript(file="/var/www/rcomp/tmp/1kqpi1292593591.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/2kqpi1292593591.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/3vho31292593591.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/4vho31292593591.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/5vho31292593591.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 = 156
Frequency = 1
1 2 3 4 5 6
-2.10549595 -4.94255407 2.04475950 0.04992961 1.13398824 0.90895517
7 8 9 10 11 12
0.22980651 -1.55569979 -6.21774291 -1.10247289 2.60346803 -0.10478202
13 14 15 16 17 18
-3.69882129 0.06496224 0.34579045 -0.12885945 -1.34335315 -1.55213230
19 20 21 22 23 24
0.28333062 -2.63084605 0.18590870 -1.65492348 5.27299039 -0.65492348
25 26 27 28 29 30
-3.32444584 3.07740400 -3.62863755 3.62186901 -0.33818303 -4.46168329
31 32 33 34 35 36
3.26853420 -2.14402451 -0.43525966 2.96659018 2.89341622 -4.47504659
37 38 39 40 41 42
-1.84884580 2.04475950 1.84615005 -2.52931323 -5.83065242 1.21531832
43 44 45 46 47 48
-3.41026917 1.39523228 -1.93596456 2.81490160 1.43430527 2.18590870
49 50 51 52 53 54
6.28122063 -0.15384995 3.66181697 -0.27609184 0.89093759 -0.13814046
55 56 57 58 59 60
3.00603180 3.01531281 -0.64529718 0.57527971 -0.75965412 -1.22022153
61 62 63 64 65 66
-0.68311180 -3.64529718 -6.80194827 0.24871382 3.03561618 0.76443761
67 68 69 70 71 72
1.34507652 1.89004786 5.22283463 -0.24610176 1.37772103 -2.03966777
73 74 75 76 77 78
3.46317045 -1.12368934 3.69857236 -0.15704777 -2.71772860 0.23637269
79 80 81 82 83 84
3.69748453 1.35470282 -1.88009425 0.84866678 4.79459823 -3.11957845
85 86 87 88 89 90
2.22980651 1.19233718 0.02493911 -2.55515536 -1.83796113 1.54583302
91 92 93 94 95 96
1.09311349 1.76780597 5.65379432 0.40788164 0.97141500 1.78460329
97 98 99 100 101 102
1.62914066 0.22283463 -4.10869377 0.89932887 -4.44488597 -0.15830614
103 104 105 106 107 108
-0.31353783 1.43913009 1.28744151 1.38720964 -0.45185785 -1.44668773
109 110 111 112 113 114
-5.10584125 -1.49289467 1.17482593 0.98104130 2.69752160 -0.55784685
115 116 117 118 119 120
2.23997725 -1.38208085 1.90895517 -4.74146074 -4.84016963 2.03476456
121 122 123 124 125 126
1.15520469 -0.99824858 0.65182203 2.04816492 -4.60585555 -0.30553853
127 128 129 130 131 132
-4.40887310 4.09491525 2.42233277 -5.59211836 0.57068583 -1.23039227
133 134 135 136 137 138
-2.68171574 -1.84533975 -0.42597866 2.26370938 1.35024664 2.62706247
139 140 141 142 143 144
-7.14565677 2.50193521 -3.42080854 -0.01895870 -1.44971079 1.42539289
145 146 147 148 149 150
1.34436259 3.97447512 1.73142447 0.11382257 1.96213399 0.09311349
151 152 153 154 155 156
1.18590870 -1.68848106 3.00603180 -1.49235023 -1.68848106 -0.29499915
> postscript(file="/var/www/rcomp/tmp/6nqn61292593591.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.10549595 NA
1 -4.94255407 -2.10549595
2 2.04475950 -4.94255407
3 0.04992961 2.04475950
4 1.13398824 0.04992961
5 0.90895517 1.13398824
6 0.22980651 0.90895517
7 -1.55569979 0.22980651
8 -6.21774291 -1.55569979
9 -1.10247289 -6.21774291
10 2.60346803 -1.10247289
11 -0.10478202 2.60346803
12 -3.69882129 -0.10478202
13 0.06496224 -3.69882129
14 0.34579045 0.06496224
15 -0.12885945 0.34579045
16 -1.34335315 -0.12885945
17 -1.55213230 -1.34335315
18 0.28333062 -1.55213230
19 -2.63084605 0.28333062
20 0.18590870 -2.63084605
21 -1.65492348 0.18590870
22 5.27299039 -1.65492348
23 -0.65492348 5.27299039
24 -3.32444584 -0.65492348
25 3.07740400 -3.32444584
26 -3.62863755 3.07740400
27 3.62186901 -3.62863755
28 -0.33818303 3.62186901
29 -4.46168329 -0.33818303
30 3.26853420 -4.46168329
31 -2.14402451 3.26853420
32 -0.43525966 -2.14402451
33 2.96659018 -0.43525966
34 2.89341622 2.96659018
35 -4.47504659 2.89341622
36 -1.84884580 -4.47504659
37 2.04475950 -1.84884580
38 1.84615005 2.04475950
39 -2.52931323 1.84615005
40 -5.83065242 -2.52931323
41 1.21531832 -5.83065242
42 -3.41026917 1.21531832
43 1.39523228 -3.41026917
44 -1.93596456 1.39523228
45 2.81490160 -1.93596456
46 1.43430527 2.81490160
47 2.18590870 1.43430527
48 6.28122063 2.18590870
49 -0.15384995 6.28122063
50 3.66181697 -0.15384995
51 -0.27609184 3.66181697
52 0.89093759 -0.27609184
53 -0.13814046 0.89093759
54 3.00603180 -0.13814046
55 3.01531281 3.00603180
56 -0.64529718 3.01531281
57 0.57527971 -0.64529718
58 -0.75965412 0.57527971
59 -1.22022153 -0.75965412
60 -0.68311180 -1.22022153
61 -3.64529718 -0.68311180
62 -6.80194827 -3.64529718
63 0.24871382 -6.80194827
64 3.03561618 0.24871382
65 0.76443761 3.03561618
66 1.34507652 0.76443761
67 1.89004786 1.34507652
68 5.22283463 1.89004786
69 -0.24610176 5.22283463
70 1.37772103 -0.24610176
71 -2.03966777 1.37772103
72 3.46317045 -2.03966777
73 -1.12368934 3.46317045
74 3.69857236 -1.12368934
75 -0.15704777 3.69857236
76 -2.71772860 -0.15704777
77 0.23637269 -2.71772860
78 3.69748453 0.23637269
79 1.35470282 3.69748453
80 -1.88009425 1.35470282
81 0.84866678 -1.88009425
82 4.79459823 0.84866678
83 -3.11957845 4.79459823
84 2.22980651 -3.11957845
85 1.19233718 2.22980651
86 0.02493911 1.19233718
87 -2.55515536 0.02493911
88 -1.83796113 -2.55515536
89 1.54583302 -1.83796113
90 1.09311349 1.54583302
91 1.76780597 1.09311349
92 5.65379432 1.76780597
93 0.40788164 5.65379432
94 0.97141500 0.40788164
95 1.78460329 0.97141500
96 1.62914066 1.78460329
97 0.22283463 1.62914066
98 -4.10869377 0.22283463
99 0.89932887 -4.10869377
100 -4.44488597 0.89932887
101 -0.15830614 -4.44488597
102 -0.31353783 -0.15830614
103 1.43913009 -0.31353783
104 1.28744151 1.43913009
105 1.38720964 1.28744151
106 -0.45185785 1.38720964
107 -1.44668773 -0.45185785
108 -5.10584125 -1.44668773
109 -1.49289467 -5.10584125
110 1.17482593 -1.49289467
111 0.98104130 1.17482593
112 2.69752160 0.98104130
113 -0.55784685 2.69752160
114 2.23997725 -0.55784685
115 -1.38208085 2.23997725
116 1.90895517 -1.38208085
117 -4.74146074 1.90895517
118 -4.84016963 -4.74146074
119 2.03476456 -4.84016963
120 1.15520469 2.03476456
121 -0.99824858 1.15520469
122 0.65182203 -0.99824858
123 2.04816492 0.65182203
124 -4.60585555 2.04816492
125 -0.30553853 -4.60585555
126 -4.40887310 -0.30553853
127 4.09491525 -4.40887310
128 2.42233277 4.09491525
129 -5.59211836 2.42233277
130 0.57068583 -5.59211836
131 -1.23039227 0.57068583
132 -2.68171574 -1.23039227
133 -1.84533975 -2.68171574
134 -0.42597866 -1.84533975
135 2.26370938 -0.42597866
136 1.35024664 2.26370938
137 2.62706247 1.35024664
138 -7.14565677 2.62706247
139 2.50193521 -7.14565677
140 -3.42080854 2.50193521
141 -0.01895870 -3.42080854
142 -1.44971079 -0.01895870
143 1.42539289 -1.44971079
144 1.34436259 1.42539289
145 3.97447512 1.34436259
146 1.73142447 3.97447512
147 0.11382257 1.73142447
148 1.96213399 0.11382257
149 0.09311349 1.96213399
150 1.18590870 0.09311349
151 -1.68848106 1.18590870
152 3.00603180 -1.68848106
153 -1.49235023 3.00603180
154 -1.68848106 -1.49235023
155 -0.29499915 -1.68848106
156 NA -0.29499915
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -4.94255407 -2.10549595
[2,] 2.04475950 -4.94255407
[3,] 0.04992961 2.04475950
[4,] 1.13398824 0.04992961
[5,] 0.90895517 1.13398824
[6,] 0.22980651 0.90895517
[7,] -1.55569979 0.22980651
[8,] -6.21774291 -1.55569979
[9,] -1.10247289 -6.21774291
[10,] 2.60346803 -1.10247289
[11,] -0.10478202 2.60346803
[12,] -3.69882129 -0.10478202
[13,] 0.06496224 -3.69882129
[14,] 0.34579045 0.06496224
[15,] -0.12885945 0.34579045
[16,] -1.34335315 -0.12885945
[17,] -1.55213230 -1.34335315
[18,] 0.28333062 -1.55213230
[19,] -2.63084605 0.28333062
[20,] 0.18590870 -2.63084605
[21,] -1.65492348 0.18590870
[22,] 5.27299039 -1.65492348
[23,] -0.65492348 5.27299039
[24,] -3.32444584 -0.65492348
[25,] 3.07740400 -3.32444584
[26,] -3.62863755 3.07740400
[27,] 3.62186901 -3.62863755
[28,] -0.33818303 3.62186901
[29,] -4.46168329 -0.33818303
[30,] 3.26853420 -4.46168329
[31,] -2.14402451 3.26853420
[32,] -0.43525966 -2.14402451
[33,] 2.96659018 -0.43525966
[34,] 2.89341622 2.96659018
[35,] -4.47504659 2.89341622
[36,] -1.84884580 -4.47504659
[37,] 2.04475950 -1.84884580
[38,] 1.84615005 2.04475950
[39,] -2.52931323 1.84615005
[40,] -5.83065242 -2.52931323
[41,] 1.21531832 -5.83065242
[42,] -3.41026917 1.21531832
[43,] 1.39523228 -3.41026917
[44,] -1.93596456 1.39523228
[45,] 2.81490160 -1.93596456
[46,] 1.43430527 2.81490160
[47,] 2.18590870 1.43430527
[48,] 6.28122063 2.18590870
[49,] -0.15384995 6.28122063
[50,] 3.66181697 -0.15384995
[51,] -0.27609184 3.66181697
[52,] 0.89093759 -0.27609184
[53,] -0.13814046 0.89093759
[54,] 3.00603180 -0.13814046
[55,] 3.01531281 3.00603180
[56,] -0.64529718 3.01531281
[57,] 0.57527971 -0.64529718
[58,] -0.75965412 0.57527971
[59,] -1.22022153 -0.75965412
[60,] -0.68311180 -1.22022153
[61,] -3.64529718 -0.68311180
[62,] -6.80194827 -3.64529718
[63,] 0.24871382 -6.80194827
[64,] 3.03561618 0.24871382
[65,] 0.76443761 3.03561618
[66,] 1.34507652 0.76443761
[67,] 1.89004786 1.34507652
[68,] 5.22283463 1.89004786
[69,] -0.24610176 5.22283463
[70,] 1.37772103 -0.24610176
[71,] -2.03966777 1.37772103
[72,] 3.46317045 -2.03966777
[73,] -1.12368934 3.46317045
[74,] 3.69857236 -1.12368934
[75,] -0.15704777 3.69857236
[76,] -2.71772860 -0.15704777
[77,] 0.23637269 -2.71772860
[78,] 3.69748453 0.23637269
[79,] 1.35470282 3.69748453
[80,] -1.88009425 1.35470282
[81,] 0.84866678 -1.88009425
[82,] 4.79459823 0.84866678
[83,] -3.11957845 4.79459823
[84,] 2.22980651 -3.11957845
[85,] 1.19233718 2.22980651
[86,] 0.02493911 1.19233718
[87,] -2.55515536 0.02493911
[88,] -1.83796113 -2.55515536
[89,] 1.54583302 -1.83796113
[90,] 1.09311349 1.54583302
[91,] 1.76780597 1.09311349
[92,] 5.65379432 1.76780597
[93,] 0.40788164 5.65379432
[94,] 0.97141500 0.40788164
[95,] 1.78460329 0.97141500
[96,] 1.62914066 1.78460329
[97,] 0.22283463 1.62914066
[98,] -4.10869377 0.22283463
[99,] 0.89932887 -4.10869377
[100,] -4.44488597 0.89932887
[101,] -0.15830614 -4.44488597
[102,] -0.31353783 -0.15830614
[103,] 1.43913009 -0.31353783
[104,] 1.28744151 1.43913009
[105,] 1.38720964 1.28744151
[106,] -0.45185785 1.38720964
[107,] -1.44668773 -0.45185785
[108,] -5.10584125 -1.44668773
[109,] -1.49289467 -5.10584125
[110,] 1.17482593 -1.49289467
[111,] 0.98104130 1.17482593
[112,] 2.69752160 0.98104130
[113,] -0.55784685 2.69752160
[114,] 2.23997725 -0.55784685
[115,] -1.38208085 2.23997725
[116,] 1.90895517 -1.38208085
[117,] -4.74146074 1.90895517
[118,] -4.84016963 -4.74146074
[119,] 2.03476456 -4.84016963
[120,] 1.15520469 2.03476456
[121,] -0.99824858 1.15520469
[122,] 0.65182203 -0.99824858
[123,] 2.04816492 0.65182203
[124,] -4.60585555 2.04816492
[125,] -0.30553853 -4.60585555
[126,] -4.40887310 -0.30553853
[127,] 4.09491525 -4.40887310
[128,] 2.42233277 4.09491525
[129,] -5.59211836 2.42233277
[130,] 0.57068583 -5.59211836
[131,] -1.23039227 0.57068583
[132,] -2.68171574 -1.23039227
[133,] -1.84533975 -2.68171574
[134,] -0.42597866 -1.84533975
[135,] 2.26370938 -0.42597866
[136,] 1.35024664 2.26370938
[137,] 2.62706247 1.35024664
[138,] -7.14565677 2.62706247
[139,] 2.50193521 -7.14565677
[140,] -3.42080854 2.50193521
[141,] -0.01895870 -3.42080854
[142,] -1.44971079 -0.01895870
[143,] 1.42539289 -1.44971079
[144,] 1.34436259 1.42539289
[145,] 3.97447512 1.34436259
[146,] 1.73142447 3.97447512
[147,] 0.11382257 1.73142447
[148,] 1.96213399 0.11382257
[149,] 0.09311349 1.96213399
[150,] 1.18590870 0.09311349
[151,] -1.68848106 1.18590870
[152,] 3.00603180 -1.68848106
[153,] -1.49235023 3.00603180
[154,] -1.68848106 -1.49235023
[155,] -0.29499915 -1.68848106
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -4.94255407 -2.10549595
2 2.04475950 -4.94255407
3 0.04992961 2.04475950
4 1.13398824 0.04992961
5 0.90895517 1.13398824
6 0.22980651 0.90895517
7 -1.55569979 0.22980651
8 -6.21774291 -1.55569979
9 -1.10247289 -6.21774291
10 2.60346803 -1.10247289
11 -0.10478202 2.60346803
12 -3.69882129 -0.10478202
13 0.06496224 -3.69882129
14 0.34579045 0.06496224
15 -0.12885945 0.34579045
16 -1.34335315 -0.12885945
17 -1.55213230 -1.34335315
18 0.28333062 -1.55213230
19 -2.63084605 0.28333062
20 0.18590870 -2.63084605
21 -1.65492348 0.18590870
22 5.27299039 -1.65492348
23 -0.65492348 5.27299039
24 -3.32444584 -0.65492348
25 3.07740400 -3.32444584
26 -3.62863755 3.07740400
27 3.62186901 -3.62863755
28 -0.33818303 3.62186901
29 -4.46168329 -0.33818303
30 3.26853420 -4.46168329
31 -2.14402451 3.26853420
32 -0.43525966 -2.14402451
33 2.96659018 -0.43525966
34 2.89341622 2.96659018
35 -4.47504659 2.89341622
36 -1.84884580 -4.47504659
37 2.04475950 -1.84884580
38 1.84615005 2.04475950
39 -2.52931323 1.84615005
40 -5.83065242 -2.52931323
41 1.21531832 -5.83065242
42 -3.41026917 1.21531832
43 1.39523228 -3.41026917
44 -1.93596456 1.39523228
45 2.81490160 -1.93596456
46 1.43430527 2.81490160
47 2.18590870 1.43430527
48 6.28122063 2.18590870
49 -0.15384995 6.28122063
50 3.66181697 -0.15384995
51 -0.27609184 3.66181697
52 0.89093759 -0.27609184
53 -0.13814046 0.89093759
54 3.00603180 -0.13814046
55 3.01531281 3.00603180
56 -0.64529718 3.01531281
57 0.57527971 -0.64529718
58 -0.75965412 0.57527971
59 -1.22022153 -0.75965412
60 -0.68311180 -1.22022153
61 -3.64529718 -0.68311180
62 -6.80194827 -3.64529718
63 0.24871382 -6.80194827
64 3.03561618 0.24871382
65 0.76443761 3.03561618
66 1.34507652 0.76443761
67 1.89004786 1.34507652
68 5.22283463 1.89004786
69 -0.24610176 5.22283463
70 1.37772103 -0.24610176
71 -2.03966777 1.37772103
72 3.46317045 -2.03966777
73 -1.12368934 3.46317045
74 3.69857236 -1.12368934
75 -0.15704777 3.69857236
76 -2.71772860 -0.15704777
77 0.23637269 -2.71772860
78 3.69748453 0.23637269
79 1.35470282 3.69748453
80 -1.88009425 1.35470282
81 0.84866678 -1.88009425
82 4.79459823 0.84866678
83 -3.11957845 4.79459823
84 2.22980651 -3.11957845
85 1.19233718 2.22980651
86 0.02493911 1.19233718
87 -2.55515536 0.02493911
88 -1.83796113 -2.55515536
89 1.54583302 -1.83796113
90 1.09311349 1.54583302
91 1.76780597 1.09311349
92 5.65379432 1.76780597
93 0.40788164 5.65379432
94 0.97141500 0.40788164
95 1.78460329 0.97141500
96 1.62914066 1.78460329
97 0.22283463 1.62914066
98 -4.10869377 0.22283463
99 0.89932887 -4.10869377
100 -4.44488597 0.89932887
101 -0.15830614 -4.44488597
102 -0.31353783 -0.15830614
103 1.43913009 -0.31353783
104 1.28744151 1.43913009
105 1.38720964 1.28744151
106 -0.45185785 1.38720964
107 -1.44668773 -0.45185785
108 -5.10584125 -1.44668773
109 -1.49289467 -5.10584125
110 1.17482593 -1.49289467
111 0.98104130 1.17482593
112 2.69752160 0.98104130
113 -0.55784685 2.69752160
114 2.23997725 -0.55784685
115 -1.38208085 2.23997725
116 1.90895517 -1.38208085
117 -4.74146074 1.90895517
118 -4.84016963 -4.74146074
119 2.03476456 -4.84016963
120 1.15520469 2.03476456
121 -0.99824858 1.15520469
122 0.65182203 -0.99824858
123 2.04816492 0.65182203
124 -4.60585555 2.04816492
125 -0.30553853 -4.60585555
126 -4.40887310 -0.30553853
127 4.09491525 -4.40887310
128 2.42233277 4.09491525
129 -5.59211836 2.42233277
130 0.57068583 -5.59211836
131 -1.23039227 0.57068583
132 -2.68171574 -1.23039227
133 -1.84533975 -2.68171574
134 -0.42597866 -1.84533975
135 2.26370938 -0.42597866
136 1.35024664 2.26370938
137 2.62706247 1.35024664
138 -7.14565677 2.62706247
139 2.50193521 -7.14565677
140 -3.42080854 2.50193521
141 -0.01895870 -3.42080854
142 -1.44971079 -0.01895870
143 1.42539289 -1.44971079
144 1.34436259 1.42539289
145 3.97447512 1.34436259
146 1.73142447 3.97447512
147 0.11382257 1.73142447
148 1.96213399 0.11382257
149 0.09311349 1.96213399
150 1.18590870 0.09311349
151 -1.68848106 1.18590870
152 3.00603180 -1.68848106
153 -1.49235023 3.00603180
154 -1.68848106 -1.49235023
155 -0.29499915 -1.68848106
> 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/7yznr1292593591.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/8yznr1292593591.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/9yznr1292593591.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/1099mu1292593591.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/11n15c1292593592.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/12824i1292593592.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/13mt191292593592.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/14pcix1292593592.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/15bug31292593592.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/16p4et1292593592.tab")
+ }
>
> try(system("convert tmp/1kqpi1292593591.ps tmp/1kqpi1292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/2kqpi1292593591.ps tmp/2kqpi1292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vho31292593591.ps tmp/3vho31292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/4vho31292593591.ps tmp/4vho31292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/5vho31292593591.ps tmp/5vho31292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/6nqn61292593591.ps tmp/6nqn61292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/7yznr1292593591.ps tmp/7yznr1292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/8yznr1292593591.ps tmp/8yznr1292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/9yznr1292593591.ps tmp/9yznr1292593591.png",intern=TRUE))
character(0)
> try(system("convert tmp/1099mu1292593591.ps tmp/1099mu1292593591.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.540 1.820 6.334