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(9.3,98.3,9.3,112.3,8.7,113.9,8.2,106.2,8.3,98.6,8.5,96.5,8.6,95.9,8.5,103.7,8.2,103.1,8.1,103.7,7.9,112.1,8.6,86.9,8.7,95,8.7,111.8,8.5,108.8,8.4,109.3,8.5,101.4,8.7,100.5,8.7,100.7,8.6,113.5,8.5,106.1,8.3,111.6,8,114.9,8.2,88.6,8.1,99.5,8.1,115.1,8,118,7.9,111.4,7.9,107.3,8,105.3,8,105.3,7.9,117.9,8,110.2,7.7,112.4,7.2,117.5,7.5,93,7.3,103.5,7,116.3,7,120,7,114.3,7.2,104.7,7.3,109.8,7.1,112.6,6.8,114.4,6.4,115.7,6.1,114.7,6.5,118.4,7.7,94.9,7.9,103.8,7.5,115.1,6.9,113.7,6.6,104,6.9,94.3,7.7,92.5,8,93.2,8,104.7,7.7,94,7.3,98.1,7.4,102.7,8.1,82.4),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 = '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 Y X 1 9.3 98.3 2 9.3 112.3 3 8.7 113.9 4 8.2 106.2 5 8.3 98.6 6 8.5 96.5 7 8.6 95.9 8 8.5 103.7 9 8.2 103.1 10 8.1 103.7 11 7.9 112.1 12 8.6 86.9 13 8.7 95.0 14 8.7 111.8 15 8.5 108.8 16 8.4 109.3 17 8.5 101.4 18 8.7 100.5 19 8.7 100.7 20 8.6 113.5 21 8.5 106.1 22 8.3 111.6 23 8.0 114.9 24 8.2 88.6 25 8.1 99.5 26 8.1 115.1 27 8.0 118.0 28 7.9 111.4 29 7.9 107.3 30 8.0 105.3 31 8.0 105.3 32 7.9 117.9 33 8.0 110.2 34 7.7 112.4 35 7.2 117.5 36 7.5 93.0 37 7.3 103.5 38 7.0 116.3 39 7.0 120.0 40 7.0 114.3 41 7.2 104.7 42 7.3 109.8 43 7.1 112.6 44 6.8 114.4 45 6.4 115.7 46 6.1 114.7 47 6.5 118.4 48 7.7 94.9 49 7.9 103.8 50 7.5 115.1 51 6.9 113.7 52 6.6 104.0 53 6.9 94.3 54 7.7 92.5 55 8.0 93.2 56 8.0 104.7 57 7.7 94.0 58 7.3 98.1 59 7.4 102.7 60 8.1 82.4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 10.55092 -0.02543 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.5337 -0.5089 0.1196 0.4794 1.6053 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.550923 1.045228 10.094 2.19e-14 *** X -0.025434 0.009851 -2.582 0.0124 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6764 on 58 degrees of freedom Multiple R-squared: 0.1031, Adjusted R-squared: 0.08762 F-statistic: 6.666 on 1 and 58 DF, p-value: 0.01237 > 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.56774928 0.86450144 0.43225072 [2,] 0.40734336 0.81468672 0.59265664 [3,] 0.27133628 0.54267256 0.72866372 [4,] 0.18467700 0.36935400 0.81532300 [5,] 0.15805645 0.31611290 0.84194355 [6,] 0.14589378 0.29178756 0.85410622 [7,] 0.17684267 0.35368534 0.82315733 [8,] 0.11739401 0.23478801 0.88260599 [9,] 0.08292656 0.16585312 0.91707344 [10,] 0.06904669 0.13809337 0.93095331 [11,] 0.04998958 0.09997915 0.95001042 [12,] 0.03624645 0.07249289 0.96375355 [13,] 0.02508427 0.05016854 0.97491573 [14,] 0.02073857 0.04147713 0.97926143 [15,] 0.01828716 0.03657432 0.98171284 [16,] 0.01951942 0.03903883 0.98048058 [17,] 0.01806303 0.03612605 0.98193697 [18,] 0.01855148 0.03710296 0.98144852 [19,] 0.02408641 0.04817283 0.97591359 [20,] 0.02276678 0.04553356 0.97723322 [21,] 0.02334280 0.04668560 0.97665720 [22,] 0.02942885 0.05885770 0.97057115 [23,] 0.04161446 0.08322891 0.95838554 [24,] 0.05538096 0.11076193 0.94461904 [25,] 0.06907720 0.13815440 0.93092280 [26,] 0.08077751 0.16155502 0.91922249 [27,] 0.09629966 0.19259932 0.90370034 [28,] 0.15966827 0.31933655 0.84033173 [29,] 0.24197019 0.48394038 0.75802981 [30,] 0.34214590 0.68429180 0.65785410 [31,] 0.48330304 0.96660607 0.51669696 [32,] 0.60196779 0.79606442 0.39803221 [33,] 0.66953651 0.66092698 0.33046349 [34,] 0.73243884 0.53512232 0.26756116 [35,] 0.76482738 0.47034524 0.23517262 [36,] 0.77713274 0.44573451 0.22286726 [37,] 0.77866230 0.44267541 0.22133770 [38,] 0.76173250 0.47653501 0.23826750 [39,] 0.74262832 0.51474336 0.25737168 [40,] 0.72953212 0.54093575 0.27046788 [41,] 0.77081786 0.45836427 0.22918214 [42,] 0.90250727 0.19498546 0.09749273 [43,] 0.90773199 0.18453602 0.09226801 [44,] 0.86832602 0.26334796 0.13167398 [45,] 0.85418179 0.29163643 0.14581821 [46,] 0.83930386 0.32139228 0.16069614 [47,] 0.76636127 0.46727747 0.23363873 [48,] 0.86806998 0.26386005 0.13193002 [49,] 0.96536074 0.06927851 0.03463926 [50,] 0.91973532 0.16052936 0.08026468 [51,] 0.84012917 0.31974166 0.15987083 > postscript(file="/var/www/html/rcomp/tmp/1k8u81258749926.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/209ze1258749926.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/3kkh31258749926.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/40wui1258749926.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/5s7n01258749926.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 1.24923211 1.60530705 1.04600133 0.35016011 0.25686228 0.40345104 7 8 9 10 11 12 0.48819069 0.58657530 0.27131494 0.18657530 0.20022026 0.25928537 13 14 15 16 17 18 0.56530015 0.99259008 0.71628831 0.62900527 0.52807727 0.70518674 19 20 21 22 23 24 0.71027352 0.93582776 0.64761672 0.58750330 0.37143525 -0.09747696 25 26 27 28 29 30 0.07975281 0.47652204 0.45028042 0.18241652 0.07813743 0.12726958 31 32 33 34 35 36 0.12726958 0.34773702 0.25189581 0.00785044 -0.36243655 -0.68556769 37 38 39 40 41 42 -0.61851149 -0.59295726 -0.49885174 -0.64382510 -0.68799078 -0.45827776 43 44 45 46 47 48 -0.58706278 -0.84128171 -1.20821761 -1.53365153 -1.03954601 -0.43724324 49 50 51 52 53 54 -0.01088131 -0.12347796 -0.75908546 -1.30579453 -1.25250359 -0.49828466 55 56 57 58 59 60 -0.18048091 0.11200922 -0.46013377 -0.75585468 -0.53885863 -0.35516729 > postscript(file="/var/www/html/rcomp/tmp/6fh9k1258749926.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 1.24923211 NA 1 1.60530705 1.24923211 2 1.04600133 1.60530705 3 0.35016011 1.04600133 4 0.25686228 0.35016011 5 0.40345104 0.25686228 6 0.48819069 0.40345104 7 0.58657530 0.48819069 8 0.27131494 0.58657530 9 0.18657530 0.27131494 10 0.20022026 0.18657530 11 0.25928537 0.20022026 12 0.56530015 0.25928537 13 0.99259008 0.56530015 14 0.71628831 0.99259008 15 0.62900527 0.71628831 16 0.52807727 0.62900527 17 0.70518674 0.52807727 18 0.71027352 0.70518674 19 0.93582776 0.71027352 20 0.64761672 0.93582776 21 0.58750330 0.64761672 22 0.37143525 0.58750330 23 -0.09747696 0.37143525 24 0.07975281 -0.09747696 25 0.47652204 0.07975281 26 0.45028042 0.47652204 27 0.18241652 0.45028042 28 0.07813743 0.18241652 29 0.12726958 0.07813743 30 0.12726958 0.12726958 31 0.34773702 0.12726958 32 0.25189581 0.34773702 33 0.00785044 0.25189581 34 -0.36243655 0.00785044 35 -0.68556769 -0.36243655 36 -0.61851149 -0.68556769 37 -0.59295726 -0.61851149 38 -0.49885174 -0.59295726 39 -0.64382510 -0.49885174 40 -0.68799078 -0.64382510 41 -0.45827776 -0.68799078 42 -0.58706278 -0.45827776 43 -0.84128171 -0.58706278 44 -1.20821761 -0.84128171 45 -1.53365153 -1.20821761 46 -1.03954601 -1.53365153 47 -0.43724324 -1.03954601 48 -0.01088131 -0.43724324 49 -0.12347796 -0.01088131 50 -0.75908546 -0.12347796 51 -1.30579453 -0.75908546 52 -1.25250359 -1.30579453 53 -0.49828466 -1.25250359 54 -0.18048091 -0.49828466 55 0.11200922 -0.18048091 56 -0.46013377 0.11200922 57 -0.75585468 -0.46013377 58 -0.53885863 -0.75585468 59 -0.35516729 -0.53885863 60 NA -0.35516729 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.60530705 1.24923211 [2,] 1.04600133 1.60530705 [3,] 0.35016011 1.04600133 [4,] 0.25686228 0.35016011 [5,] 0.40345104 0.25686228 [6,] 0.48819069 0.40345104 [7,] 0.58657530 0.48819069 [8,] 0.27131494 0.58657530 [9,] 0.18657530 0.27131494 [10,] 0.20022026 0.18657530 [11,] 0.25928537 0.20022026 [12,] 0.56530015 0.25928537 [13,] 0.99259008 0.56530015 [14,] 0.71628831 0.99259008 [15,] 0.62900527 0.71628831 [16,] 0.52807727 0.62900527 [17,] 0.70518674 0.52807727 [18,] 0.71027352 0.70518674 [19,] 0.93582776 0.71027352 [20,] 0.64761672 0.93582776 [21,] 0.58750330 0.64761672 [22,] 0.37143525 0.58750330 [23,] -0.09747696 0.37143525 [24,] 0.07975281 -0.09747696 [25,] 0.47652204 0.07975281 [26,] 0.45028042 0.47652204 [27,] 0.18241652 0.45028042 [28,] 0.07813743 0.18241652 [29,] 0.12726958 0.07813743 [30,] 0.12726958 0.12726958 [31,] 0.34773702 0.12726958 [32,] 0.25189581 0.34773702 [33,] 0.00785044 0.25189581 [34,] -0.36243655 0.00785044 [35,] -0.68556769 -0.36243655 [36,] -0.61851149 -0.68556769 [37,] -0.59295726 -0.61851149 [38,] -0.49885174 -0.59295726 [39,] -0.64382510 -0.49885174 [40,] -0.68799078 -0.64382510 [41,] -0.45827776 -0.68799078 [42,] -0.58706278 -0.45827776 [43,] -0.84128171 -0.58706278 [44,] -1.20821761 -0.84128171 [45,] -1.53365153 -1.20821761 [46,] -1.03954601 -1.53365153 [47,] -0.43724324 -1.03954601 [48,] -0.01088131 -0.43724324 [49,] -0.12347796 -0.01088131 [50,] -0.75908546 -0.12347796 [51,] -1.30579453 -0.75908546 [52,] -1.25250359 -1.30579453 [53,] -0.49828466 -1.25250359 [54,] -0.18048091 -0.49828466 [55,] 0.11200922 -0.18048091 [56,] -0.46013377 0.11200922 [57,] -0.75585468 -0.46013377 [58,] -0.53885863 -0.75585468 [59,] -0.35516729 -0.53885863 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.60530705 1.24923211 2 1.04600133 1.60530705 3 0.35016011 1.04600133 4 0.25686228 0.35016011 5 0.40345104 0.25686228 6 0.48819069 0.40345104 7 0.58657530 0.48819069 8 0.27131494 0.58657530 9 0.18657530 0.27131494 10 0.20022026 0.18657530 11 0.25928537 0.20022026 12 0.56530015 0.25928537 13 0.99259008 0.56530015 14 0.71628831 0.99259008 15 0.62900527 0.71628831 16 0.52807727 0.62900527 17 0.70518674 0.52807727 18 0.71027352 0.70518674 19 0.93582776 0.71027352 20 0.64761672 0.93582776 21 0.58750330 0.64761672 22 0.37143525 0.58750330 23 -0.09747696 0.37143525 24 0.07975281 -0.09747696 25 0.47652204 0.07975281 26 0.45028042 0.47652204 27 0.18241652 0.45028042 28 0.07813743 0.18241652 29 0.12726958 0.07813743 30 0.12726958 0.12726958 31 0.34773702 0.12726958 32 0.25189581 0.34773702 33 0.00785044 0.25189581 34 -0.36243655 0.00785044 35 -0.68556769 -0.36243655 36 -0.61851149 -0.68556769 37 -0.59295726 -0.61851149 38 -0.49885174 -0.59295726 39 -0.64382510 -0.49885174 40 -0.68799078 -0.64382510 41 -0.45827776 -0.68799078 42 -0.58706278 -0.45827776 43 -0.84128171 -0.58706278 44 -1.20821761 -0.84128171 45 -1.53365153 -1.20821761 46 -1.03954601 -1.53365153 47 -0.43724324 -1.03954601 48 -0.01088131 -0.43724324 49 -0.12347796 -0.01088131 50 -0.75908546 -0.12347796 51 -1.30579453 -0.75908546 52 -1.25250359 -1.30579453 53 -0.49828466 -1.25250359 54 -0.18048091 -0.49828466 55 0.11200922 -0.18048091 56 -0.46013377 0.11200922 57 -0.75585468 -0.46013377 58 -0.53885863 -0.75585468 59 -0.35516729 -0.53885863 > 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/72mrz1258749926.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/8xwas1258749926.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/9uo871258749926.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/10vc3v1258749926.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/11g4gm1258749926.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/122fpv1258749926.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/131mpl1258749926.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/14ubml1258749926.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/15qw4l1258749926.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/16jaiv1258749926.tab") + } > > system("convert tmp/1k8u81258749926.ps tmp/1k8u81258749926.png") > system("convert tmp/209ze1258749926.ps tmp/209ze1258749926.png") > system("convert tmp/3kkh31258749926.ps tmp/3kkh31258749926.png") > system("convert tmp/40wui1258749926.ps tmp/40wui1258749926.png") > system("convert tmp/5s7n01258749926.ps tmp/5s7n01258749926.png") > system("convert tmp/6fh9k1258749926.ps tmp/6fh9k1258749926.png") > system("convert tmp/72mrz1258749926.ps tmp/72mrz1258749926.png") > system("convert tmp/8xwas1258749926.ps tmp/8xwas1258749926.png") > system("convert tmp/9uo871258749926.ps tmp/9uo871258749926.png") > system("convert tmp/10vc3v1258749926.ps tmp/10vc3v1258749926.png") > > > proc.time() user system elapsed 2.394 1.556 3.628