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(4
+ ,1
+ ,1
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,1
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,1
+ ,4
+ ,1
+ ,0
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,1
+ ,0
+ ,4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,1
+ ,1
+ ,4
+ ,0
+ ,1
+ ,1
+ ,1
+ ,4
+ ,1
+ ,1
+ ,2
+ ,0
+ ,4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,1
+ ,4
+ ,0
+ ,1
+ ,2
+ ,1
+ ,4
+ ,1
+ ,0
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,0
+ ,1
+ ,4
+ ,1
+ ,0
+ ,0
+ ,1
+ ,4
+ ,0
+ ,1
+ ,1
+ ,1
+ ,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
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> 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
Uitkomst Weken GebruikLimieten Review GebruikStatistiek
1 1 4 1 1 0
2 0 4 0 0 0
3 0 4 0 0 0
4 0 4 0 0 0
5 0 4 0 0 0
6 1 4 1 0 0
7 0 4 0 0 0
8 0 4 0 1 0
9 1 4 0 0 0
10 0 4 1 0 0
11 0 4 1 1 0
12 0 4 0 0 0
13 0 4 0 0 1
14 0 4 1 1 0
15 1 4 0 0 1
16 1 4 0 1 1
17 0 4 1 1 2
18 0 4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 0
104 0 2 0 0 0
105 0 2 0 1 1
106 0 2 0 0 0
107 0 2 0 0 0
108 0 2 1 1 1
109 0 2 0 0 0
110 0 2 1 0 0
111 0 2 1 1 1
112 0 2 0 1 0
113 0 2 0 0 1
114 0 2 1 1 1
115 0 2 1 0 0
116 0 2 0 0 0
117 1 2 1 0 0
118 0 2 1 0 0
119 0 2 0 0 0
120 1 2 0 0 0
121 0 2 1 0 0
122 0 2 0 0 0
123 0 2 1 1 1
124 1 2 0 0 1
125 1 2 0 0 0
126 0 2 0 1 0
127 0 2 0 0 0
128 1 2 0 0 0
129 0 2 0 0 0
130 1 2 0 0 0
131 0 2 1 0 0
132 1 2 1 0 0
133 0 2 1 0 1
134 0 2 0 0 0
135 0 2 0 0 0
136 0 2 0 0 0
137 1 2 1 0 1
138 1 2 1 1 1
139 0 2 0 1 0
140 0 2 0 0 0
141 1 2 0 0 2
142 1 2 0 1 1
143 0 2 1 0 0
144 1 2 0 0 0
145 0 2 0 0 0
146 1 2 0 1 0
147 0 2 0 1 1
148 0 2 0 1 0
149 0 2 1 0 0
150 1 2 0 0 0
151 1 2 0 0 0
152 0 2 1 0 2
153 0 2 1 0 2
154 0 2 1 0 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Weken GebruikLimieten Review
0.18530 0.07113 -0.06711 -0.03973
GebruikStatistiek
0.05731
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.5844 -0.4027 -0.2878 0.5302 0.7396
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.18530 0.13670 1.356 0.1773
Weken 0.07113 0.04018 1.770 0.0788 .
GebruikLimieten -0.06711 0.08641 -0.777 0.4386
Review -0.03973 0.09454 -0.420 0.6749
GebruikStatistiek 0.05731 0.06601 0.868 0.3867
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4886 on 149 degrees of freedom
Multiple R-squared: 0.03426, Adjusted R-squared: 0.008338
F-statistic: 1.322 on 4 and 149 DF, p-value: 0.2646
> 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,] 1.073815e-48 2.147629e-48 1.000000e+00
[2,] 5.276447e-01 9.447106e-01 4.723553e-01
[3,] 7.169056e-01 5.661888e-01 2.830944e-01
[4,] 7.350746e-01 5.298507e-01 2.649254e-01
[5,] 6.461915e-01 7.076169e-01 3.538085e-01
[6,] 5.478674e-01 9.042653e-01 4.521326e-01
[7,] 5.111124e-01 9.777753e-01 4.888876e-01
[8,] 6.013017e-01 7.973965e-01 3.986983e-01
[9,] 5.892102e-01 8.215795e-01 4.107898e-01
[10,] 7.179950e-01 5.640099e-01 2.820050e-01
[11,] 6.677760e-01 6.644479e-01 3.322240e-01
[12,] 7.246925e-01 5.506150e-01 2.753075e-01
[13,] 7.050893e-01 5.898214e-01 2.949107e-01
[14,] 6.538724e-01 6.922552e-01 3.461276e-01
[15,] 6.618534e-01 6.762932e-01 3.381466e-01
[16,] 6.984919e-01 6.030163e-01 3.015081e-01
[17,] 7.261349e-01 5.477302e-01 2.738651e-01
[18,] 7.254304e-01 5.491392e-01 2.745696e-01
[19,] 7.405708e-01 5.188584e-01 2.594292e-01
[20,] 7.565944e-01 4.868112e-01 2.434056e-01
[21,] 7.596272e-01 4.807456e-01 2.403728e-01
[22,] 7.762319e-01 4.475363e-01 2.237681e-01
[23,] 7.591356e-01 4.817288e-01 2.408644e-01
[24,] 7.394278e-01 5.211444e-01 2.605722e-01
[25,] 7.224921e-01 5.550159e-01 2.775079e-01
[26,] 7.010362e-01 5.979277e-01 2.989638e-01
[27,] 7.178998e-01 5.642004e-01 2.821002e-01
[28,] 6.989375e-01 6.021250e-01 3.010625e-01
[29,] 6.785658e-01 6.428685e-01 3.214342e-01
[30,] 6.756115e-01 6.487769e-01 3.243885e-01
[31,] 6.770526e-01 6.458948e-01 3.229474e-01
[32,] 6.951093e-01 6.097814e-01 3.048907e-01
[33,] 6.789487e-01 6.421027e-01 3.210513e-01
[34,] 6.519988e-01 6.960023e-01 3.480012e-01
[35,] 6.401557e-01 7.196887e-01 3.598443e-01
[36,] 6.655125e-01 6.689750e-01 3.344875e-01
[37,] 6.382183e-01 7.235634e-01 3.617817e-01
[38,] 6.257196e-01 7.485607e-01 3.742804e-01
[39,] 6.405002e-01 7.189997e-01 3.594998e-01
[40,] 6.297097e-01 7.405806e-01 3.702903e-01
[41,] 6.423861e-01 7.152277e-01 3.576139e-01
[42,] 6.517859e-01 6.964282e-01 3.482141e-01
[43,] 6.440059e-01 7.119881e-01 3.559941e-01
[44,] 6.418904e-01 7.162191e-01 3.581096e-01
[45,] 6.478581e-01 7.042838e-01 3.521419e-01
[46,] 6.530914e-01 6.938171e-01 3.469086e-01
[47,] 6.778370e-01 6.443260e-01 3.221630e-01
[48,] 6.741183e-01 6.517633e-01 3.258817e-01
[49,] 6.797238e-01 6.405524e-01 3.202762e-01
[50,] 6.722719e-01 6.554561e-01 3.277281e-01
[51,] 6.759268e-01 6.481464e-01 3.240732e-01
[52,] 6.791920e-01 6.416160e-01 3.208080e-01
[53,] 6.830886e-01 6.338229e-01 3.169114e-01
[54,] 7.127741e-01 5.744518e-01 2.872259e-01
[55,] 7.172830e-01 5.654340e-01 2.827170e-01
[56,] 7.115031e-01 5.769938e-01 2.884969e-01
[57,] 7.371923e-01 5.256153e-01 2.628077e-01
[58,] 7.306954e-01 5.386092e-01 2.693046e-01
[59,] 7.252498e-01 5.495003e-01 2.747502e-01
[60,] 7.340068e-01 5.319863e-01 2.659932e-01
[61,] 7.232339e-01 5.535321e-01 2.767661e-01
[62,] 7.264912e-01 5.470176e-01 2.735088e-01
[63,] 7.349837e-01 5.300327e-01 2.650163e-01
[64,] 7.365304e-01 5.269393e-01 2.634696e-01
[65,] 7.368677e-01 5.262646e-01 2.631323e-01
[66,] 7.294736e-01 5.410529e-01 2.705264e-01
[67,] 7.289676e-01 5.420647e-01 2.710324e-01
[68,] 7.286737e-01 5.426526e-01 2.713263e-01
[69,] 7.380883e-01 5.238234e-01 2.619117e-01
[70,] 7.454659e-01 5.090682e-01 2.545341e-01
[71,] 7.467599e-01 5.064802e-01 2.532401e-01
[72,] 7.530687e-01 4.938627e-01 2.469313e-01
[73,] 7.354708e-01 5.290584e-01 2.645292e-01
[74,] 7.227326e-01 5.545348e-01 2.772674e-01
[75,] 7.472352e-01 5.055296e-01 2.527648e-01
[76,] 7.301087e-01 5.397826e-01 2.698913e-01
[77,] 7.413688e-01 5.172624e-01 2.586312e-01
[78,] 7.593843e-01 4.812314e-01 2.406157e-01
[79,] 7.311438e-01 5.377123e-01 2.688562e-01
[80,] 7.480706e-01 5.038589e-01 2.519294e-01
[81,] 7.745791e-01 4.508417e-01 2.254209e-01
[82,] 7.897708e-01 4.204584e-01 2.102292e-01
[83,] 7.987402e-01 4.025196e-01 2.012598e-01
[84,] 7.988739e-01 4.022522e-01 2.011261e-01
[85,] 7.787224e-01 4.425551e-01 2.212776e-01
[86,] 7.561659e-01 4.876681e-01 2.438341e-01
[87,] 7.401913e-01 5.196174e-01 2.598087e-01
[88,] 7.126355e-01 5.747290e-01 2.873645e-01
[89,] 7.405972e-01 5.188056e-01 2.594028e-01
[90,] 7.069983e-01 5.860033e-01 2.930017e-01
[91,] 6.861099e-01 6.277801e-01 3.138901e-01
[92,] 6.529953e-01 6.940095e-01 3.470047e-01
[93,] 6.865549e-01 6.268902e-01 3.134451e-01
[94,] 7.441818e-01 5.116365e-01 2.558182e-01
[95,] 7.244945e-01 5.510110e-01 2.755055e-01
[96,] 7.038091e-01 5.923818e-01 2.961909e-01
[97,] 6.825749e-01 6.348501e-01 3.174251e-01
[98,] 6.602927e-01 6.794145e-01 3.397073e-01
[99,] 6.378688e-01 7.242625e-01 3.621312e-01
[100,] 6.161033e-01 7.677934e-01 3.838967e-01
[101,] 5.747672e-01 8.504657e-01 4.252328e-01
[102,] 5.525904e-01 8.948192e-01 4.474096e-01
[103,] 5.096329e-01 9.807342e-01 4.903671e-01
[104,] 4.656819e-01 9.313638e-01 5.343181e-01
[105,] 4.326803e-01 8.653606e-01 5.673197e-01
[106,] 4.266333e-01 8.532667e-01 5.733667e-01
[107,] 3.853105e-01 7.706211e-01 6.146895e-01
[108,] 3.430241e-01 6.860482e-01 6.569759e-01
[109,] 3.244805e-01 6.489610e-01 6.755195e-01
[110,] 4.078241e-01 8.156481e-01 5.921759e-01
[111,] 3.600895e-01 7.201790e-01 6.399105e-01
[112,] 3.439534e-01 6.879067e-01 6.560466e-01
[113,] 3.673987e-01 7.347974e-01 6.326013e-01
[114,] 3.207378e-01 6.414755e-01 6.792622e-01
[115,] 3.048455e-01 6.096910e-01 6.951545e-01
[116,] 2.652780e-01 5.305559e-01 7.347220e-01
[117,] 2.669047e-01 5.338093e-01 7.330953e-01
[118,] 2.903362e-01 5.806725e-01 7.096638e-01
[119,] 2.726369e-01 5.452739e-01 7.273631e-01
[120,] 2.516769e-01 5.033537e-01 7.483231e-01
[121,] 2.746773e-01 5.493546e-01 7.253227e-01
[122,] 2.511348e-01 5.022696e-01 7.488652e-01
[123,] 2.770412e-01 5.540824e-01 7.229588e-01
[124,] 2.339999e-01 4.679997e-01 7.660001e-01
[125,] 3.179885e-01 6.359771e-01 6.820115e-01
[126,] 2.709108e-01 5.418216e-01 7.290892e-01
[127,] 2.391673e-01 4.783347e-01 7.608327e-01
[128,] 2.150894e-01 4.301788e-01 7.849106e-01
[129,] 2.012433e-01 4.024866e-01 7.987567e-01
[130,] 2.726117e-01 5.452235e-01 7.273883e-01
[131,] 5.137320e-01 9.725360e-01 4.862680e-01
[132,] 4.813606e-01 9.627213e-01 5.186394e-01
[133,] 5.832877e-01 8.334245e-01 4.167123e-01
[134,] 4.988745e-01 9.977491e-01 5.011255e-01
[135,] 5.606693e-01 8.786614e-01 4.393307e-01
[136,] 4.467562e-01 8.935125e-01 5.532438e-01
[137,] 3.698769e-01 7.397537e-01 6.301231e-01
[138,] 6.168055e-01 7.663890e-01 3.831945e-01
[139,] 1.000000e+00 1.864434e-46 9.322169e-47
> postscript(file="/var/fisher/rcomp/tmp/1ijwc1355751562.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/2t5691355751562.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/3jrol1355751562.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/4eff41355751562.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/5h2no1355751562.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 7
0.6370248 -0.4698118 -0.4698118 -0.4698118 -0.4698118 0.5972933 -0.4698118
8 9 10 11 12 13 14
-0.4300803 0.5301882 -0.4027067 -0.3629752 -0.4698118 -0.5271235 -0.3629752
15 16 17 18 19 20 21
0.4728765 0.5126081 -0.4775984 -0.3629752 0.5301882 0.4552964 -0.4027067
22 23 24 25 26 27 28
0.5399817 0.5301882 0.5972933 0.5126081 -0.5271235 0.5972933 -0.5271235
29 30 31 32 33 34 35
0.5301882 -0.4698118 -0.4698118 -0.4027067 -0.4027067 0.5699197 -0.4698118
36 37 38 39 40 41 42
-0.4698118 -0.4202868 0.4728765 0.5301882 -0.4300803 0.4155649 0.4728765
43 44 45 46 47 48 49
0.5972933 -0.3629752 -0.4698118 0.5301882 -0.4698118 0.5301882 0.5301882
50 51 52 53 54 55 56
-0.4698118 -0.4873919 -0.4775984 0.5301882 -0.5844351 -0.4698118 0.5126081
57 58 59 60 61 62 63
0.4728765 0.5301882 0.5301882 0.5224016 0.6370248 -0.5271235 -0.4698118
64 65 66 67 68 69 70
0.6370248 -0.4698118 -0.4698118 -0.5447036 -0.4027067 0.5301882 -0.5271235
71 72 73 74 75 76 77
-0.4698118 0.5301882 0.4728765 -0.4600183 0.5301882 0.5699197 0.5301882
78 79 80 81 82 83 84
0.4728765 0.4552964 -0.4300803 -0.4698118 0.5399817 -0.4698118 -0.5844351
85 86 87 88 89 90 91
0.5301882 -0.4027067 0.7395473 0.7219672 -0.3275579 0.6724421 -0.3275579
92 93 94 95 96 97 98
-0.2207212 -0.2604527 -0.3275579 -0.2878264 0.6724421 -0.2207212 -0.3275579
99 100 101 102 103 104 105
-0.2604527 0.6724421 0.7395473 -0.3275579 -0.3275579 -0.3275579 -0.3451380
106 107 108 109 110 111 112
-0.3275579 -0.3275579 -0.2780328 -0.3275579 -0.2604527 -0.2780328 -0.2878264
113 114 115 116 117 118 119
-0.3848695 -0.2780328 -0.2604527 -0.3275579 0.7395473 -0.2604527 -0.3275579
120 121 122 123 124 125 126
0.6724421 -0.2604527 -0.3275579 -0.2780328 0.6151305 0.6724421 -0.2878264
127 128 129 130 131 132 133
-0.3275579 0.6724421 -0.3275579 0.6724421 -0.2604527 0.7395473 -0.3177644
134 135 136 137 138 139 140
-0.3275579 -0.3275579 -0.3275579 0.6822356 0.7219672 -0.2878264 -0.3275579
141 142 143 144 145 146 147
0.5578188 0.6548620 -0.2604527 0.6724421 -0.3275579 0.7121736 -0.3451380
148 149 150 151 152 153 154
-0.2878264 -0.2604527 0.6724421 0.6724421 -0.3750760 -0.3750760 -0.3177644
> postscript(file="/var/fisher/rcomp/tmp/63uvs1355751562.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.6370248 NA
1 -0.4698118 0.6370248
2 -0.4698118 -0.4698118
3 -0.4698118 -0.4698118
4 -0.4698118 -0.4698118
5 0.5972933 -0.4698118
6 -0.4698118 0.5972933
7 -0.4300803 -0.4698118
8 0.5301882 -0.4300803
9 -0.4027067 0.5301882
10 -0.3629752 -0.4027067
11 -0.4698118 -0.3629752
12 -0.5271235 -0.4698118
13 -0.3629752 -0.5271235
14 0.4728765 -0.3629752
15 0.5126081 0.4728765
16 -0.4775984 0.5126081
17 -0.3629752 -0.4775984
18 0.5301882 -0.3629752
19 0.4552964 0.5301882
20 -0.4027067 0.4552964
21 0.5399817 -0.4027067
22 0.5301882 0.5399817
23 0.5972933 0.5301882
24 0.5126081 0.5972933
25 -0.5271235 0.5126081
26 0.5972933 -0.5271235
27 -0.5271235 0.5972933
28 0.5301882 -0.5271235
29 -0.4698118 0.5301882
30 -0.4698118 -0.4698118
31 -0.4027067 -0.4698118
32 -0.4027067 -0.4027067
33 0.5699197 -0.4027067
34 -0.4698118 0.5699197
35 -0.4698118 -0.4698118
36 -0.4202868 -0.4698118
37 0.4728765 -0.4202868
38 0.5301882 0.4728765
39 -0.4300803 0.5301882
40 0.4155649 -0.4300803
41 0.4728765 0.4155649
42 0.5972933 0.4728765
43 -0.3629752 0.5972933
44 -0.4698118 -0.3629752
45 0.5301882 -0.4698118
46 -0.4698118 0.5301882
47 0.5301882 -0.4698118
48 0.5301882 0.5301882
49 -0.4698118 0.5301882
50 -0.4873919 -0.4698118
51 -0.4775984 -0.4873919
52 0.5301882 -0.4775984
53 -0.5844351 0.5301882
54 -0.4698118 -0.5844351
55 0.5126081 -0.4698118
56 0.4728765 0.5126081
57 0.5301882 0.4728765
58 0.5301882 0.5301882
59 0.5224016 0.5301882
60 0.6370248 0.5224016
61 -0.5271235 0.6370248
62 -0.4698118 -0.5271235
63 0.6370248 -0.4698118
64 -0.4698118 0.6370248
65 -0.4698118 -0.4698118
66 -0.5447036 -0.4698118
67 -0.4027067 -0.5447036
68 0.5301882 -0.4027067
69 -0.5271235 0.5301882
70 -0.4698118 -0.5271235
71 0.5301882 -0.4698118
72 0.4728765 0.5301882
73 -0.4600183 0.4728765
74 0.5301882 -0.4600183
75 0.5699197 0.5301882
76 0.5301882 0.5699197
77 0.4728765 0.5301882
78 0.4552964 0.4728765
79 -0.4300803 0.4552964
80 -0.4698118 -0.4300803
81 0.5399817 -0.4698118
82 -0.4698118 0.5399817
83 -0.5844351 -0.4698118
84 0.5301882 -0.5844351
85 -0.4027067 0.5301882
86 0.7395473 -0.4027067
87 0.7219672 0.7395473
88 -0.3275579 0.7219672
89 0.6724421 -0.3275579
90 -0.3275579 0.6724421
91 -0.2207212 -0.3275579
92 -0.2604527 -0.2207212
93 -0.3275579 -0.2604527
94 -0.2878264 -0.3275579
95 0.6724421 -0.2878264
96 -0.2207212 0.6724421
97 -0.3275579 -0.2207212
98 -0.2604527 -0.3275579
99 0.6724421 -0.2604527
100 0.7395473 0.6724421
101 -0.3275579 0.7395473
102 -0.3275579 -0.3275579
103 -0.3275579 -0.3275579
104 -0.3451380 -0.3275579
105 -0.3275579 -0.3451380
106 -0.3275579 -0.3275579
107 -0.2780328 -0.3275579
108 -0.3275579 -0.2780328
109 -0.2604527 -0.3275579
110 -0.2780328 -0.2604527
111 -0.2878264 -0.2780328
112 -0.3848695 -0.2878264
113 -0.2780328 -0.3848695
114 -0.2604527 -0.2780328
115 -0.3275579 -0.2604527
116 0.7395473 -0.3275579
117 -0.2604527 0.7395473
118 -0.3275579 -0.2604527
119 0.6724421 -0.3275579
120 -0.2604527 0.6724421
121 -0.3275579 -0.2604527
122 -0.2780328 -0.3275579
123 0.6151305 -0.2780328
124 0.6724421 0.6151305
125 -0.2878264 0.6724421
126 -0.3275579 -0.2878264
127 0.6724421 -0.3275579
128 -0.3275579 0.6724421
129 0.6724421 -0.3275579
130 -0.2604527 0.6724421
131 0.7395473 -0.2604527
132 -0.3177644 0.7395473
133 -0.3275579 -0.3177644
134 -0.3275579 -0.3275579
135 -0.3275579 -0.3275579
136 0.6822356 -0.3275579
137 0.7219672 0.6822356
138 -0.2878264 0.7219672
139 -0.3275579 -0.2878264
140 0.5578188 -0.3275579
141 0.6548620 0.5578188
142 -0.2604527 0.6548620
143 0.6724421 -0.2604527
144 -0.3275579 0.6724421
145 0.7121736 -0.3275579
146 -0.3451380 0.7121736
147 -0.2878264 -0.3451380
148 -0.2604527 -0.2878264
149 0.6724421 -0.2604527
150 0.6724421 0.6724421
151 -0.3750760 0.6724421
152 -0.3750760 -0.3750760
153 -0.3177644 -0.3750760
154 NA -0.3177644
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.4698118 0.6370248
[2,] -0.4698118 -0.4698118
[3,] -0.4698118 -0.4698118
[4,] -0.4698118 -0.4698118
[5,] 0.5972933 -0.4698118
[6,] -0.4698118 0.5972933
[7,] -0.4300803 -0.4698118
[8,] 0.5301882 -0.4300803
[9,] -0.4027067 0.5301882
[10,] -0.3629752 -0.4027067
[11,] -0.4698118 -0.3629752
[12,] -0.5271235 -0.4698118
[13,] -0.3629752 -0.5271235
[14,] 0.4728765 -0.3629752
[15,] 0.5126081 0.4728765
[16,] -0.4775984 0.5126081
[17,] -0.3629752 -0.4775984
[18,] 0.5301882 -0.3629752
[19,] 0.4552964 0.5301882
[20,] -0.4027067 0.4552964
[21,] 0.5399817 -0.4027067
[22,] 0.5301882 0.5399817
[23,] 0.5972933 0.5301882
[24,] 0.5126081 0.5972933
[25,] -0.5271235 0.5126081
[26,] 0.5972933 -0.5271235
[27,] -0.5271235 0.5972933
[28,] 0.5301882 -0.5271235
[29,] -0.4698118 0.5301882
[30,] -0.4698118 -0.4698118
[31,] -0.4027067 -0.4698118
[32,] -0.4027067 -0.4027067
[33,] 0.5699197 -0.4027067
[34,] -0.4698118 0.5699197
[35,] -0.4698118 -0.4698118
[36,] -0.4202868 -0.4698118
[37,] 0.4728765 -0.4202868
[38,] 0.5301882 0.4728765
[39,] -0.4300803 0.5301882
[40,] 0.4155649 -0.4300803
[41,] 0.4728765 0.4155649
[42,] 0.5972933 0.4728765
[43,] -0.3629752 0.5972933
[44,] -0.4698118 -0.3629752
[45,] 0.5301882 -0.4698118
[46,] -0.4698118 0.5301882
[47,] 0.5301882 -0.4698118
[48,] 0.5301882 0.5301882
[49,] -0.4698118 0.5301882
[50,] -0.4873919 -0.4698118
[51,] -0.4775984 -0.4873919
[52,] 0.5301882 -0.4775984
[53,] -0.5844351 0.5301882
[54,] -0.4698118 -0.5844351
[55,] 0.5126081 -0.4698118
[56,] 0.4728765 0.5126081
[57,] 0.5301882 0.4728765
[58,] 0.5301882 0.5301882
[59,] 0.5224016 0.5301882
[60,] 0.6370248 0.5224016
[61,] -0.5271235 0.6370248
[62,] -0.4698118 -0.5271235
[63,] 0.6370248 -0.4698118
[64,] -0.4698118 0.6370248
[65,] -0.4698118 -0.4698118
[66,] -0.5447036 -0.4698118
[67,] -0.4027067 -0.5447036
[68,] 0.5301882 -0.4027067
[69,] -0.5271235 0.5301882
[70,] -0.4698118 -0.5271235
[71,] 0.5301882 -0.4698118
[72,] 0.4728765 0.5301882
[73,] -0.4600183 0.4728765
[74,] 0.5301882 -0.4600183
[75,] 0.5699197 0.5301882
[76,] 0.5301882 0.5699197
[77,] 0.4728765 0.5301882
[78,] 0.4552964 0.4728765
[79,] -0.4300803 0.4552964
[80,] -0.4698118 -0.4300803
[81,] 0.5399817 -0.4698118
[82,] -0.4698118 0.5399817
[83,] -0.5844351 -0.4698118
[84,] 0.5301882 -0.5844351
[85,] -0.4027067 0.5301882
[86,] 0.7395473 -0.4027067
[87,] 0.7219672 0.7395473
[88,] -0.3275579 0.7219672
[89,] 0.6724421 -0.3275579
[90,] -0.3275579 0.6724421
[91,] -0.2207212 -0.3275579
[92,] -0.2604527 -0.2207212
[93,] -0.3275579 -0.2604527
[94,] -0.2878264 -0.3275579
[95,] 0.6724421 -0.2878264
[96,] -0.2207212 0.6724421
[97,] -0.3275579 -0.2207212
[98,] -0.2604527 -0.3275579
[99,] 0.6724421 -0.2604527
[100,] 0.7395473 0.6724421
[101,] -0.3275579 0.7395473
[102,] -0.3275579 -0.3275579
[103,] -0.3275579 -0.3275579
[104,] -0.3451380 -0.3275579
[105,] -0.3275579 -0.3451380
[106,] -0.3275579 -0.3275579
[107,] -0.2780328 -0.3275579
[108,] -0.3275579 -0.2780328
[109,] -0.2604527 -0.3275579
[110,] -0.2780328 -0.2604527
[111,] -0.2878264 -0.2780328
[112,] -0.3848695 -0.2878264
[113,] -0.2780328 -0.3848695
[114,] -0.2604527 -0.2780328
[115,] -0.3275579 -0.2604527
[116,] 0.7395473 -0.3275579
[117,] -0.2604527 0.7395473
[118,] -0.3275579 -0.2604527
[119,] 0.6724421 -0.3275579
[120,] -0.2604527 0.6724421
[121,] -0.3275579 -0.2604527
[122,] -0.2780328 -0.3275579
[123,] 0.6151305 -0.2780328
[124,] 0.6724421 0.6151305
[125,] -0.2878264 0.6724421
[126,] -0.3275579 -0.2878264
[127,] 0.6724421 -0.3275579
[128,] -0.3275579 0.6724421
[129,] 0.6724421 -0.3275579
[130,] -0.2604527 0.6724421
[131,] 0.7395473 -0.2604527
[132,] -0.3177644 0.7395473
[133,] -0.3275579 -0.3177644
[134,] -0.3275579 -0.3275579
[135,] -0.3275579 -0.3275579
[136,] 0.6822356 -0.3275579
[137,] 0.7219672 0.6822356
[138,] -0.2878264 0.7219672
[139,] -0.3275579 -0.2878264
[140,] 0.5578188 -0.3275579
[141,] 0.6548620 0.5578188
[142,] -0.2604527 0.6548620
[143,] 0.6724421 -0.2604527
[144,] -0.3275579 0.6724421
[145,] 0.7121736 -0.3275579
[146,] -0.3451380 0.7121736
[147,] -0.2878264 -0.3451380
[148,] -0.2604527 -0.2878264
[149,] 0.6724421 -0.2604527
[150,] 0.6724421 0.6724421
[151,] -0.3750760 0.6724421
[152,] -0.3750760 -0.3750760
[153,] -0.3177644 -0.3750760
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.4698118 0.6370248
2 -0.4698118 -0.4698118
3 -0.4698118 -0.4698118
4 -0.4698118 -0.4698118
5 0.5972933 -0.4698118
6 -0.4698118 0.5972933
7 -0.4300803 -0.4698118
8 0.5301882 -0.4300803
9 -0.4027067 0.5301882
10 -0.3629752 -0.4027067
11 -0.4698118 -0.3629752
12 -0.5271235 -0.4698118
13 -0.3629752 -0.5271235
14 0.4728765 -0.3629752
15 0.5126081 0.4728765
16 -0.4775984 0.5126081
17 -0.3629752 -0.4775984
18 0.5301882 -0.3629752
19 0.4552964 0.5301882
20 -0.4027067 0.4552964
21 0.5399817 -0.4027067
22 0.5301882 0.5399817
23 0.5972933 0.5301882
24 0.5126081 0.5972933
25 -0.5271235 0.5126081
26 0.5972933 -0.5271235
27 -0.5271235 0.5972933
28 0.5301882 -0.5271235
29 -0.4698118 0.5301882
30 -0.4698118 -0.4698118
31 -0.4027067 -0.4698118
32 -0.4027067 -0.4027067
33 0.5699197 -0.4027067
34 -0.4698118 0.5699197
35 -0.4698118 -0.4698118
36 -0.4202868 -0.4698118
37 0.4728765 -0.4202868
38 0.5301882 0.4728765
39 -0.4300803 0.5301882
40 0.4155649 -0.4300803
41 0.4728765 0.4155649
42 0.5972933 0.4728765
43 -0.3629752 0.5972933
44 -0.4698118 -0.3629752
45 0.5301882 -0.4698118
46 -0.4698118 0.5301882
47 0.5301882 -0.4698118
48 0.5301882 0.5301882
49 -0.4698118 0.5301882
50 -0.4873919 -0.4698118
51 -0.4775984 -0.4873919
52 0.5301882 -0.4775984
53 -0.5844351 0.5301882
54 -0.4698118 -0.5844351
55 0.5126081 -0.4698118
56 0.4728765 0.5126081
57 0.5301882 0.4728765
58 0.5301882 0.5301882
59 0.5224016 0.5301882
60 0.6370248 0.5224016
61 -0.5271235 0.6370248
62 -0.4698118 -0.5271235
63 0.6370248 -0.4698118
64 -0.4698118 0.6370248
65 -0.4698118 -0.4698118
66 -0.5447036 -0.4698118
67 -0.4027067 -0.5447036
68 0.5301882 -0.4027067
69 -0.5271235 0.5301882
70 -0.4698118 -0.5271235
71 0.5301882 -0.4698118
72 0.4728765 0.5301882
73 -0.4600183 0.4728765
74 0.5301882 -0.4600183
75 0.5699197 0.5301882
76 0.5301882 0.5699197
77 0.4728765 0.5301882
78 0.4552964 0.4728765
79 -0.4300803 0.4552964
80 -0.4698118 -0.4300803
81 0.5399817 -0.4698118
82 -0.4698118 0.5399817
83 -0.5844351 -0.4698118
84 0.5301882 -0.5844351
85 -0.4027067 0.5301882
86 0.7395473 -0.4027067
87 0.7219672 0.7395473
88 -0.3275579 0.7219672
89 0.6724421 -0.3275579
90 -0.3275579 0.6724421
91 -0.2207212 -0.3275579
92 -0.2604527 -0.2207212
93 -0.3275579 -0.2604527
94 -0.2878264 -0.3275579
95 0.6724421 -0.2878264
96 -0.2207212 0.6724421
97 -0.3275579 -0.2207212
98 -0.2604527 -0.3275579
99 0.6724421 -0.2604527
100 0.7395473 0.6724421
101 -0.3275579 0.7395473
102 -0.3275579 -0.3275579
103 -0.3275579 -0.3275579
104 -0.3451380 -0.3275579
105 -0.3275579 -0.3451380
106 -0.3275579 -0.3275579
107 -0.2780328 -0.3275579
108 -0.3275579 -0.2780328
109 -0.2604527 -0.3275579
110 -0.2780328 -0.2604527
111 -0.2878264 -0.2780328
112 -0.3848695 -0.2878264
113 -0.2780328 -0.3848695
114 -0.2604527 -0.2780328
115 -0.3275579 -0.2604527
116 0.7395473 -0.3275579
117 -0.2604527 0.7395473
118 -0.3275579 -0.2604527
119 0.6724421 -0.3275579
120 -0.2604527 0.6724421
121 -0.3275579 -0.2604527
122 -0.2780328 -0.3275579
123 0.6151305 -0.2780328
124 0.6724421 0.6151305
125 -0.2878264 0.6724421
126 -0.3275579 -0.2878264
127 0.6724421 -0.3275579
128 -0.3275579 0.6724421
129 0.6724421 -0.3275579
130 -0.2604527 0.6724421
131 0.7395473 -0.2604527
132 -0.3177644 0.7395473
133 -0.3275579 -0.3177644
134 -0.3275579 -0.3275579
135 -0.3275579 -0.3275579
136 0.6822356 -0.3275579
137 0.7219672 0.6822356
138 -0.2878264 0.7219672
139 -0.3275579 -0.2878264
140 0.5578188 -0.3275579
141 0.6548620 0.5578188
142 -0.2604527 0.6548620
143 0.6724421 -0.2604527
144 -0.3275579 0.6724421
145 0.7121736 -0.3275579
146 -0.3451380 0.7121736
147 -0.2878264 -0.3451380
148 -0.2604527 -0.2878264
149 0.6724421 -0.2604527
150 0.6724421 0.6724421
151 -0.3750760 0.6724421
152 -0.3750760 -0.3750760
153 -0.3177644 -0.3750760
> 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/78ucg1355751562.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/8x72d1355751562.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/9gs2q1355751562.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/10toa91355751562.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/11qfi21355751562.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/12e2ui1355751562.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/13g8mt1355751563.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/14e8z11355751563.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/15w0ps1355751563.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/16mnww1355751563.tab")
+ }
>
> try(system("convert tmp/1ijwc1355751562.ps tmp/1ijwc1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/2t5691355751562.ps tmp/2t5691355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/3jrol1355751562.ps tmp/3jrol1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/4eff41355751562.ps tmp/4eff41355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/5h2no1355751562.ps tmp/5h2no1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/63uvs1355751562.ps tmp/63uvs1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/78ucg1355751562.ps tmp/78ucg1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/8x72d1355751562.ps tmp/8x72d1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/9gs2q1355751562.ps tmp/9gs2q1355751562.png",intern=TRUE))
character(0)
> try(system("convert tmp/10toa91355751562.ps tmp/10toa91355751562.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.266 1.805 10.137