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('2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'2'
+ 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,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1')
+ ,dim=c(6
+ ,154)
+ ,dimnames=list(c('UseLimit'
+ ,'T20'
+ ,'T40'
+ ,'Used'
+ ,'CorrectAnalysis'
+ ,'Useful')
+ ,1:154))
> y <- array(NA,dim=c(6,154),dimnames=list(c('UseLimit','T20','T40','Used','CorrectAnalysis','Useful'),1:154))
> 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 = '5'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '5'
> #'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
CorrectAnalysis UseLimit T20 T40 Used Useful
1 1 2 2 1 1 1
2 1 1 1 1 1 1
3 1 1 1 1 1 1
4 1 1 1 1 1 1
5 1 1 1 1 1 1
6 1 2 1 1 1 2
7 1 1 1 1 1 1
8 1 1 2 1 1 1
9 1 1 1 1 1 1
10 1 2 1 1 1 1
11 1 2 2 1 1 1
12 1 1 1 1 1 1
13 1 1 1 1 2 2
14 1 2 2 1 1 1
15 1 1 1 1 2 2
16 1 1 2 1 2 2
17 2 2 2 1 2 2
18 1 2 2 1 1 1
19 1 1 1 1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 1
93 1 2 1 1 1 2
94 1 1 1 1 1 1
95 1 1 1 2 1 1
96 1 1 1 1 1 1
97 1 2 1 2 1 1
98 1 1 1 1 1 1
99 1 2 1 1 1 1
100 1 1 1 1 1 1
101 1 2 1 1 1 1
102 1 1 1 1 1 1
103 1 1 1 1 1 1
104 1 1 1 1 1 1
105 1 1 1 2 2 1
106 1 1 1 1 1 1
107 1 1 1 1 1 1
108 1 2 1 2 2 1
109 1 1 1 1 1 1
110 1 2 1 1 1 1
111 1 2 1 2 2 2
112 1 1 1 2 1 1
113 1 1 1 1 2 1
114 1 2 1 2 2 1
115 1 2 1 1 1 1
116 1 1 1 1 1 1
117 1 2 1 1 1 1
118 1 2 1 1 1 1
119 1 1 1 1 1 1
120 1 1 1 1 1 1
121 1 2 1 1 1 1
122 1 1 1 1 1 1
123 1 2 1 2 2 1
124 1 1 1 1 2 2
125 1 1 1 1 1 1
126 1 1 1 2 1 1
127 1 1 1 1 1 2
128 1 1 1 1 1 1
129 1 1 1 1 1 1
130 1 1 1 1 1 1
131 1 2 1 1 1 1
132 1 2 1 1 1 1
133 1 2 1 1 2 1
134 1 1 1 1 1 1
135 1 1 1 1 1 1
136 1 1 1 1 1 1
137 1 2 1 1 2 2
138 1 2 1 2 2 2
139 1 1 1 2 1 1
140 1 1 1 1 1 1
141 2 1 1 1 2 1
142 1 1 1 2 2 1
143 1 2 1 1 1 1
144 1 1 1 1 1 2
145 1 1 1 1 1 2
146 1 1 1 2 1 1
147 1 1 1 2 2 1
148 1 1 1 2 1 1
149 1 2 1 1 1 1
150 1 1 1 1 1 2
151 1 1 1 1 1 1
152 2 2 1 1 2 1
153 2 2 1 1 2 2
154 1 2 1 1 2 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) UseLimit T20 T40 Used Useful
0.6935189 0.0005898 0.1361962 -0.1284407 0.2571198 0.0295772
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.41204 -0.11783 0.01085 0.01144 0.75432
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6935189 0.1175836 5.898 2.40e-08 ***
UseLimit 0.0005898 0.0408998 0.014 0.9885
T20 0.1361962 0.0551388 2.470 0.0146 *
T40 -0.1284407 0.0632249 -2.031 0.0440 *
Used 0.2571198 0.0445308 5.774 4.39e-08 ***
Useful 0.0295772 0.0448541 0.659 0.5107
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2329 on 148 degrees of freedom
Multiple R-squared: 0.2748, Adjusted R-squared: 0.2503
F-statistic: 11.21 on 5 and 148 DF, p-value: 3.529e-09
> 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,] 4.720377e-94 9.440753e-94 1.000000000
[2,] 3.418439e-63 6.836879e-63 1.000000000
[3,] 6.830023e-82 1.366005e-81 1.000000000
[4,] 9.531409e-92 1.906282e-91 1.000000000
[5,] 1.812881e-121 3.625761e-121 1.000000000
[6,] 5.446148e-121 1.089230e-120 1.000000000
[7,] 3.316221e-136 6.632441e-136 1.000000000
[8,] 0.000000e+00 0.000000e+00 1.000000000
[9,] 5.117121e-01 9.765758e-01 0.488287905
[10,] 4.511033e-01 9.022067e-01 0.548896668
[11,] 3.735317e-01 7.470634e-01 0.626468278
[12,] 8.303259e-01 3.393482e-01 0.169674100
[13,] 7.773285e-01 4.453431e-01 0.222671528
[14,] 7.821452e-01 4.357097e-01 0.217854843
[15,] 7.252844e-01 5.494312e-01 0.274715619
[16,] 6.624378e-01 6.751243e-01 0.337562162
[17,] 7.023033e-01 5.953935e-01 0.297696738
[18,] 6.819558e-01 6.360884e-01 0.318044204
[19,] 6.298213e-01 7.403573e-01 0.370178674
[20,] 5.796149e-01 8.407702e-01 0.420385120
[21,] 5.211159e-01 9.577681e-01 0.478884058
[22,] 4.605700e-01 9.211400e-01 0.539429997
[23,] 4.034921e-01 8.069841e-01 0.596507947
[24,] 3.492513e-01 6.985027e-01 0.650748650
[25,] 2.953550e-01 5.907101e-01 0.704644952
[26,] 2.593807e-01 5.187614e-01 0.740619309
[27,] 2.162951e-01 4.325901e-01 0.783704929
[28,] 1.775893e-01 3.551786e-01 0.822410686
[29,] 2.370003e-01 4.740005e-01 0.762999737
[30,] 2.074245e-01 4.148491e-01 0.792575469
[31,] 1.698723e-01 3.397445e-01 0.830127749
[32,] 1.605474e-01 3.210948e-01 0.839452607
[33,] 6.872534e-01 6.254931e-01 0.312746560
[34,] 6.655006e-01 6.689987e-01 0.334499358
[35,] 6.160020e-01 7.679960e-01 0.383997981
[36,] 5.769857e-01 8.460286e-01 0.423014294
[37,] 5.263346e-01 9.473308e-01 0.473665395
[38,] 4.750660e-01 9.501320e-01 0.524933991
[39,] 4.246071e-01 8.492142e-01 0.575392919
[40,] 3.754123e-01 7.508246e-01 0.624587689
[41,] 3.283253e-01 6.566507e-01 0.671674652
[42,] 2.840162e-01 5.680324e-01 0.715983815
[43,] 3.431085e-01 6.862171e-01 0.656891471
[44,] 6.337276e-01 7.325448e-01 0.366272410
[45,] 5.883287e-01 8.233426e-01 0.411671319
[46,] 9.292051e-01 1.415898e-01 0.070794890
[47,] 9.112899e-01 1.774203e-01 0.088710126
[48,] 9.484331e-01 1.031338e-01 0.051566898
[49,] 9.520865e-01 9.582708e-02 0.047913541
[50,] 9.389490e-01 1.221019e-01 0.061050963
[51,] 9.231611e-01 1.536779e-01 0.076838935
[52,] 9.745646e-01 5.087084e-02 0.025435421
[53,] 9.723595e-01 5.528104e-02 0.027640522
[54,] 9.742393e-01 5.152149e-02 0.025760745
[55,] 9.664653e-01 6.706939e-02 0.033534696
[56,] 9.674549e-01 6.509026e-02 0.032545132
[57,] 9.580862e-01 8.382769e-02 0.041913846
[58,] 9.466323e-01 1.067353e-01 0.053367653
[59,] 9.822240e-01 3.555203e-02 0.017776013
[60,] 9.763482e-01 4.730358e-02 0.023651789
[61,] 9.691452e-01 6.170969e-02 0.030854843
[62,] 9.703699e-01 5.926029e-02 0.029630146
[63,] 9.617793e-01 7.644135e-02 0.038220677
[64,] 9.512438e-01 9.751234e-02 0.048756169
[65,] 9.547045e-01 9.059095e-02 0.045295473
[66,] 9.572802e-01 8.543963e-02 0.042719814
[67,] 9.458708e-01 1.082584e-01 0.054129195
[68,] 9.459106e-01 1.081787e-01 0.054089360
[69,] 9.322028e-01 1.355945e-01 0.067797243
[70,] 9.381611e-01 1.236779e-01 0.061838941
[71,] 9.828322e-01 3.433552e-02 0.017167760
[72,] 9.785746e-01 4.285087e-02 0.021425436
[73,] 9.719037e-01 5.619256e-02 0.028096279
[74,] 9.744741e-01 5.105171e-02 0.025525853
[75,] 9.667609e-01 6.647811e-02 0.033239054
[76,] 9.985530e-01 2.894057e-03 0.001447029
[77,] 9.978569e-01 4.286237e-03 0.002143118
[78,] 9.968917e-01 6.216568e-03 0.003108284
[79,] 9.955472e-01 8.905642e-03 0.004452821
[80,] 9.940778e-01 1.184448e-02 0.005922239
[81,] 9.916929e-01 1.661430e-02 0.008307149
[82,] 9.884935e-01 2.301302e-02 0.011506512
[83,] 9.841807e-01 3.163868e-02 0.015819342
[84,] 9.810165e-01 3.796707e-02 0.018983536
[85,] 9.744240e-01 5.115207e-02 0.025576037
[86,] 9.661401e-01 6.771981e-02 0.033859903
[87,] 9.590512e-01 8.189769e-02 0.040948845
[88,] 9.468845e-01 1.062311e-01 0.053115525
[89,] 9.374896e-01 1.250209e-01 0.062510444
[90,] 9.205617e-01 1.588766e-01 0.079438284
[91,] 9.002267e-01 1.995465e-01 0.099773253
[92,] 8.763181e-01 2.473638e-01 0.123681920
[93,] 8.484314e-01 3.031372e-01 0.151568590
[94,] 8.166597e-01 3.666805e-01 0.183340273
[95,] 7.808989e-01 4.382021e-01 0.219101057
[96,] 7.412797e-01 5.174405e-01 0.258720270
[97,] 7.124151e-01 5.751698e-01 0.287584923
[98,] 6.669560e-01 6.660879e-01 0.333043964
[99,] 6.187173e-01 7.625654e-01 0.381282702
[100,] 5.805119e-01 8.389762e-01 0.419488098
[101,] 5.287763e-01 9.424475e-01 0.471223749
[102,] 4.756967e-01 9.513935e-01 0.524303272
[103,] 4.353309e-01 8.706617e-01 0.564669141
[104,] 4.000636e-01 8.001272e-01 0.599936409
[105,] 4.410483e-01 8.820966e-01 0.558951714
[106,] 4.030160e-01 8.060321e-01 0.596983962
[107,] 3.502955e-01 7.005910e-01 0.649704514
[108,] 3.010201e-01 6.020401e-01 0.698979940
[109,] 2.538227e-01 5.076454e-01 0.746177286
[110,] 2.105177e-01 4.210353e-01 0.789482346
[111,] 1.724801e-01 3.449601e-01 0.827519925
[112,] 1.389910e-01 2.779821e-01 0.861008969
[113,] 1.092594e-01 2.185189e-01 0.890740551
[114,] 8.490318e-02 1.698064e-01 0.915096820
[115,] 7.117191e-02 1.423438e-01 0.928828094
[116,] 9.372923e-02 1.874585e-01 0.906270765
[117,] 7.149477e-02 1.429895e-01 0.928505234
[118,] 5.995214e-02 1.199043e-01 0.940047858
[119,] 4.356499e-02 8.712997e-02 0.956435014
[120,] 3.126415e-02 6.252831e-02 0.968735846
[121,] 2.196409e-02 4.392817e-02 0.978035913
[122,] 1.511664e-02 3.023327e-02 0.984883365
[123,] 9.795857e-03 1.959171e-02 0.990204143
[124,] 6.144522e-03 1.228904e-02 0.993855478
[125,] 1.146253e-02 2.292506e-02 0.988537472
[126,] 7.513858e-03 1.502772e-02 0.992486142
[127,] 4.862865e-03 9.725730e-03 0.995137135
[128,] 3.146271e-03 6.292541e-03 0.996853729
[129,] 7.314425e-03 1.462885e-02 0.992685575
[130,] 6.621181e-03 1.324236e-02 0.993378819
[131,] 5.323206e-03 1.064641e-02 0.994676794
[132,] 2.825829e-03 5.651658e-03 0.997174171
[133,] 3.786449e-02 7.572898e-02 0.962135508
[134,] 2.753714e-02 5.507428e-02 0.972462862
[135,] 1.701756e-02 3.403511e-02 0.982982444
[136,] 8.296577e-03 1.659315e-02 0.991703423
[137,] 3.784183e-03 7.568366e-03 0.996215817
> postscript(file="/var/fisher/rcomp/tmp/17xdg1356012950.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/2sbjy1356012950.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/3w6kk1356012950.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/4bz951356012950.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/5dlaj1356012950.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 = 154
Frequency = 1
1 2 3 4 5 6
-0.12534730 0.01143875 0.01143875 0.01143875 0.01143875 -0.01872824
7 8 9 10 11 12
0.01143875 -0.12475750 0.01143875 0.01084894 -0.12534730 0.01143875
13 14 15 16 17 18
-0.27525824 -0.12534730 -0.27525824 -0.41145449 0.58795571 -0.12534730
19 20 21 22 23 24
0.01143875 0.58854551 -0.01872824 -0.27584805 -0.01813843 -0.01872824
25 26 27 28 29 30
-0.38187731 -0.27525824 0.01084894 -0.24568106 0.01143875 -0.01813843
31 32 33 34 35 36
0.01143875 0.01084894 -0.01872824 -0.12475750 0.01143875 0.01143875
37 38 39 40 41 42
-0.41204429 -0.24568106 -0.01813843 -0.15433468 0.72474176 -0.24568106
43 44 45 46 47 48
-0.01872824 -0.12534730 -0.01813843 -0.01813843 0.01143875 0.01143875
49 50 51 52 53 54
-0.01813843 0.01143875 -0.38187731 0.58795571 0.01143875 0.75431894
55 56 57 58 59 60
0.01143875 -0.38187731 -0.27525824 0.01143875 0.01143875 0.58795571
61 62 63 64 65 66
-0.12534730 -0.27525824 0.01143875 -0.12534730 0.01143875 0.01143875
67 68 69 70 71 72
0.58854551 0.01084894 0.01143875 -0.24568106 0.01143875 0.01143875
73 74 75 76 77 78
-0.24568106 -0.24627087 0.01143875 -0.15433468 0.01143875 -0.27525824
79 80 81 82 83 84
0.61812269 -0.15433468 0.01143875 -0.24627087 0.01143875 0.75431894
85 86 87 88 89 90
-0.01813843 0.01084894 0.01084894 -0.11783014 0.01143875 0.01143875
91 92 93 94 95 96
-0.01813843 0.13928967 -0.01872824 0.01143875 0.13987948 0.01143875
97 98 99 100 101 102
0.13928967 0.01143875 0.01084894 0.01143875 0.01084894 0.01143875
103 104 105 106 107 108
0.01143875 0.01143875 -0.11724033 0.01143875 0.01143875 -0.11783014
109 110 111 112 113 114
0.01143875 0.01084894 -0.14740732 0.13987948 -0.24568106 -0.11783014
115 116 117 118 119 120
0.01084894 0.01143875 0.01084894 0.01084894 0.01143875 0.01143875
121 122 123 124 125 126
0.01084894 0.01143875 -0.11783014 -0.27525824 0.01143875 0.13987948
127 128 129 130 131 132
-0.01813843 0.01143875 0.01143875 0.01143875 0.01084894 0.01084894
133 134 135 136 137 138
-0.24627087 0.01143875 0.01143875 0.01143875 -0.27584805 -0.14740732
139 140 141 142 143 144
0.13987948 0.01143875 0.75431894 -0.11724033 0.01084894 -0.01813843
145 146 147 148 149 150
-0.01813843 0.13987948 -0.11724033 0.13987948 0.01084894 -0.01813843
151 152 153 154
0.01143875 0.75372913 0.72415195 -0.24627087
> postscript(file="/var/fisher/rcomp/tmp/6l53j1356012950.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.12534730 NA
1 0.01143875 -0.12534730
2 0.01143875 0.01143875
3 0.01143875 0.01143875
4 0.01143875 0.01143875
5 -0.01872824 0.01143875
6 0.01143875 -0.01872824
7 -0.12475750 0.01143875
8 0.01143875 -0.12475750
9 0.01084894 0.01143875
10 -0.12534730 0.01084894
11 0.01143875 -0.12534730
12 -0.27525824 0.01143875
13 -0.12534730 -0.27525824
14 -0.27525824 -0.12534730
15 -0.41145449 -0.27525824
16 0.58795571 -0.41145449
17 -0.12534730 0.58795571
18 0.01143875 -0.12534730
19 0.58854551 0.01143875
20 -0.01872824 0.58854551
21 -0.27584805 -0.01872824
22 -0.01813843 -0.27584805
23 -0.01872824 -0.01813843
24 -0.38187731 -0.01872824
25 -0.27525824 -0.38187731
26 0.01084894 -0.27525824
27 -0.24568106 0.01084894
28 0.01143875 -0.24568106
29 -0.01813843 0.01143875
30 0.01143875 -0.01813843
31 0.01084894 0.01143875
32 -0.01872824 0.01084894
33 -0.12475750 -0.01872824
34 0.01143875 -0.12475750
35 0.01143875 0.01143875
36 -0.41204429 0.01143875
37 -0.24568106 -0.41204429
38 -0.01813843 -0.24568106
39 -0.15433468 -0.01813843
40 0.72474176 -0.15433468
41 -0.24568106 0.72474176
42 -0.01872824 -0.24568106
43 -0.12534730 -0.01872824
44 -0.01813843 -0.12534730
45 -0.01813843 -0.01813843
46 0.01143875 -0.01813843
47 0.01143875 0.01143875
48 -0.01813843 0.01143875
49 0.01143875 -0.01813843
50 -0.38187731 0.01143875
51 0.58795571 -0.38187731
52 0.01143875 0.58795571
53 0.75431894 0.01143875
54 0.01143875 0.75431894
55 -0.38187731 0.01143875
56 -0.27525824 -0.38187731
57 0.01143875 -0.27525824
58 0.01143875 0.01143875
59 0.58795571 0.01143875
60 -0.12534730 0.58795571
61 -0.27525824 -0.12534730
62 0.01143875 -0.27525824
63 -0.12534730 0.01143875
64 0.01143875 -0.12534730
65 0.01143875 0.01143875
66 0.58854551 0.01143875
67 0.01084894 0.58854551
68 0.01143875 0.01084894
69 -0.24568106 0.01143875
70 0.01143875 -0.24568106
71 0.01143875 0.01143875
72 -0.24568106 0.01143875
73 -0.24627087 -0.24568106
74 0.01143875 -0.24627087
75 -0.15433468 0.01143875
76 0.01143875 -0.15433468
77 -0.27525824 0.01143875
78 0.61812269 -0.27525824
79 -0.15433468 0.61812269
80 0.01143875 -0.15433468
81 -0.24627087 0.01143875
82 0.01143875 -0.24627087
83 0.75431894 0.01143875
84 -0.01813843 0.75431894
85 0.01084894 -0.01813843
86 0.01084894 0.01084894
87 -0.11783014 0.01084894
88 0.01143875 -0.11783014
89 0.01143875 0.01143875
90 -0.01813843 0.01143875
91 0.13928967 -0.01813843
92 -0.01872824 0.13928967
93 0.01143875 -0.01872824
94 0.13987948 0.01143875
95 0.01143875 0.13987948
96 0.13928967 0.01143875
97 0.01143875 0.13928967
98 0.01084894 0.01143875
99 0.01143875 0.01084894
100 0.01084894 0.01143875
101 0.01143875 0.01084894
102 0.01143875 0.01143875
103 0.01143875 0.01143875
104 -0.11724033 0.01143875
105 0.01143875 -0.11724033
106 0.01143875 0.01143875
107 -0.11783014 0.01143875
108 0.01143875 -0.11783014
109 0.01084894 0.01143875
110 -0.14740732 0.01084894
111 0.13987948 -0.14740732
112 -0.24568106 0.13987948
113 -0.11783014 -0.24568106
114 0.01084894 -0.11783014
115 0.01143875 0.01084894
116 0.01084894 0.01143875
117 0.01084894 0.01084894
118 0.01143875 0.01084894
119 0.01143875 0.01143875
120 0.01084894 0.01143875
121 0.01143875 0.01084894
122 -0.11783014 0.01143875
123 -0.27525824 -0.11783014
124 0.01143875 -0.27525824
125 0.13987948 0.01143875
126 -0.01813843 0.13987948
127 0.01143875 -0.01813843
128 0.01143875 0.01143875
129 0.01143875 0.01143875
130 0.01084894 0.01143875
131 0.01084894 0.01084894
132 -0.24627087 0.01084894
133 0.01143875 -0.24627087
134 0.01143875 0.01143875
135 0.01143875 0.01143875
136 -0.27584805 0.01143875
137 -0.14740732 -0.27584805
138 0.13987948 -0.14740732
139 0.01143875 0.13987948
140 0.75431894 0.01143875
141 -0.11724033 0.75431894
142 0.01084894 -0.11724033
143 -0.01813843 0.01084894
144 -0.01813843 -0.01813843
145 0.13987948 -0.01813843
146 -0.11724033 0.13987948
147 0.13987948 -0.11724033
148 0.01084894 0.13987948
149 -0.01813843 0.01084894
150 0.01143875 -0.01813843
151 0.75372913 0.01143875
152 0.72415195 0.75372913
153 -0.24627087 0.72415195
154 NA -0.24627087
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.01143875 -0.12534730
[2,] 0.01143875 0.01143875
[3,] 0.01143875 0.01143875
[4,] 0.01143875 0.01143875
[5,] -0.01872824 0.01143875
[6,] 0.01143875 -0.01872824
[7,] -0.12475750 0.01143875
[8,] 0.01143875 -0.12475750
[9,] 0.01084894 0.01143875
[10,] -0.12534730 0.01084894
[11,] 0.01143875 -0.12534730
[12,] -0.27525824 0.01143875
[13,] -0.12534730 -0.27525824
[14,] -0.27525824 -0.12534730
[15,] -0.41145449 -0.27525824
[16,] 0.58795571 -0.41145449
[17,] -0.12534730 0.58795571
[18,] 0.01143875 -0.12534730
[19,] 0.58854551 0.01143875
[20,] -0.01872824 0.58854551
[21,] -0.27584805 -0.01872824
[22,] -0.01813843 -0.27584805
[23,] -0.01872824 -0.01813843
[24,] -0.38187731 -0.01872824
[25,] -0.27525824 -0.38187731
[26,] 0.01084894 -0.27525824
[27,] -0.24568106 0.01084894
[28,] 0.01143875 -0.24568106
[29,] -0.01813843 0.01143875
[30,] 0.01143875 -0.01813843
[31,] 0.01084894 0.01143875
[32,] -0.01872824 0.01084894
[33,] -0.12475750 -0.01872824
[34,] 0.01143875 -0.12475750
[35,] 0.01143875 0.01143875
[36,] -0.41204429 0.01143875
[37,] -0.24568106 -0.41204429
[38,] -0.01813843 -0.24568106
[39,] -0.15433468 -0.01813843
[40,] 0.72474176 -0.15433468
[41,] -0.24568106 0.72474176
[42,] -0.01872824 -0.24568106
[43,] -0.12534730 -0.01872824
[44,] -0.01813843 -0.12534730
[45,] -0.01813843 -0.01813843
[46,] 0.01143875 -0.01813843
[47,] 0.01143875 0.01143875
[48,] -0.01813843 0.01143875
[49,] 0.01143875 -0.01813843
[50,] -0.38187731 0.01143875
[51,] 0.58795571 -0.38187731
[52,] 0.01143875 0.58795571
[53,] 0.75431894 0.01143875
[54,] 0.01143875 0.75431894
[55,] -0.38187731 0.01143875
[56,] -0.27525824 -0.38187731
[57,] 0.01143875 -0.27525824
[58,] 0.01143875 0.01143875
[59,] 0.58795571 0.01143875
[60,] -0.12534730 0.58795571
[61,] -0.27525824 -0.12534730
[62,] 0.01143875 -0.27525824
[63,] -0.12534730 0.01143875
[64,] 0.01143875 -0.12534730
[65,] 0.01143875 0.01143875
[66,] 0.58854551 0.01143875
[67,] 0.01084894 0.58854551
[68,] 0.01143875 0.01084894
[69,] -0.24568106 0.01143875
[70,] 0.01143875 -0.24568106
[71,] 0.01143875 0.01143875
[72,] -0.24568106 0.01143875
[73,] -0.24627087 -0.24568106
[74,] 0.01143875 -0.24627087
[75,] -0.15433468 0.01143875
[76,] 0.01143875 -0.15433468
[77,] -0.27525824 0.01143875
[78,] 0.61812269 -0.27525824
[79,] -0.15433468 0.61812269
[80,] 0.01143875 -0.15433468
[81,] -0.24627087 0.01143875
[82,] 0.01143875 -0.24627087
[83,] 0.75431894 0.01143875
[84,] -0.01813843 0.75431894
[85,] 0.01084894 -0.01813843
[86,] 0.01084894 0.01084894
[87,] -0.11783014 0.01084894
[88,] 0.01143875 -0.11783014
[89,] 0.01143875 0.01143875
[90,] -0.01813843 0.01143875
[91,] 0.13928967 -0.01813843
[92,] -0.01872824 0.13928967
[93,] 0.01143875 -0.01872824
[94,] 0.13987948 0.01143875
[95,] 0.01143875 0.13987948
[96,] 0.13928967 0.01143875
[97,] 0.01143875 0.13928967
[98,] 0.01084894 0.01143875
[99,] 0.01143875 0.01084894
[100,] 0.01084894 0.01143875
[101,] 0.01143875 0.01084894
[102,] 0.01143875 0.01143875
[103,] 0.01143875 0.01143875
[104,] -0.11724033 0.01143875
[105,] 0.01143875 -0.11724033
[106,] 0.01143875 0.01143875
[107,] -0.11783014 0.01143875
[108,] 0.01143875 -0.11783014
[109,] 0.01084894 0.01143875
[110,] -0.14740732 0.01084894
[111,] 0.13987948 -0.14740732
[112,] -0.24568106 0.13987948
[113,] -0.11783014 -0.24568106
[114,] 0.01084894 -0.11783014
[115,] 0.01143875 0.01084894
[116,] 0.01084894 0.01143875
[117,] 0.01084894 0.01084894
[118,] 0.01143875 0.01084894
[119,] 0.01143875 0.01143875
[120,] 0.01084894 0.01143875
[121,] 0.01143875 0.01084894
[122,] -0.11783014 0.01143875
[123,] -0.27525824 -0.11783014
[124,] 0.01143875 -0.27525824
[125,] 0.13987948 0.01143875
[126,] -0.01813843 0.13987948
[127,] 0.01143875 -0.01813843
[128,] 0.01143875 0.01143875
[129,] 0.01143875 0.01143875
[130,] 0.01084894 0.01143875
[131,] 0.01084894 0.01084894
[132,] -0.24627087 0.01084894
[133,] 0.01143875 -0.24627087
[134,] 0.01143875 0.01143875
[135,] 0.01143875 0.01143875
[136,] -0.27584805 0.01143875
[137,] -0.14740732 -0.27584805
[138,] 0.13987948 -0.14740732
[139,] 0.01143875 0.13987948
[140,] 0.75431894 0.01143875
[141,] -0.11724033 0.75431894
[142,] 0.01084894 -0.11724033
[143,] -0.01813843 0.01084894
[144,] -0.01813843 -0.01813843
[145,] 0.13987948 -0.01813843
[146,] -0.11724033 0.13987948
[147,] 0.13987948 -0.11724033
[148,] 0.01084894 0.13987948
[149,] -0.01813843 0.01084894
[150,] 0.01143875 -0.01813843
[151,] 0.75372913 0.01143875
[152,] 0.72415195 0.75372913
[153,] -0.24627087 0.72415195
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.01143875 -0.12534730
2 0.01143875 0.01143875
3 0.01143875 0.01143875
4 0.01143875 0.01143875
5 -0.01872824 0.01143875
6 0.01143875 -0.01872824
7 -0.12475750 0.01143875
8 0.01143875 -0.12475750
9 0.01084894 0.01143875
10 -0.12534730 0.01084894
11 0.01143875 -0.12534730
12 -0.27525824 0.01143875
13 -0.12534730 -0.27525824
14 -0.27525824 -0.12534730
15 -0.41145449 -0.27525824
16 0.58795571 -0.41145449
17 -0.12534730 0.58795571
18 0.01143875 -0.12534730
19 0.58854551 0.01143875
20 -0.01872824 0.58854551
21 -0.27584805 -0.01872824
22 -0.01813843 -0.27584805
23 -0.01872824 -0.01813843
24 -0.38187731 -0.01872824
25 -0.27525824 -0.38187731
26 0.01084894 -0.27525824
27 -0.24568106 0.01084894
28 0.01143875 -0.24568106
29 -0.01813843 0.01143875
30 0.01143875 -0.01813843
31 0.01084894 0.01143875
32 -0.01872824 0.01084894
33 -0.12475750 -0.01872824
34 0.01143875 -0.12475750
35 0.01143875 0.01143875
36 -0.41204429 0.01143875
37 -0.24568106 -0.41204429
38 -0.01813843 -0.24568106
39 -0.15433468 -0.01813843
40 0.72474176 -0.15433468
41 -0.24568106 0.72474176
42 -0.01872824 -0.24568106
43 -0.12534730 -0.01872824
44 -0.01813843 -0.12534730
45 -0.01813843 -0.01813843
46 0.01143875 -0.01813843
47 0.01143875 0.01143875
48 -0.01813843 0.01143875
49 0.01143875 -0.01813843
50 -0.38187731 0.01143875
51 0.58795571 -0.38187731
52 0.01143875 0.58795571
53 0.75431894 0.01143875
54 0.01143875 0.75431894
55 -0.38187731 0.01143875
56 -0.27525824 -0.38187731
57 0.01143875 -0.27525824
58 0.01143875 0.01143875
59 0.58795571 0.01143875
60 -0.12534730 0.58795571
61 -0.27525824 -0.12534730
62 0.01143875 -0.27525824
63 -0.12534730 0.01143875
64 0.01143875 -0.12534730
65 0.01143875 0.01143875
66 0.58854551 0.01143875
67 0.01084894 0.58854551
68 0.01143875 0.01084894
69 -0.24568106 0.01143875
70 0.01143875 -0.24568106
71 0.01143875 0.01143875
72 -0.24568106 0.01143875
73 -0.24627087 -0.24568106
74 0.01143875 -0.24627087
75 -0.15433468 0.01143875
76 0.01143875 -0.15433468
77 -0.27525824 0.01143875
78 0.61812269 -0.27525824
79 -0.15433468 0.61812269
80 0.01143875 -0.15433468
81 -0.24627087 0.01143875
82 0.01143875 -0.24627087
83 0.75431894 0.01143875
84 -0.01813843 0.75431894
85 0.01084894 -0.01813843
86 0.01084894 0.01084894
87 -0.11783014 0.01084894
88 0.01143875 -0.11783014
89 0.01143875 0.01143875
90 -0.01813843 0.01143875
91 0.13928967 -0.01813843
92 -0.01872824 0.13928967
93 0.01143875 -0.01872824
94 0.13987948 0.01143875
95 0.01143875 0.13987948
96 0.13928967 0.01143875
97 0.01143875 0.13928967
98 0.01084894 0.01143875
99 0.01143875 0.01084894
100 0.01084894 0.01143875
101 0.01143875 0.01084894
102 0.01143875 0.01143875
103 0.01143875 0.01143875
104 -0.11724033 0.01143875
105 0.01143875 -0.11724033
106 0.01143875 0.01143875
107 -0.11783014 0.01143875
108 0.01143875 -0.11783014
109 0.01084894 0.01143875
110 -0.14740732 0.01084894
111 0.13987948 -0.14740732
112 -0.24568106 0.13987948
113 -0.11783014 -0.24568106
114 0.01084894 -0.11783014
115 0.01143875 0.01084894
116 0.01084894 0.01143875
117 0.01084894 0.01084894
118 0.01143875 0.01084894
119 0.01143875 0.01143875
120 0.01084894 0.01143875
121 0.01143875 0.01084894
122 -0.11783014 0.01143875
123 -0.27525824 -0.11783014
124 0.01143875 -0.27525824
125 0.13987948 0.01143875
126 -0.01813843 0.13987948
127 0.01143875 -0.01813843
128 0.01143875 0.01143875
129 0.01143875 0.01143875
130 0.01084894 0.01143875
131 0.01084894 0.01084894
132 -0.24627087 0.01084894
133 0.01143875 -0.24627087
134 0.01143875 0.01143875
135 0.01143875 0.01143875
136 -0.27584805 0.01143875
137 -0.14740732 -0.27584805
138 0.13987948 -0.14740732
139 0.01143875 0.13987948
140 0.75431894 0.01143875
141 -0.11724033 0.75431894
142 0.01084894 -0.11724033
143 -0.01813843 0.01084894
144 -0.01813843 -0.01813843
145 0.13987948 -0.01813843
146 -0.11724033 0.13987948
147 0.13987948 -0.11724033
148 0.01084894 0.13987948
149 -0.01813843 0.01084894
150 0.01143875 -0.01813843
151 0.75372913 0.01143875
152 0.72415195 0.75372913
153 -0.24627087 0.72415195
> 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/74tji1356012950.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/8j0uu1356012950.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/9xlmr1356012950.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/102jw31356012950.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/117sjq1356012950.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/12k8ur1356012950.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/13079b1356012951.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/142sd71356012951.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/1593yp1356012951.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/16k4ek1356012951.tab")
+ }
>
> try(system("convert tmp/17xdg1356012950.ps tmp/17xdg1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/2sbjy1356012950.ps tmp/2sbjy1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/3w6kk1356012950.ps tmp/3w6kk1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/4bz951356012950.ps tmp/4bz951356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/5dlaj1356012950.ps tmp/5dlaj1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/6l53j1356012950.ps tmp/6l53j1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/74tji1356012950.ps tmp/74tji1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/8j0uu1356012950.ps tmp/8j0uu1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/9xlmr1356012950.ps tmp/9xlmr1356012950.png",intern=TRUE))
character(0)
> try(system("convert tmp/102jw31356012950.ps tmp/102jw31356012950.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.693 1.871 10.587