R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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.09,0,2.11,2.05,0,2.09,2.08,0,2.05,2.06,0,2.08,2.06,0,2.06,2.08,0,2.06,2.07,0,2.08,2.06,0,2.07,2.07,0,2.06,2.06,0,2.07,2.09,0,2.06,2.07,0,2.09,2.09,0,2.07,2.28,0,2.09,2.33,0,2.28,2.35,0,2.33,2.52,0,2.35,2.63,0,2.52,2.58,0,2.63,2.70,0,2.58,2.81,0,2.70,2.97,0,2.81,3.04,0,2.97,3.28,0,3.04,3.33,0,3.28,3.50,0,3.33,3.56,0,3.50,3.57,0,3.56,3.69,0,3.57,3.82,0,3.69,3.79,0,3.82,3.96,0,3.79,4.06,0,3.96,4.05,0,4.06,4.03,0,4.05,3.94,0,4.03,4.02,0,3.94,3.88,0,4.02,4.02,0,3.88,4.03,0,4.02,4.09,0,4.03,3.99,0,4.09,4.01,0,3.99,4.01,0,4.01,4.19,0,4.01,4.30,0,4.19,4.27,0,4.30,3.82,0,4.27,3.15,1,3.82,2.49,1,3.15,1.81,1,2.49,1.26,1,1.81,1.06,1,1.26,0.84,1,1.06,0.78,1,0.84,0.70,1,0.78,0.36,1,0.70,0.35,1,0.36,0.36,1,0.35),dim=c(3,59),dimnames=list(c('Y','X','Y1'),1:59)) > y <- array(NA,dim=c(3,59),dimnames=list(c('Y','X','Y1'),1:59)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'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.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 Y X Y1 t 1 2.09 0 2.11 1 2 2.05 0 2.09 2 3 2.08 0 2.05 3 4 2.06 0 2.08 4 5 2.06 0 2.06 5 6 2.08 0 2.06 6 7 2.07 0 2.08 7 8 2.06 0 2.07 8 9 2.07 0 2.06 9 10 2.06 0 2.07 10 11 2.09 0 2.06 11 12 2.07 0 2.09 12 13 2.09 0 2.07 13 14 2.28 0 2.09 14 15 2.33 0 2.28 15 16 2.35 0 2.33 16 17 2.52 0 2.35 17 18 2.63 0 2.52 18 19 2.58 0 2.63 19 20 2.70 0 2.58 20 21 2.81 0 2.70 21 22 2.97 0 2.81 22 23 3.04 0 2.97 23 24 3.28 0 3.04 24 25 3.33 0 3.28 25 26 3.50 0 3.33 26 27 3.56 0 3.50 27 28 3.57 0 3.56 28 29 3.69 0 3.57 29 30 3.82 0 3.69 30 31 3.79 0 3.82 31 32 3.96 0 3.79 32 33 4.06 0 3.96 33 34 4.05 0 4.06 34 35 4.03 0 4.05 35 36 3.94 0 4.03 36 37 4.02 0 3.94 37 38 3.88 0 4.02 38 39 4.02 0 3.88 39 40 4.03 0 4.02 40 41 4.09 0 4.03 41 42 3.99 0 4.09 42 43 4.01 0 3.99 43 44 4.01 0 4.01 44 45 4.19 0 4.01 45 46 4.30 0 4.19 46 47 4.27 0 4.30 47 48 3.82 0 4.27 48 49 3.15 1 3.82 49 50 2.49 1 3.15 50 51 1.81 1 2.49 51 52 1.26 1 1.81 52 53 1.06 1 1.26 53 54 0.84 1 1.06 54 55 0.78 1 0.84 55 56 0.70 1 0.78 56 57 0.36 1 0.70 57 58 0.35 1 0.36 58 59 0.36 1 0.35 59 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X Y1 t 0.33565 -0.89864 0.82882 0.00939 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.50545 -0.05996 0.01710 0.07793 0.19937 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.335653 0.056319 5.960 1.87e-07 *** X -0.898645 0.096710 -9.292 7.23e-13 *** Y1 0.828817 0.025505 32.496 < 2e-16 *** t 0.009391 0.001831 5.129 3.91e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.1157 on 55 degrees of freedom Multiple R-squared: 0.9903, Adjusted R-squared: 0.9898 F-statistic: 1873 on 3 and 55 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,] 5.783861e-03 1.156772e-02 0.9942161 [2,] 7.988417e-04 1.597683e-03 0.9992012 [3,] 1.029792e-04 2.059584e-04 0.9998970 [4,] 1.232422e-05 2.464845e-05 0.9999877 [5,] 4.556036e-06 9.112073e-06 0.9999954 [6,] 6.202088e-07 1.240418e-06 0.9999994 [7,] 1.500531e-07 3.001061e-07 0.9999998 [8,] 3.580205e-03 7.160410e-03 0.9964198 [9,] 1.582664e-03 3.165327e-03 0.9984173 [10,] 8.318060e-04 1.663612e-03 0.9991682 [11,] 1.509113e-03 3.018226e-03 0.9984909 [12,] 6.483236e-04 1.296647e-03 0.9993517 [13,] 3.226195e-03 6.452391e-03 0.9967738 [14,] 2.355098e-03 4.710196e-03 0.9976449 [15,] 1.460064e-03 2.920127e-03 0.9985399 [16,] 1.080152e-03 2.160304e-03 0.9989198 [17,] 7.316868e-04 1.463374e-03 0.9992683 [18,] 1.264194e-03 2.528388e-03 0.9987358 [19,] 1.305645e-03 2.611290e-03 0.9986944 [20,] 7.187814e-04 1.437563e-03 0.9992812 [21,] 5.385171e-04 1.077034e-03 0.9994615 [22,] 7.192771e-04 1.438554e-03 0.9992807 [23,] 3.478259e-04 6.956517e-04 0.9996522 [24,] 1.652049e-04 3.304098e-04 0.9998348 [25,] 3.597856e-04 7.195712e-04 0.9996402 [26,] 2.575371e-04 5.150742e-04 0.9997425 [27,] 1.300761e-04 2.601521e-04 0.9998699 [28,] 1.300187e-04 2.600374e-04 0.9998700 [29,] 1.347010e-04 2.694020e-04 0.9998653 [30,] 4.833018e-04 9.666036e-04 0.9995167 [31,] 2.368805e-04 4.737611e-04 0.9997631 [32,] 2.249980e-03 4.499960e-03 0.9977500 [33,] 1.261292e-03 2.522584e-03 0.9987387 [34,] 8.296448e-04 1.659290e-03 0.9991704 [35,] 4.166778e-04 8.333556e-04 0.9995833 [36,] 9.597269e-04 1.919454e-03 0.9990403 [37,] 5.722147e-04 1.144429e-03 0.9994278 [38,] 3.809718e-04 7.619435e-04 0.9996190 [39,] 4.143920e-04 8.287839e-04 0.9995856 [40,] 1.497244e-03 2.994489e-03 0.9985028 [41,] 2.708363e-02 5.416727e-02 0.9729164 [42,] 1.707000e-01 3.414001e-01 0.8293000 [43,] 2.255601e-01 4.511202e-01 0.7744399 [44,] 3.729708e-01 7.459416e-01 0.6270292 [45,] 4.289710e-01 8.579420e-01 0.5710290 [46,] 3.147052e-01 6.294104e-01 0.6852948 > postscript(file="/var/www/html/rcomp/tmp/1utvz1258724329.ps",horizontal=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/html/rcomp/tmp/24hoa1258724329.ps",horizontal=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/html/rcomp/tmp/3j1bp1258724329.ps",horizontal=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/html/rcomp/tmp/4336d1258724329.ps",horizontal=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/html/rcomp/tmp/5h2nh1258724329.ps",horizontal=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 = 59 Frequency = 1 1 2 3 4 5 6 -0.003848319 -0.036662486 0.017099693 -0.037155335 -0.029969502 -0.019360013 7 8 9 10 11 12 -0.055326868 -0.066429207 -0.057531546 -0.085210229 -0.056312568 -0.110567596 13 14 15 16 17 18 -0.083381762 0.080651382 -0.036214404 -0.067045776 0.076987368 0.036697927 19 20 21 22 23 24 -0.113862480 0.038187871 0.039339292 0.098778885 0.026777616 0.199369899 25 26 27 28 29 30 0.041063251 0.160231879 0.069942438 0.020822893 0.123144209 0.144295630 31 32 33 34 35 36 -0.002841121 0.182632885 0.132343444 0.030071209 0.008968871 -0.073845296 37 38 39 40 41 42 0.071357744 -0.144338146 0.102305756 -0.013119168 0.029202149 -0.129917396 43 44 45 46 47 48 -0.036426184 -0.062393039 0.108216450 0.059638836 -0.070921570 -0.505447564 49 50 51 52 53 54 0.086774577 -0.027308387 -0.169679523 -0.165474314 0.080984654 0.017357589 55 56 57 58 59 0.130306870 0.090645393 -0.192439739 0.069967610 0.078865271 > postscript(file="/var/www/html/rcomp/tmp/6v48o1258724329.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 59 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.003848319 NA 1 -0.036662486 -0.003848319 2 0.017099693 -0.036662486 3 -0.037155335 0.017099693 4 -0.029969502 -0.037155335 5 -0.019360013 -0.029969502 6 -0.055326868 -0.019360013 7 -0.066429207 -0.055326868 8 -0.057531546 -0.066429207 9 -0.085210229 -0.057531546 10 -0.056312568 -0.085210229 11 -0.110567596 -0.056312568 12 -0.083381762 -0.110567596 13 0.080651382 -0.083381762 14 -0.036214404 0.080651382 15 -0.067045776 -0.036214404 16 0.076987368 -0.067045776 17 0.036697927 0.076987368 18 -0.113862480 0.036697927 19 0.038187871 -0.113862480 20 0.039339292 0.038187871 21 0.098778885 0.039339292 22 0.026777616 0.098778885 23 0.199369899 0.026777616 24 0.041063251 0.199369899 25 0.160231879 0.041063251 26 0.069942438 0.160231879 27 0.020822893 0.069942438 28 0.123144209 0.020822893 29 0.144295630 0.123144209 30 -0.002841121 0.144295630 31 0.182632885 -0.002841121 32 0.132343444 0.182632885 33 0.030071209 0.132343444 34 0.008968871 0.030071209 35 -0.073845296 0.008968871 36 0.071357744 -0.073845296 37 -0.144338146 0.071357744 38 0.102305756 -0.144338146 39 -0.013119168 0.102305756 40 0.029202149 -0.013119168 41 -0.129917396 0.029202149 42 -0.036426184 -0.129917396 43 -0.062393039 -0.036426184 44 0.108216450 -0.062393039 45 0.059638836 0.108216450 46 -0.070921570 0.059638836 47 -0.505447564 -0.070921570 48 0.086774577 -0.505447564 49 -0.027308387 0.086774577 50 -0.169679523 -0.027308387 51 -0.165474314 -0.169679523 52 0.080984654 -0.165474314 53 0.017357589 0.080984654 54 0.130306870 0.017357589 55 0.090645393 0.130306870 56 -0.192439739 0.090645393 57 0.069967610 -0.192439739 58 0.078865271 0.069967610 59 NA 0.078865271 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.036662486 -0.003848319 [2,] 0.017099693 -0.036662486 [3,] -0.037155335 0.017099693 [4,] -0.029969502 -0.037155335 [5,] -0.019360013 -0.029969502 [6,] -0.055326868 -0.019360013 [7,] -0.066429207 -0.055326868 [8,] -0.057531546 -0.066429207 [9,] -0.085210229 -0.057531546 [10,] -0.056312568 -0.085210229 [11,] -0.110567596 -0.056312568 [12,] -0.083381762 -0.110567596 [13,] 0.080651382 -0.083381762 [14,] -0.036214404 0.080651382 [15,] -0.067045776 -0.036214404 [16,] 0.076987368 -0.067045776 [17,] 0.036697927 0.076987368 [18,] -0.113862480 0.036697927 [19,] 0.038187871 -0.113862480 [20,] 0.039339292 0.038187871 [21,] 0.098778885 0.039339292 [22,] 0.026777616 0.098778885 [23,] 0.199369899 0.026777616 [24,] 0.041063251 0.199369899 [25,] 0.160231879 0.041063251 [26,] 0.069942438 0.160231879 [27,] 0.020822893 0.069942438 [28,] 0.123144209 0.020822893 [29,] 0.144295630 0.123144209 [30,] -0.002841121 0.144295630 [31,] 0.182632885 -0.002841121 [32,] 0.132343444 0.182632885 [33,] 0.030071209 0.132343444 [34,] 0.008968871 0.030071209 [35,] -0.073845296 0.008968871 [36,] 0.071357744 -0.073845296 [37,] -0.144338146 0.071357744 [38,] 0.102305756 -0.144338146 [39,] -0.013119168 0.102305756 [40,] 0.029202149 -0.013119168 [41,] -0.129917396 0.029202149 [42,] -0.036426184 -0.129917396 [43,] -0.062393039 -0.036426184 [44,] 0.108216450 -0.062393039 [45,] 0.059638836 0.108216450 [46,] -0.070921570 0.059638836 [47,] -0.505447564 -0.070921570 [48,] 0.086774577 -0.505447564 [49,] -0.027308387 0.086774577 [50,] -0.169679523 -0.027308387 [51,] -0.165474314 -0.169679523 [52,] 0.080984654 -0.165474314 [53,] 0.017357589 0.080984654 [54,] 0.130306870 0.017357589 [55,] 0.090645393 0.130306870 [56,] -0.192439739 0.090645393 [57,] 0.069967610 -0.192439739 [58,] 0.078865271 0.069967610 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.036662486 -0.003848319 2 0.017099693 -0.036662486 3 -0.037155335 0.017099693 4 -0.029969502 -0.037155335 5 -0.019360013 -0.029969502 6 -0.055326868 -0.019360013 7 -0.066429207 -0.055326868 8 -0.057531546 -0.066429207 9 -0.085210229 -0.057531546 10 -0.056312568 -0.085210229 11 -0.110567596 -0.056312568 12 -0.083381762 -0.110567596 13 0.080651382 -0.083381762 14 -0.036214404 0.080651382 15 -0.067045776 -0.036214404 16 0.076987368 -0.067045776 17 0.036697927 0.076987368 18 -0.113862480 0.036697927 19 0.038187871 -0.113862480 20 0.039339292 0.038187871 21 0.098778885 0.039339292 22 0.026777616 0.098778885 23 0.199369899 0.026777616 24 0.041063251 0.199369899 25 0.160231879 0.041063251 26 0.069942438 0.160231879 27 0.020822893 0.069942438 28 0.123144209 0.020822893 29 0.144295630 0.123144209 30 -0.002841121 0.144295630 31 0.182632885 -0.002841121 32 0.132343444 0.182632885 33 0.030071209 0.132343444 34 0.008968871 0.030071209 35 -0.073845296 0.008968871 36 0.071357744 -0.073845296 37 -0.144338146 0.071357744 38 0.102305756 -0.144338146 39 -0.013119168 0.102305756 40 0.029202149 -0.013119168 41 -0.129917396 0.029202149 42 -0.036426184 -0.129917396 43 -0.062393039 -0.036426184 44 0.108216450 -0.062393039 45 0.059638836 0.108216450 46 -0.070921570 0.059638836 47 -0.505447564 -0.070921570 48 0.086774577 -0.505447564 49 -0.027308387 0.086774577 50 -0.169679523 -0.027308387 51 -0.165474314 -0.169679523 52 0.080984654 -0.165474314 53 0.017357589 0.080984654 54 0.130306870 0.017357589 55 0.090645393 0.130306870 56 -0.192439739 0.090645393 57 0.069967610 -0.192439739 58 0.078865271 0.069967610 > 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/html/rcomp/tmp/7raup1258724329.ps",horizontal=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/html/rcomp/tmp/8iyyp1258724329.ps",horizontal=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/html/rcomp/tmp/964xr1258724329.ps",horizontal=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/html/rcomp/tmp/101m9v1258724329.ps",horizontal=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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/11my1m1258724329.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/html/rcomp/tmp/12impf1258724329.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/html/rcomp/tmp/13o4ld1258724329.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/html/rcomp/tmp/142ta11258724329.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/html/rcomp/tmp/15xkt81258724329.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/html/rcomp/tmp/16mx911258724329.tab") + } > > system("convert tmp/1utvz1258724329.ps tmp/1utvz1258724329.png") > system("convert tmp/24hoa1258724329.ps tmp/24hoa1258724329.png") > system("convert tmp/3j1bp1258724329.ps tmp/3j1bp1258724329.png") > system("convert tmp/4336d1258724329.ps tmp/4336d1258724329.png") > system("convert tmp/5h2nh1258724329.ps tmp/5h2nh1258724329.png") > system("convert tmp/6v48o1258724329.ps tmp/6v48o1258724329.png") > system("convert tmp/7raup1258724329.ps tmp/7raup1258724329.png") > system("convert tmp/8iyyp1258724329.ps tmp/8iyyp1258724329.png") > system("convert tmp/964xr1258724329.ps tmp/964xr1258724329.png") > system("convert tmp/101m9v1258724329.ps tmp/101m9v1258724329.png") > > > proc.time() user system elapsed 2.465 1.576 2.836