R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. Natural language support but running in an English locale 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(7 + ,7 + ,1 + ,7 + ,7 + ,1 + ,7 + ,7 + ,5 + ,6 + ,1 + ,5 + ,5 + ,1 + ,5 + ,5 + ,6 + ,6 + ,2 + ,5 + ,6 + ,1 + ,4 + ,5 + ,4 + ,5 + ,2 + ,5 + ,6 + ,2 + ,5 + ,6 + ,5 + ,6 + ,2 + ,5 + ,6 + ,2 + ,5 + ,6 + ,6 + ,7 + ,1 + ,7 + ,5 + ,1 + ,6 + ,7 + ,7 + ,7 + ,1 + ,7 + ,7 + ,1 + ,7 + ,6 + ,6 + ,7 + ,1 + ,5 + ,6 + ,1 + ,5 + ,7 + ,6 + ,7 + ,1 + ,3 + ,7 + ,2 + ,7 + ,7 + ,6 + ,6 + ,1 + ,6 + ,6 + ,1 + ,5 + ,6 + ,5 + ,4 + ,1 + ,7 + ,7 + ,1 + ,4 + ,7 + ,5 + ,6 + ,1 + ,6 + ,7 + ,1 + ,6 + ,7 + ,4 + ,6 + ,1 + ,5 + ,6 + ,1 + ,4 + ,5 + ,6 + ,7 + ,1 + ,3 + ,6 + ,1 + ,6 + ,6 + ,6 + ,6 + ,1 + ,7 + ,7 + ,1 + ,7 + ,7 + ,5 + ,6 + ,2 + ,5 + ,6 + ,3 + ,6 + ,6 + ,3 + ,4 + ,1 + ,7 + ,7 + ,1 + ,4 + ,7 + ,7 + ,7 + ,1 + ,7 + ,7 + ,1 + ,6 + ,7 + ,3 + ,7 + ,1 + ,7 + ,7 + ,1 + ,6 + ,7 + ,5 + ,6 + ,2 + ,6 + ,7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 + ,2 + ,7 + ,5 + ,6 + ,6 + ,1 + ,6 + ,5 + ,1 + ,5 + ,6 + ,5 + ,5 + ,2 + ,6 + ,4 + ,3 + ,5 + ,5 + ,5 + ,6 + ,1 + ,5 + ,7 + ,2 + ,5 + ,7 + ,5 + ,7 + ,1 + ,6 + ,7 + ,2 + ,6 + ,7 + ,7 + ,6 + ,1 + ,7 + ,5 + ,1 + ,7 + ,5 + ,6 + ,7 + ,1 + ,7 + ,7 + ,1 + ,7 + ,7 + ,6 + ,7 + ,1 + ,6 + ,6 + ,1 + ,6 + ,6 + ,5 + ,6 + ,2 + ,6 + ,5 + ,1 + ,5 + ,6 + ,2 + ,6 + ,2 + ,6 + ,6 + ,2 + ,6 + ,6 + ,4 + ,4 + ,4 + ,7 + ,7 + ,4 + ,4 + ,7 + ,6 + ,7 + ,1 + ,6 + ,7 + ,3 + ,6 + ,6 + ,5 + ,6 + ,1 + ,5 + ,6 + ,1 + ,6 + ,5 + ,5 + ,4 + ,1 + ,5 + ,5 + ,1 + ,4 + ,5 + ,5 + ,5 + ,1 + ,5 + ,6 + ,1 + ,5 + ,5 + ,4 + ,6 + ,1 + ,4 + ,5 + ,1 + ,5 + ,7 + ,4 + ,5 + ,5 + ,4 + ,6 + ,4 + ,5 + ,7) + ,dim=c(8 + ,164) + ,dimnames=list(c('Q1_2' + ,'Q1_3' + ,'Q1_5' + ,'Q1_7' + ,'Q1_8' + ,'Q1_12' + ,'Q1_16' + ,'Q1_22') + ,1:164)) > y <- array(NA,dim=c(8,164),dimnames=list(c('Q1_2','Q1_3','Q1_5','Q1_7','Q1_8','Q1_12','Q1_16','Q1_22'),1:164)) > 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 = '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 Q1_2 Q1_3 Q1_5 Q1_7 Q1_8 Q1_12 Q1_16 Q1_22 1 7 7 1 7 7 1 7 7 2 5 6 1 5 5 1 5 5 3 6 6 2 5 6 1 4 5 4 4 5 2 5 6 2 5 6 5 5 6 2 5 6 2 5 6 6 6 7 1 7 5 1 6 7 7 7 7 1 7 7 1 7 6 8 6 7 1 5 6 1 5 7 9 6 7 1 3 7 2 7 7 10 6 6 1 6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 4 4 4 3 3 3 5 125 7 7 1 7 7 1 7 7 126 5 7 2 6 6 1 6 7 127 7 5 1 7 7 1 6 6 128 5 7 1 2 6 2 4 6 129 4 3 1 5 5 1 4 6 130 6 6 1 6 6 1 6 6 131 4 5 3 6 6 2 4 6 132 4 5 2 6 7 2 6 6 133 4 6 1 2 6 7 2 5 134 4 5 1 6 7 1 5 6 135 6 6 1 7 6 2 5 7 136 6 6 2 4 6 3 6 6 137 5 7 5 7 7 3 5 7 138 3 5 1 7 7 4 4 7 139 6 7 1 6 7 1 6 6 140 5 6 2 6 7 2 6 6 141 4 6 1 2 6 2 5 7 142 5 7 2 7 7 2 5 5 143 2 7 1 7 7 2 2 5 144 5 5 1 5 6 1 6 6 145 7 7 1 5 7 5 6 7 146 4 5 1 6 6 1 5 5 147 4 6 2 5 7 3 6 7 148 7 7 1 6 6 2 7 5 149 6 6 1 6 5 1 5 6 150 5 5 2 6 4 3 5 5 151 5 6 1 5 7 2 5 7 152 5 7 1 6 7 2 6 7 153 7 6 1 7 5 1 7 5 154 6 7 1 7 7 1 7 7 155 6 7 1 6 6 1 6 6 156 5 6 2 6 5 1 5 6 157 2 6 2 6 6 2 6 6 158 4 4 4 7 7 4 4 7 159 6 7 1 6 7 3 6 6 160 5 6 1 5 6 1 6 5 161 5 4 1 5 5 1 4 5 162 5 5 1 5 6 1 5 5 163 4 6 1 4 5 1 5 7 164 4 5 5 4 6 4 5 7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Q1_3 Q1_5 Q1_7 Q1_8 Q1_12 1.4095903 0.2140527 -0.2213095 0.1393213 -0.1700633 0.0973404 Q1_16 Q1_22 0.5330604 0.0002881 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.12673 -0.41867 0.06596 0.58122 2.54536 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.4095903 0.7439982 1.895 0.06002 . Q1_3 0.2140527 0.0801167 2.672 0.00836 ** Q1_5 -0.2213095 0.1164168 -1.901 0.05917 . Q1_7 0.1393213 0.0734517 1.897 0.05973 . Q1_8 -0.1700633 0.1142606 -1.488 0.13870 Q1_12 0.0973404 0.0979464 0.994 0.32187 Q1_16 0.5330604 0.0861509 6.188 5.28e-09 *** Q1_22 0.0002881 0.0998063 0.003 0.99770 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.9876 on 154 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.3477, Adjusted R-squared: 0.3181 F-statistic: 11.73 on 7 and 154 DF, p-value: 6.461e-12 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.03964788 0.07929576 0.960352122 [2,] 0.09629101 0.19258202 0.903708989 [3,] 0.31146578 0.62293157 0.688534215 [4,] 0.20061532 0.40123063 0.799384685 [5,] 0.13202710 0.26405419 0.867972905 [6,] 0.08967750 0.17935499 0.910322504 [7,] 0.12080028 0.24160057 0.879199717 [8,] 0.08135412 0.16270824 0.918645882 [9,] 0.82715555 0.34568890 0.172844452 [10,] 0.77610147 0.44779705 0.223898525 [11,] 0.73046902 0.53906196 0.269530980 [12,] 0.72072208 0.55855584 0.279277919 [13,] 0.65173357 0.69653286 0.348266430 [14,] 0.63872561 0.72254878 0.361274390 [15,] 0.59586414 0.80827171 0.404135857 [16,] 0.54058550 0.91882900 0.459414501 [17,] 0.47087683 0.94175367 0.529123166 [18,] 0.40713143 0.81426287 0.592868567 [19,] 0.60308850 0.79382299 0.396911497 [20,] 0.53974507 0.92050985 0.460254926 [21,] 0.50423077 0.99153847 0.495769233 [22,] 0.51230678 0.97538643 0.487693216 [23,] 0.46502189 0.93004378 0.534978108 [24,] 0.43896541 0.87793082 0.561034590 [25,] 0.40531789 0.81063579 0.594682106 [26,] 0.34937710 0.69875420 0.650622902 [27,] 0.33379180 0.66758360 0.666208198 [28,] 0.29360968 0.58721937 0.706390316 [29,] 0.25875266 0.51750531 0.741247345 [30,] 0.21423093 0.42846186 0.785769070 [31,] 0.17542976 0.35085953 0.824570237 [32,] 0.14175767 0.28351535 0.858242325 [33,] 0.11244343 0.22488686 0.887556569 [34,] 0.23269191 0.46538381 0.767308093 [35,] 0.25147083 0.50294166 0.748529169 [36,] 0.30938367 0.61876734 0.690616329 [37,] 0.26751046 0.53502092 0.732489538 [38,] 0.26488682 0.52977363 0.735113183 [39,] 0.54273880 0.91452241 0.457261203 [40,] 0.50196740 0.99606521 0.498032603 [41,] 0.56334031 0.87331938 0.436659688 [42,] 0.55745909 0.88508181 0.442540907 [43,] 0.64926206 0.70147587 0.350737937 [44,] 0.60544164 0.78911671 0.394558357 [45,] 0.61421719 0.77156562 0.385782808 [46,] 0.56612414 0.86775171 0.433875857 [47,] 0.51858087 0.96283827 0.481419133 [48,] 0.96918396 0.06163208 0.030816041 [49,] 0.96159454 0.07681092 0.038405462 [50,] 0.99303555 0.01392890 0.006964451 [51,] 0.99093524 0.01812951 0.009064757 [52,] 0.98767285 0.02465431 0.012327155 [53,] 0.98987385 0.02025230 0.010126152 [54,] 0.98685980 0.02628040 0.013140199 [55,] 0.98403875 0.03192251 0.015961254 [56,] 0.97932380 0.04135240 0.020676198 [57,] 0.97345524 0.05308953 0.026544764 [58,] 0.96548133 0.06903734 0.034518669 [59,] 0.98036650 0.03926700 0.019633498 [60,] 0.97406839 0.05186323 0.025931614 [61,] 0.96883665 0.06232669 0.031163345 [62,] 0.96335926 0.07328148 0.036640742 [63,] 0.95369670 0.09260660 0.046303298 [64,] 0.94165129 0.11669742 0.058348710 [65,] 0.92843266 0.14313469 0.071567344 [66,] 0.91103263 0.17793474 0.088967370 [67,] 0.90216301 0.19567397 0.097836987 [68,] 0.91242474 0.17515052 0.087575258 [69,] 0.90205904 0.19588192 0.097940959 [70,] 0.92761997 0.14476006 0.072380032 [71,] 0.92628141 0.14743719 0.073718594 [72,] 0.91589443 0.16821115 0.084105573 [73,] 0.91380853 0.17238293 0.086191466 [74,] 0.96458745 0.07082510 0.035412550 [75,] 0.97508351 0.04983297 0.024916487 [76,] 0.96889872 0.06220255 0.031101276 [77,] 0.95960358 0.08079283 0.040396415 [78,] 0.95713003 0.08573993 0.042869967 [79,] 0.94516117 0.10967766 0.054838828 [80,] 0.94548793 0.10902414 0.054512072 [81,] 0.95195545 0.09608911 0.048044554 [82,] 0.93943141 0.12113717 0.060568587 [83,] 0.92793598 0.14412804 0.072064019 [84,] 0.91522816 0.16954369 0.084771844 [85,] 0.89549075 0.20901849 0.104509247 [86,] 0.87646465 0.24707070 0.123535351 [87,] 0.85044111 0.29911778 0.149558890 [88,] 0.86901574 0.26196851 0.130984255 [89,] 0.84148856 0.31702288 0.158511438 [90,] 0.86187557 0.27624887 0.138124434 [91,] 0.83337543 0.33324914 0.166624572 [92,] 0.82909233 0.34181533 0.170907666 [93,] 0.80586272 0.38827455 0.194137276 [94,] 0.77004085 0.45991831 0.229959154 [95,] 0.78270947 0.43458105 0.217290527 [96,] 0.77604370 0.44791260 0.223956301 [97,] 0.80609018 0.38781965 0.193909823 [98,] 0.78758440 0.42483120 0.212415601 [99,] 0.75697817 0.48604365 0.243021825 [100,] 0.77204717 0.45590565 0.227952827 [101,] 0.74008215 0.51983569 0.259917846 [102,] 0.70225409 0.59549182 0.297745912 [103,] 0.66210487 0.67579025 0.337895126 [104,] 0.62177749 0.75644501 0.378222507 [105,] 0.57471247 0.85057505 0.425287527 [106,] 0.68098070 0.63803861 0.319019304 [107,] 0.63465092 0.73069817 0.365349084 [108,] 0.61576373 0.76847254 0.384236270 [109,] 0.57821640 0.84356720 0.421783600 [110,] 0.54889762 0.90220475 0.451102375 [111,] 0.49789847 0.99579694 0.502101532 [112,] 0.53959678 0.92080643 0.460403216 [113,] 0.52392675 0.95214651 0.476073253 [114,] 0.47670476 0.95340952 0.523295238 [115,] 0.65181574 0.69636851 0.348184256 [116,] 0.62695161 0.74609677 0.373048387 [117,] 0.57847379 0.84305241 0.421526206 [118,] 0.53927976 0.92144048 0.460720242 [119,] 0.48555669 0.97111338 0.514443310 [120,] 0.46321872 0.92643745 0.536781276 [121,] 0.40943900 0.81887799 0.590561004 [122,] 0.35370844 0.70741688 0.646291559 [123,] 0.36057051 0.72114102 0.639429490 [124,] 0.31857856 0.63715712 0.681421441 [125,] 0.29825870 0.59651740 0.701741300 [126,] 0.35782482 0.71564964 0.642175182 [127,] 0.34480270 0.68960540 0.655197298 [128,] 0.28140209 0.56280418 0.718597910 [129,] 0.22546594 0.45093188 0.774534058 [130,] 0.19987267 0.39974533 0.800127335 [131,] 0.23311754 0.46623508 0.766882461 [132,] 0.18394030 0.36788060 0.816059698 [133,] 0.17214915 0.34429831 0.827850846 [134,] 0.17870747 0.35741494 0.821292532 [135,] 0.13789332 0.27578663 0.862106684 [136,] 0.11984087 0.23968175 0.880159127 [137,] 0.09220403 0.18440805 0.907795975 [138,] 0.05626606 0.11253211 0.943733944 [139,] 0.03358637 0.06717275 0.966413625 [140,] 0.01683668 0.03367336 0.983163322 [141,] 0.12047480 0.24094961 0.879525196 [142,] 0.55855132 0.88289737 0.441448684 [143,] 0.43364263 0.86728525 0.566357374 > postscript(file="/var/www/html/freestat/rcomp/tmp/1w4hg1290538063.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) Warning message: In x[, 1] - mysum$resid : longer object length is not a multiple of shorter object length > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2ovyj1290538063.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/freestat/rcomp/tmp/3ovyj1290538063.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/freestat/rcomp/tmp/4ovyj1290538063.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/freestat/rcomp/tmp/5hmfm1290538063.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 = 162 Frequency = 1 1 2 3 4 5 6 0.697764315 -0.082969990 1.841463302 -0.575172905 0.210774368 -0.109301909 7 8 9 10 11 12 0.698052405 0.872464438 0.157709056 0.947483969 0.939103823 -0.415801230 13 14 15 16 17 18 -0.379846214 0.618334656 -0.088182958 -0.419626476 -1.060896177 1.230824758 19 20 21 23 24 25 -2.769175242 -0.291544026 -0.907463278 -1.130702739 0.060761424 -2.119402474 26 27 28 29 30 31 0.489443056 0.489443056 0.365159735 0.022215410 2.086805254 0.275102240 32 33 34 35 36 37 -0.402265796 0.183387694 -0.288723974 -1.188501159 1.071741172 -0.022062073 38 39 40 41 42 43 0.043103951 0.697764315 -0.405890043 -0.096793514 0.265479143 -0.067868203 44 45 46 47 48 49 -0.355010514 1.886518372 1.385512197 0.876187397 0.120921166 1.210774368 50 51 52 53 54 55 -2.004401715 -0.255877099 -1.123335135 1.199247443 -1.644665261 0.370434133 56 57 58 59 60 61 0.819401519 0.087093344 0.231112847 -4.126728973 0.308345180 2.545364666 62 63 64 65 66 67 -0.181791547 0.022503499 1.236844315 -0.348065538 0.594109957 0.317083124 68 69 70 71 72 73 -0.276479945 0.117547302 -1.840759903 0.042527772 0.584198770 -0.682916876 74 75 76 77 78 79 0.049967479 0.133484357 -0.351208992 0.002165020 0.666832889 1.230824758 80 81 82 83 84 85 -0.665784212 -1.471434750 0.947772058 0.628476252 -0.938950486 -2.098610251 86 87 88 89 90 91 1.489154967 0.347537083 0.132814744 -0.866611470 0.071164993 -0.832155658 92 93 94 95 96 97 1.235025185 0.175753330 0.370434133 -0.512198800 -0.236114799 0.414711615 98 99 100 101 102 103 0.213070967 1.310481078 0.087320428 -1.371811837 -0.126671293 0.891766652 104 105 106 107 108 109 -0.585576474 -0.008238549 -0.981609836 -0.744948149 1.234259627 -0.884271828 110 111 112 113 114 115 0.414423526 -1.302235685 0.347537083 -0.038980597 -0.212175796 0.230824758 116 117 118 119 120 122 -0.029056890 1.382080653 -0.198247250 0.969152491 -0.879951807 -0.714494191 123 124 125 126 127 128 0.308402859 1.679698711 0.697764315 -0.578607775 1.659218300 0.726436425 129 130 131 132 133 134 0.091960543 0.414423526 0.039875768 -1.077491300 0.520196120 -0.668399971 135 136 137 138 139 140 0.710534192 0.719694810 0.454442460 -1.566970108 0.370434133 -0.291544026 141 142 143 144 145 146 -0.592859380 -0.111569506 -1.733697693 -0.232202462 1.120105723 -0.838175215 147 148 149 150 151 152 -1.249851232 0.570258045 0.777420635 -0.151673170 0.159240097 -0.727194358 153 154 155 156 157 158 0.572266554 -0.302235685 0.200370799 -0.001269849 -3.461607360 0.311011166 159 160 161 162 163 164 0.175753330 -0.445967099 0.878195906 0.301146070 -0.944224884 0.033108035 > postscript(file="/var/www/html/freestat/rcomp/tmp/6hmfm1290538063.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 = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 0.697764315 NA 1 -0.082969990 0.697764315 2 1.841463302 -0.082969990 3 -0.575172905 1.841463302 4 0.210774368 -0.575172905 5 -0.109301909 0.210774368 6 0.698052405 -0.109301909 7 0.872464438 0.698052405 8 0.157709056 0.872464438 9 0.947483969 0.157709056 10 0.939103823 0.947483969 11 -0.415801230 0.939103823 12 -0.379846214 -0.415801230 13 0.618334656 -0.379846214 14 -0.088182958 0.618334656 15 -0.419626476 -0.088182958 16 -1.060896177 -0.419626476 17 1.230824758 -1.060896177 18 -2.769175242 1.230824758 19 -0.291544026 -2.769175242 20 -0.907463278 -0.291544026 21 -1.130702739 -0.907463278 22 0.060761424 -1.130702739 23 -2.119402474 0.060761424 24 0.489443056 -2.119402474 25 0.489443056 0.489443056 26 0.365159735 0.489443056 27 0.022215410 0.365159735 28 2.086805254 0.022215410 29 0.275102240 2.086805254 30 -0.402265796 0.275102240 31 0.183387694 -0.402265796 32 -0.288723974 0.183387694 33 -1.188501159 -0.288723974 34 1.071741172 -1.188501159 35 -0.022062073 1.071741172 36 0.043103951 -0.022062073 37 0.697764315 0.043103951 38 -0.405890043 0.697764315 39 -0.096793514 -0.405890043 40 0.265479143 -0.096793514 41 -0.067868203 0.265479143 42 -0.355010514 -0.067868203 43 1.886518372 -0.355010514 44 1.385512197 1.886518372 45 0.876187397 1.385512197 46 0.120921166 0.876187397 47 1.210774368 0.120921166 48 -2.004401715 1.210774368 49 -0.255877099 -2.004401715 50 -1.123335135 -0.255877099 51 1.199247443 -1.123335135 52 -1.644665261 1.199247443 53 0.370434133 -1.644665261 54 0.819401519 0.370434133 55 0.087093344 0.819401519 56 0.231112847 0.087093344 57 -4.126728973 0.231112847 58 0.308345180 -4.126728973 59 2.545364666 0.308345180 60 -0.181791547 2.545364666 61 0.022503499 -0.181791547 62 1.236844315 0.022503499 63 -0.348065538 1.236844315 64 0.594109957 -0.348065538 65 0.317083124 0.594109957 66 -0.276479945 0.317083124 67 0.117547302 -0.276479945 68 -1.840759903 0.117547302 69 0.042527772 -1.840759903 70 0.584198770 0.042527772 71 -0.682916876 0.584198770 72 0.049967479 -0.682916876 73 0.133484357 0.049967479 74 -0.351208992 0.133484357 75 0.002165020 -0.351208992 76 0.666832889 0.002165020 77 1.230824758 0.666832889 78 -0.665784212 1.230824758 79 -1.471434750 -0.665784212 80 0.947772058 -1.471434750 81 0.628476252 0.947772058 82 -0.938950486 0.628476252 83 -2.098610251 -0.938950486 84 1.489154967 -2.098610251 85 0.347537083 1.489154967 86 0.132814744 0.347537083 87 -0.866611470 0.132814744 88 0.071164993 -0.866611470 89 -0.832155658 0.071164993 90 1.235025185 -0.832155658 91 0.175753330 1.235025185 92 0.370434133 0.175753330 93 -0.512198800 0.370434133 94 -0.236114799 -0.512198800 95 0.414711615 -0.236114799 96 0.213070967 0.414711615 97 1.310481078 0.213070967 98 0.087320428 1.310481078 99 -1.371811837 0.087320428 100 -0.126671293 -1.371811837 101 0.891766652 -0.126671293 102 -0.585576474 0.891766652 103 -0.008238549 -0.585576474 104 -0.981609836 -0.008238549 105 -0.744948149 -0.981609836 106 1.234259627 -0.744948149 107 -0.884271828 1.234259627 108 0.414423526 -0.884271828 109 -1.302235685 0.414423526 110 0.347537083 -1.302235685 111 -0.038980597 0.347537083 112 -0.212175796 -0.038980597 113 0.230824758 -0.212175796 114 -0.029056890 0.230824758 115 1.382080653 -0.029056890 116 -0.198247250 1.382080653 117 0.969152491 -0.198247250 118 -0.879951807 0.969152491 119 -0.714494191 -0.879951807 120 0.308402859 -0.714494191 121 1.679698711 0.308402859 122 0.697764315 1.679698711 123 -0.578607775 0.697764315 124 1.659218300 -0.578607775 125 0.726436425 1.659218300 126 0.091960543 0.726436425 127 0.414423526 0.091960543 128 0.039875768 0.414423526 129 -1.077491300 0.039875768 130 0.520196120 -1.077491300 131 -0.668399971 0.520196120 132 0.710534192 -0.668399971 133 0.719694810 0.710534192 134 0.454442460 0.719694810 135 -1.566970108 0.454442460 136 0.370434133 -1.566970108 137 -0.291544026 0.370434133 138 -0.592859380 -0.291544026 139 -0.111569506 -0.592859380 140 -1.733697693 -0.111569506 141 -0.232202462 -1.733697693 142 1.120105723 -0.232202462 143 -0.838175215 1.120105723 144 -1.249851232 -0.838175215 145 0.570258045 -1.249851232 146 0.777420635 0.570258045 147 -0.151673170 0.777420635 148 0.159240097 -0.151673170 149 -0.727194358 0.159240097 150 0.572266554 -0.727194358 151 -0.302235685 0.572266554 152 0.200370799 -0.302235685 153 -0.001269849 0.200370799 154 -3.461607360 -0.001269849 155 0.311011166 -3.461607360 156 0.175753330 0.311011166 157 -0.445967099 0.175753330 158 0.878195906 -0.445967099 159 0.301146070 0.878195906 160 -0.944224884 0.301146070 161 0.033108035 -0.944224884 162 NA 0.033108035 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.082969990 0.697764315 [2,] 1.841463302 -0.082969990 [3,] -0.575172905 1.841463302 [4,] 0.210774368 -0.575172905 [5,] -0.109301909 0.210774368 [6,] 0.698052405 -0.109301909 [7,] 0.872464438 0.698052405 [8,] 0.157709056 0.872464438 [9,] 0.947483969 0.157709056 [10,] 0.939103823 0.947483969 [11,] -0.415801230 0.939103823 [12,] -0.379846214 -0.415801230 [13,] 0.618334656 -0.379846214 [14,] -0.088182958 0.618334656 [15,] -0.419626476 -0.088182958 [16,] -1.060896177 -0.419626476 [17,] 1.230824758 -1.060896177 [18,] -2.769175242 1.230824758 [19,] -0.291544026 -2.769175242 [20,] -0.907463278 -0.291544026 [21,] -1.130702739 -0.907463278 [22,] 0.060761424 -1.130702739 [23,] -2.119402474 0.060761424 [24,] 0.489443056 -2.119402474 [25,] 0.489443056 0.489443056 [26,] 0.365159735 0.489443056 [27,] 0.022215410 0.365159735 [28,] 2.086805254 0.022215410 [29,] 0.275102240 2.086805254 [30,] -0.402265796 0.275102240 [31,] 0.183387694 -0.402265796 [32,] -0.288723974 0.183387694 [33,] -1.188501159 -0.288723974 [34,] 1.071741172 -1.188501159 [35,] -0.022062073 1.071741172 [36,] 0.043103951 -0.022062073 [37,] 0.697764315 0.043103951 [38,] -0.405890043 0.697764315 [39,] -0.096793514 -0.405890043 [40,] 0.265479143 -0.096793514 [41,] -0.067868203 0.265479143 [42,] -0.355010514 -0.067868203 [43,] 1.886518372 -0.355010514 [44,] 1.385512197 1.886518372 [45,] 0.876187397 1.385512197 [46,] 0.120921166 0.876187397 [47,] 1.210774368 0.120921166 [48,] -2.004401715 1.210774368 [49,] -0.255877099 -2.004401715 [50,] -1.123335135 -0.255877099 [51,] 1.199247443 -1.123335135 [52,] -1.644665261 1.199247443 [53,] 0.370434133 -1.644665261 [54,] 0.819401519 0.370434133 [55,] 0.087093344 0.819401519 [56,] 0.231112847 0.087093344 [57,] -4.126728973 0.231112847 [58,] 0.308345180 -4.126728973 [59,] 2.545364666 0.308345180 [60,] -0.181791547 2.545364666 [61,] 0.022503499 -0.181791547 [62,] 1.236844315 0.022503499 [63,] -0.348065538 1.236844315 [64,] 0.594109957 -0.348065538 [65,] 0.317083124 0.594109957 [66,] -0.276479945 0.317083124 [67,] 0.117547302 -0.276479945 [68,] -1.840759903 0.117547302 [69,] 0.042527772 -1.840759903 [70,] 0.584198770 0.042527772 [71,] -0.682916876 0.584198770 [72,] 0.049967479 -0.682916876 [73,] 0.133484357 0.049967479 [74,] -0.351208992 0.133484357 [75,] 0.002165020 -0.351208992 [76,] 0.666832889 0.002165020 [77,] 1.230824758 0.666832889 [78,] -0.665784212 1.230824758 [79,] -1.471434750 -0.665784212 [80,] 0.947772058 -1.471434750 [81,] 0.628476252 0.947772058 [82,] -0.938950486 0.628476252 [83,] -2.098610251 -0.938950486 [84,] 1.489154967 -2.098610251 [85,] 0.347537083 1.489154967 [86,] 0.132814744 0.347537083 [87,] -0.866611470 0.132814744 [88,] 0.071164993 -0.866611470 [89,] -0.832155658 0.071164993 [90,] 1.235025185 -0.832155658 [91,] 0.175753330 1.235025185 [92,] 0.370434133 0.175753330 [93,] -0.512198800 0.370434133 [94,] -0.236114799 -0.512198800 [95,] 0.414711615 -0.236114799 [96,] 0.213070967 0.414711615 [97,] 1.310481078 0.213070967 [98,] 0.087320428 1.310481078 [99,] -1.371811837 0.087320428 [100,] -0.126671293 -1.371811837 [101,] 0.891766652 -0.126671293 [102,] -0.585576474 0.891766652 [103,] -0.008238549 -0.585576474 [104,] -0.981609836 -0.008238549 [105,] -0.744948149 -0.981609836 [106,] 1.234259627 -0.744948149 [107,] -0.884271828 1.234259627 [108,] 0.414423526 -0.884271828 [109,] -1.302235685 0.414423526 [110,] 0.347537083 -1.302235685 [111,] -0.038980597 0.347537083 [112,] -0.212175796 -0.038980597 [113,] 0.230824758 -0.212175796 [114,] -0.029056890 0.230824758 [115,] 1.382080653 -0.029056890 [116,] -0.198247250 1.382080653 [117,] 0.969152491 -0.198247250 [118,] -0.879951807 0.969152491 [119,] -0.714494191 -0.879951807 [120,] 0.308402859 -0.714494191 [121,] 1.679698711 0.308402859 [122,] 0.697764315 1.679698711 [123,] -0.578607775 0.697764315 [124,] 1.659218300 -0.578607775 [125,] 0.726436425 1.659218300 [126,] 0.091960543 0.726436425 [127,] 0.414423526 0.091960543 [128,] 0.039875768 0.414423526 [129,] -1.077491300 0.039875768 [130,] 0.520196120 -1.077491300 [131,] -0.668399971 0.520196120 [132,] 0.710534192 -0.668399971 [133,] 0.719694810 0.710534192 [134,] 0.454442460 0.719694810 [135,] -1.566970108 0.454442460 [136,] 0.370434133 -1.566970108 [137,] -0.291544026 0.370434133 [138,] -0.592859380 -0.291544026 [139,] -0.111569506 -0.592859380 [140,] -1.733697693 -0.111569506 [141,] -0.232202462 -1.733697693 [142,] 1.120105723 -0.232202462 [143,] -0.838175215 1.120105723 [144,] -1.249851232 -0.838175215 [145,] 0.570258045 -1.249851232 [146,] 0.777420635 0.570258045 [147,] -0.151673170 0.777420635 [148,] 0.159240097 -0.151673170 [149,] -0.727194358 0.159240097 [150,] 0.572266554 -0.727194358 [151,] -0.302235685 0.572266554 [152,] 0.200370799 -0.302235685 [153,] -0.001269849 0.200370799 [154,] -3.461607360 -0.001269849 [155,] 0.311011166 -3.461607360 [156,] 0.175753330 0.311011166 [157,] -0.445967099 0.175753330 [158,] 0.878195906 -0.445967099 [159,] 0.301146070 0.878195906 [160,] -0.944224884 0.301146070 [161,] 0.033108035 -0.944224884 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.082969990 0.697764315 2 1.841463302 -0.082969990 3 -0.575172905 1.841463302 4 0.210774368 -0.575172905 5 -0.109301909 0.210774368 6 0.698052405 -0.109301909 7 0.872464438 0.698052405 8 0.157709056 0.872464438 9 0.947483969 0.157709056 10 0.939103823 0.947483969 11 -0.415801230 0.939103823 12 -0.379846214 -0.415801230 13 0.618334656 -0.379846214 14 -0.088182958 0.618334656 15 -0.419626476 -0.088182958 16 -1.060896177 -0.419626476 17 1.230824758 -1.060896177 18 -2.769175242 1.230824758 19 -0.291544026 -2.769175242 20 -0.907463278 -0.291544026 21 -1.130702739 -0.907463278 22 0.060761424 -1.130702739 23 -2.119402474 0.060761424 24 0.489443056 -2.119402474 25 0.489443056 0.489443056 26 0.365159735 0.489443056 27 0.022215410 0.365159735 28 2.086805254 0.022215410 29 0.275102240 2.086805254 30 -0.402265796 0.275102240 31 0.183387694 -0.402265796 32 -0.288723974 0.183387694 33 -1.188501159 -0.288723974 34 1.071741172 -1.188501159 35 -0.022062073 1.071741172 36 0.043103951 -0.022062073 37 0.697764315 0.043103951 38 -0.405890043 0.697764315 39 -0.096793514 -0.405890043 40 0.265479143 -0.096793514 41 -0.067868203 0.265479143 42 -0.355010514 -0.067868203 43 1.886518372 -0.355010514 44 1.385512197 1.886518372 45 0.876187397 1.385512197 46 0.120921166 0.876187397 47 1.210774368 0.120921166 48 -2.004401715 1.210774368 49 -0.255877099 -2.004401715 50 -1.123335135 -0.255877099 51 1.199247443 -1.123335135 52 -1.644665261 1.199247443 53 0.370434133 -1.644665261 54 0.819401519 0.370434133 55 0.087093344 0.819401519 56 0.231112847 0.087093344 57 -4.126728973 0.231112847 58 0.308345180 -4.126728973 59 2.545364666 0.308345180 60 -0.181791547 2.545364666 61 0.022503499 -0.181791547 62 1.236844315 0.022503499 63 -0.348065538 1.236844315 64 0.594109957 -0.348065538 65 0.317083124 0.594109957 66 -0.276479945 0.317083124 67 0.117547302 -0.276479945 68 -1.840759903 0.117547302 69 0.042527772 -1.840759903 70 0.584198770 0.042527772 71 -0.682916876 0.584198770 72 0.049967479 -0.682916876 73 0.133484357 0.049967479 74 -0.351208992 0.133484357 75 0.002165020 -0.351208992 76 0.666832889 0.002165020 77 1.230824758 0.666832889 78 -0.665784212 1.230824758 79 -1.471434750 -0.665784212 80 0.947772058 -1.471434750 81 0.628476252 0.947772058 82 -0.938950486 0.628476252 83 -2.098610251 -0.938950486 84 1.489154967 -2.098610251 85 0.347537083 1.489154967 86 0.132814744 0.347537083 87 -0.866611470 0.132814744 88 0.071164993 -0.866611470 89 -0.832155658 0.071164993 90 1.235025185 -0.832155658 91 0.175753330 1.235025185 92 0.370434133 0.175753330 93 -0.512198800 0.370434133 94 -0.236114799 -0.512198800 95 0.414711615 -0.236114799 96 0.213070967 0.414711615 97 1.310481078 0.213070967 98 0.087320428 1.310481078 99 -1.371811837 0.087320428 100 -0.126671293 -1.371811837 101 0.891766652 -0.126671293 102 -0.585576474 0.891766652 103 -0.008238549 -0.585576474 104 -0.981609836 -0.008238549 105 -0.744948149 -0.981609836 106 1.234259627 -0.744948149 107 -0.884271828 1.234259627 108 0.414423526 -0.884271828 109 -1.302235685 0.414423526 110 0.347537083 -1.302235685 111 -0.038980597 0.347537083 112 -0.212175796 -0.038980597 113 0.230824758 -0.212175796 114 -0.029056890 0.230824758 115 1.382080653 -0.029056890 116 -0.198247250 1.382080653 117 0.969152491 -0.198247250 118 -0.879951807 0.969152491 119 -0.714494191 -0.879951807 120 0.308402859 -0.714494191 121 1.679698711 0.308402859 122 0.697764315 1.679698711 123 -0.578607775 0.697764315 124 1.659218300 -0.578607775 125 0.726436425 1.659218300 126 0.091960543 0.726436425 127 0.414423526 0.091960543 128 0.039875768 0.414423526 129 -1.077491300 0.039875768 130 0.520196120 -1.077491300 131 -0.668399971 0.520196120 132 0.710534192 -0.668399971 133 0.719694810 0.710534192 134 0.454442460 0.719694810 135 -1.566970108 0.454442460 136 0.370434133 -1.566970108 137 -0.291544026 0.370434133 138 -0.592859380 -0.291544026 139 -0.111569506 -0.592859380 140 -1.733697693 -0.111569506 141 -0.232202462 -1.733697693 142 1.120105723 -0.232202462 143 -0.838175215 1.120105723 144 -1.249851232 -0.838175215 145 0.570258045 -1.249851232 146 0.777420635 0.570258045 147 -0.151673170 0.777420635 148 0.159240097 -0.151673170 149 -0.727194358 0.159240097 150 0.572266554 -0.727194358 151 -0.302235685 0.572266554 152 0.200370799 -0.302235685 153 -0.001269849 0.200370799 154 -3.461607360 -0.001269849 155 0.311011166 -3.461607360 156 0.175753330 0.311011166 157 -0.445967099 0.175753330 158 0.878195906 -0.445967099 159 0.301146070 0.878195906 160 -0.944224884 0.301146070 161 0.033108035 -0.944224884 > 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/freestat/rcomp/tmp/7sde71290538063.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/freestat/rcomp/tmp/8sde71290538063.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/freestat/rcomp/tmp/92nea1290538063.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/freestat/rcomp/tmp/102nea1290538063.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11gwt01290538063.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/freestat/rcomp/tmp/129ob31290538063.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/freestat/rcomp/tmp/13g7qx1290538063.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/freestat/rcomp/tmp/14j86l1290538063.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/freestat/rcomp/tmp/155qn91290538063.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/freestat/rcomp/tmp/168qlf1290538063.tab") + } > > try(system("convert tmp/1w4hg1290538063.ps tmp/1w4hg1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/2ovyj1290538063.ps tmp/2ovyj1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/3ovyj1290538063.ps tmp/3ovyj1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/4ovyj1290538063.ps tmp/4ovyj1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/5hmfm1290538063.ps tmp/5hmfm1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/6hmfm1290538063.ps tmp/6hmfm1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/7sde71290538063.ps tmp/7sde71290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/8sde71290538063.ps tmp/8sde71290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/92nea1290538063.ps tmp/92nea1290538063.png",intern=TRUE)) character(0) > try(system("convert tmp/102nea1290538063.ps tmp/102nea1290538063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.264 2.797 14.091