R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(47.54,45.31,46.9,47.16,48.24,52.7,51.72,51.5,52.45,53,48.36,46.63,45.92,45.53,42.17,43.66,45.32,47.43,47.76,49.49,50.69,49.8,52.13,53.94,60.75,59.19,57.58,59.16,64.74,67.04,75.53,78.91,78.4,70.07,66.8,61.02,52.38,42.37,39.83,38.79,37.33,39.4,39.45,43.24,42.33,45.5,43.44,43.88,45.61,45.12,47.56,47.04,51.07,54.72,55.37,55.39,53.13,53.71,54.59,54.61),dim=c(1,60),dimnames=list(c('Y'),1:60)) > y <- array(NA,dim=c(1,60),dimnames=list(c('Y'),1:60)) > 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 = 'Include Monthly 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 > 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 47.54 1 0 0 0 0 0 0 0 0 0 0 1 2 45.31 0 1 0 0 0 0 0 0 0 0 0 2 3 46.90 0 0 1 0 0 0 0 0 0 0 0 3 4 47.16 0 0 0 1 0 0 0 0 0 0 0 4 5 48.24 0 0 0 0 1 0 0 0 0 0 0 5 6 52.70 0 0 0 0 0 1 0 0 0 0 0 6 7 51.72 0 0 0 0 0 0 1 0 0 0 0 7 8 51.50 0 0 0 0 0 0 0 1 0 0 0 8 9 52.45 0 0 0 0 0 0 0 0 1 0 0 9 10 53.00 0 0 0 0 0 0 0 0 0 1 0 10 11 48.36 0 0 0 0 0 0 0 0 0 0 1 11 12 46.63 0 0 0 0 0 0 0 0 0 0 0 12 13 45.92 1 0 0 0 0 0 0 0 0 0 0 13 14 45.53 0 1 0 0 0 0 0 0 0 0 0 14 15 42.17 0 0 1 0 0 0 0 0 0 0 0 15 16 43.66 0 0 0 1 0 0 0 0 0 0 0 16 17 45.32 0 0 0 0 1 0 0 0 0 0 0 17 18 47.43 0 0 0 0 0 1 0 0 0 0 0 18 19 47.76 0 0 0 0 0 0 1 0 0 0 0 19 20 49.49 0 0 0 0 0 0 0 1 0 0 0 20 21 50.69 0 0 0 0 0 0 0 0 1 0 0 21 22 49.80 0 0 0 0 0 0 0 0 0 1 0 22 23 52.13 0 0 0 0 0 0 0 0 0 0 1 23 24 53.94 0 0 0 0 0 0 0 0 0 0 0 24 25 60.75 1 0 0 0 0 0 0 0 0 0 0 25 26 59.19 0 1 0 0 0 0 0 0 0 0 0 26 27 57.58 0 0 1 0 0 0 0 0 0 0 0 27 28 59.16 0 0 0 1 0 0 0 0 0 0 0 28 29 64.74 0 0 0 0 1 0 0 0 0 0 0 29 30 67.04 0 0 0 0 0 1 0 0 0 0 0 30 31 75.53 0 0 0 0 0 0 1 0 0 0 0 31 32 78.91 0 0 0 0 0 0 0 1 0 0 0 32 33 78.40 0 0 0 0 0 0 0 0 1 0 0 33 34 70.07 0 0 0 0 0 0 0 0 0 1 0 34 35 66.80 0 0 0 0 0 0 0 0 0 0 1 35 36 61.02 0 0 0 0 0 0 0 0 0 0 0 36 37 52.38 1 0 0 0 0 0 0 0 0 0 0 37 38 42.37 0 1 0 0 0 0 0 0 0 0 0 38 39 39.83 0 0 1 0 0 0 0 0 0 0 0 39 40 38.79 0 0 0 1 0 0 0 0 0 0 0 40 41 37.33 0 0 0 0 1 0 0 0 0 0 0 41 42 39.40 0 0 0 0 0 1 0 0 0 0 0 42 43 39.45 0 0 0 0 0 0 1 0 0 0 0 43 44 43.24 0 0 0 0 0 0 0 1 0 0 0 44 45 42.33 0 0 0 0 0 0 0 0 1 0 0 45 46 45.50 0 0 0 0 0 0 0 0 0 1 0 46 47 43.44 0 0 0 0 0 0 0 0 0 0 1 47 48 43.88 0 0 0 0 0 0 0 0 0 0 0 48 49 45.61 1 0 0 0 0 0 0 0 0 0 0 49 50 45.12 0 1 0 0 0 0 0 0 0 0 0 50 51 47.56 0 0 1 0 0 0 0 0 0 0 0 51 52 47.04 0 0 0 1 0 0 0 0 0 0 0 52 53 51.07 0 0 0 0 1 0 0 0 0 0 0 53 54 54.72 0 0 0 0 0 1 0 0 0 0 0 54 55 55.37 0 0 0 0 0 0 1 0 0 0 0 55 56 55.39 0 0 0 0 0 0 0 1 0 0 0 56 57 53.13 0 0 0 0 0 0 0 0 1 0 0 57 58 53.71 0 0 0 0 0 0 0 0 0 1 0 58 59 54.59 0 0 0 0 0 0 0 0 0 0 1 59 60 54.61 0 0 0 0 0 0 0 0 0 0 0 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 52.343000 -1.675917 -4.602833 -5.289750 -4.926667 -2.739583 M6 M7 M8 M9 M10 M11 0.187500 1.904583 3.653667 3.356750 2.381833 1.038917 t -0.009083 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -14.407 -4.926 -2.067 1.973 23.204 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 52.343000 5.196676 10.072 2.54e-13 *** M1 -1.675917 6.322048 -0.265 0.792 M2 -4.602833 6.312602 -0.729 0.470 M3 -5.289750 6.304044 -0.839 0.406 M4 -4.926667 6.296376 -0.782 0.438 M5 -2.739583 6.289604 -0.436 0.665 M6 0.187500 6.283728 0.030 0.976 M7 1.904583 6.278752 0.303 0.763 M8 3.653667 6.274677 0.582 0.563 M9 3.356750 6.271507 0.535 0.595 M10 2.381833 6.269241 0.380 0.706 M11 1.038917 6.267881 0.166 0.869 t -0.009083 0.075385 -0.120 0.905 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 9.91 on 47 degrees of freedom Multiple R-squared: 0.1096, Adjusted R-squared: -0.1177 F-statistic: 0.4822 on 12 and 47 DF, p-value: 0.9151 > 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,] 3.244523e-03 6.489047e-03 9.967555e-01 [2,] 3.660844e-04 7.321688e-04 9.996339e-01 [3,] 9.244892e-05 1.848978e-04 9.999076e-01 [4,] 1.259200e-05 2.518400e-05 9.999874e-01 [5,] 1.864048e-06 3.728097e-06 9.999981e-01 [6,] 2.901150e-07 5.802300e-07 9.999997e-01 [7,] 3.943677e-08 7.887354e-08 1.000000e+00 [8,] 6.119424e-07 1.223885e-06 9.999994e-01 [9,] 9.412305e-06 1.882461e-05 9.999906e-01 [10,] 5.892899e-04 1.178580e-03 9.994107e-01 [11,] 1.292313e-03 2.584626e-03 9.987077e-01 [12,] 1.235225e-03 2.470451e-03 9.987648e-01 [13,] 1.037408e-03 2.074816e-03 9.989626e-01 [14,] 1.513521e-03 3.027042e-03 9.984865e-01 [15,] 1.467777e-03 2.935555e-03 9.985322e-01 [16,] 6.819739e-03 1.363948e-02 9.931803e-01 [17,] 3.304088e-02 6.608177e-02 9.669591e-01 [18,] 1.452240e-01 2.904480e-01 8.547760e-01 [19,] 2.638977e-01 5.277954e-01 7.361023e-01 [20,] 5.656680e-01 8.686640e-01 4.343320e-01 [21,] 9.492414e-01 1.015172e-01 5.075862e-02 [22,] 9.990094e-01 1.981207e-03 9.906033e-04 [23,] 9.999158e-01 1.684649e-04 8.423245e-05 [24,] 9.999218e-01 1.563275e-04 7.816374e-05 [25,] 9.999096e-01 1.808142e-04 9.040708e-05 [26,] 9.997428e-01 5.143836e-04 2.571918e-04 [27,] 9.995406e-01 9.187748e-04 4.593874e-04 [28,] 9.998365e-01 3.270180e-04 1.635090e-04 [29,] 9.991289e-01 1.742130e-03 8.710648e-04 > postscript(file="/var/www/rcomp/tmp/1sy9y1290878886.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/rcomp/tmp/23pqj1290878886.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/rcomp/tmp/33pqj1290878886.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/rcomp/tmp/43pqj1290878886.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/rcomp/tmp/53pqj1290878886.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 = 60 Frequency = 1 1 2 3 4 5 6 7 8 9 10 -3.118 -2.412 -0.126 -0.220 -1.318 0.224 -2.464 -4.424 -3.168 -1.634 11 12 13 14 15 16 17 18 19 20 -4.922 -5.604 -4.629 -2.083 -4.747 -3.611 -4.129 -4.937 -6.315 -6.325 21 22 23 24 25 26 27 28 29 30 -4.819 -4.725 -1.043 1.815 10.310 11.686 10.772 11.998 15.400 14.782 31 32 33 34 35 36 37 38 39 40 21.564 23.204 23.000 15.654 13.736 9.004 2.049 -5.025 -6.869 -8.263 41 42 43 44 45 46 47 48 49 50 -11.901 -12.749 -14.407 -12.357 -12.961 -8.807 -9.515 -8.027 -4.612 -2.166 51 52 53 54 55 56 57 58 59 60 0.970 0.096 1.948 2.680 1.622 -0.098 -2.052 -0.488 1.744 2.812 > postscript(file="/var/www/rcomp/tmp/6vz741290878886.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -3.118 NA 1 -2.412 -3.118 2 -0.126 -2.412 3 -0.220 -0.126 4 -1.318 -0.220 5 0.224 -1.318 6 -2.464 0.224 7 -4.424 -2.464 8 -3.168 -4.424 9 -1.634 -3.168 10 -4.922 -1.634 11 -5.604 -4.922 12 -4.629 -5.604 13 -2.083 -4.629 14 -4.747 -2.083 15 -3.611 -4.747 16 -4.129 -3.611 17 -4.937 -4.129 18 -6.315 -4.937 19 -6.325 -6.315 20 -4.819 -6.325 21 -4.725 -4.819 22 -1.043 -4.725 23 1.815 -1.043 24 10.310 1.815 25 11.686 10.310 26 10.772 11.686 27 11.998 10.772 28 15.400 11.998 29 14.782 15.400 30 21.564 14.782 31 23.204 21.564 32 23.000 23.204 33 15.654 23.000 34 13.736 15.654 35 9.004 13.736 36 2.049 9.004 37 -5.025 2.049 38 -6.869 -5.025 39 -8.263 -6.869 40 -11.901 -8.263 41 -12.749 -11.901 42 -14.407 -12.749 43 -12.357 -14.407 44 -12.961 -12.357 45 -8.807 -12.961 46 -9.515 -8.807 47 -8.027 -9.515 48 -4.612 -8.027 49 -2.166 -4.612 50 0.970 -2.166 51 0.096 0.970 52 1.948 0.096 53 2.680 1.948 54 1.622 2.680 55 -0.098 1.622 56 -2.052 -0.098 57 -0.488 -2.052 58 1.744 -0.488 59 2.812 1.744 60 NA 2.812 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.412 -3.118 [2,] -0.126 -2.412 [3,] -0.220 -0.126 [4,] -1.318 -0.220 [5,] 0.224 -1.318 [6,] -2.464 0.224 [7,] -4.424 -2.464 [8,] -3.168 -4.424 [9,] -1.634 -3.168 [10,] -4.922 -1.634 [11,] -5.604 -4.922 [12,] -4.629 -5.604 [13,] -2.083 -4.629 [14,] -4.747 -2.083 [15,] -3.611 -4.747 [16,] -4.129 -3.611 [17,] -4.937 -4.129 [18,] -6.315 -4.937 [19,] -6.325 -6.315 [20,] -4.819 -6.325 [21,] -4.725 -4.819 [22,] -1.043 -4.725 [23,] 1.815 -1.043 [24,] 10.310 1.815 [25,] 11.686 10.310 [26,] 10.772 11.686 [27,] 11.998 10.772 [28,] 15.400 11.998 [29,] 14.782 15.400 [30,] 21.564 14.782 [31,] 23.204 21.564 [32,] 23.000 23.204 [33,] 15.654 23.000 [34,] 13.736 15.654 [35,] 9.004 13.736 [36,] 2.049 9.004 [37,] -5.025 2.049 [38,] -6.869 -5.025 [39,] -8.263 -6.869 [40,] -11.901 -8.263 [41,] -12.749 -11.901 [42,] -14.407 -12.749 [43,] -12.357 -14.407 [44,] -12.961 -12.357 [45,] -8.807 -12.961 [46,] -9.515 -8.807 [47,] -8.027 -9.515 [48,] -4.612 -8.027 [49,] -2.166 -4.612 [50,] 0.970 -2.166 [51,] 0.096 0.970 [52,] 1.948 0.096 [53,] 2.680 1.948 [54,] 1.622 2.680 [55,] -0.098 1.622 [56,] -2.052 -0.098 [57,] -0.488 -2.052 [58,] 1.744 -0.488 [59,] 2.812 1.744 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.412 -3.118 2 -0.126 -2.412 3 -0.220 -0.126 4 -1.318 -0.220 5 0.224 -1.318 6 -2.464 0.224 7 -4.424 -2.464 8 -3.168 -4.424 9 -1.634 -3.168 10 -4.922 -1.634 11 -5.604 -4.922 12 -4.629 -5.604 13 -2.083 -4.629 14 -4.747 -2.083 15 -3.611 -4.747 16 -4.129 -3.611 17 -4.937 -4.129 18 -6.315 -4.937 19 -6.325 -6.315 20 -4.819 -6.325 21 -4.725 -4.819 22 -1.043 -4.725 23 1.815 -1.043 24 10.310 1.815 25 11.686 10.310 26 10.772 11.686 27 11.998 10.772 28 15.400 11.998 29 14.782 15.400 30 21.564 14.782 31 23.204 21.564 32 23.000 23.204 33 15.654 23.000 34 13.736 15.654 35 9.004 13.736 36 2.049 9.004 37 -5.025 2.049 38 -6.869 -5.025 39 -8.263 -6.869 40 -11.901 -8.263 41 -12.749 -11.901 42 -14.407 -12.749 43 -12.357 -14.407 44 -12.961 -12.357 45 -8.807 -12.961 46 -9.515 -8.807 47 -8.027 -9.515 48 -4.612 -8.027 49 -2.166 -4.612 50 0.970 -2.166 51 0.096 0.970 52 1.948 0.096 53 2.680 1.948 54 1.622 2.680 55 -0.098 1.622 56 -2.052 -0.098 57 -0.488 -2.052 58 1.744 -0.488 59 2.812 1.744 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/7oq7p1290878886.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/rcomp/tmp/8oq7p1290878886.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/rcomp/tmp/9oq7p1290878886.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/rcomp/tmp/10zhos1290878886.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/11khmy1290878886.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/1250341290878886.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/13jaiv1290878886.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/14nsz11290878886.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15qtg61290878886.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/16utwc1290878886.tab") + } > > try(system("convert tmp/1sy9y1290878886.ps tmp/1sy9y1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/23pqj1290878886.ps tmp/23pqj1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/33pqj1290878886.ps tmp/33pqj1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/43pqj1290878886.ps tmp/43pqj1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/53pqj1290878886.ps tmp/53pqj1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/6vz741290878886.ps tmp/6vz741290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/7oq7p1290878886.ps tmp/7oq7p1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/8oq7p1290878886.ps tmp/8oq7p1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/9oq7p1290878886.ps tmp/9oq7p1290878886.png",intern=TRUE)) character(0) > try(system("convert tmp/10zhos1290878886.ps tmp/10zhos1290878886.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.700 1.770 5.509