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(100,0,95.84395716,0,105.5073942,1,118.1540031,1,101.8612953,1,109.8419174,1,105.6348802,1,112.927078,1,133.0698623,1,125.6756757,1,146.736359,1,142.5803162,1,106.1448241,1,126.5170831,1,132.7893932,1,121.2391637,1,114.5079041,1,146.1499235,1,146.1244263,1,128.5058644,1,155.5838858,1,125.0382458,1,136.8944416,1,142.2233554,1,117.7715451,1,120.627231,1,127.7664457,1,135.1096379,1,105.7113717,1,117.9245283,1,120.754717,1,107.572667,1,130.4436512,1,107.2157063,1,105.0739419,1,130.1121877,1,109.6379398,1,116.7261601,1,97.11881693,0,140.8975013,1,108.2865885,1,97.65425803,0,112.0346762,1,123.0494646,1,112.4171341,1,116.4966854,1,104.6914839,1,122.2335543,1,99.79602244,0,96.71086181,0,112.3151453,1,102.5497195,1,104.5385008,1,122.0805711,1,80.64762876,0,91.40744518,0,99.51555329,0,106.527282,1,98.49566548,0,106.7567568,1),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 100.00000 0 2 95.84396 0 3 105.50739 1 4 118.15400 1 5 101.86130 1 6 109.84192 1 7 105.63488 1 8 112.92708 1 9 133.06986 1 10 125.67568 1 11 146.73636 1 12 142.58032 1 13 106.14482 1 14 126.51708 1 15 132.78939 1 16 121.23916 1 17 114.50790 1 18 146.14992 1 19 146.12443 1 20 128.50586 1 21 155.58389 1 22 125.03825 1 23 136.89444 1 24 142.22336 1 25 117.77155 1 26 120.62723 1 27 127.76645 1 28 135.10964 1 29 105.71137 1 30 117.92453 1 31 120.75472 1 32 107.57267 1 33 130.44365 1 34 107.21571 1 35 105.07394 1 36 130.11219 1 37 109.63794 1 38 116.72616 1 39 97.11882 0 40 140.89750 1 41 108.28659 1 42 97.65426 0 43 112.03468 1 44 123.04946 1 45 112.41713 1 46 116.49669 1 47 104.69148 1 48 122.23355 1 49 99.79602 0 50 96.71086 0 51 112.31515 1 52 102.54972 1 53 104.53850 1 54 122.08057 1 55 80.64763 0 56 91.40745 0 57 99.51555 0 58 106.52728 1 59 98.49567 0 60 106.75676 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 95.72 24.90 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -18.7593 -11.3205 0.1295 6.2088 34.9633 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 95.719 4.121 23.225 < 2e-16 *** X 24.902 4.515 5.516 8.44e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 13.03 on 58 degrees of freedom Multiple R-squared: 0.344, Adjusted R-squared: 0.3327 F-statistic: 30.42 on 1 and 58 DF, p-value: 8.442e-07 > 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.17249457 0.344989146 0.827505427 [2,] 0.07597932 0.151958645 0.924020678 [3,] 0.03501412 0.070028245 0.964985877 [4,] 0.01751472 0.035029435 0.982485282 [5,] 0.20992355 0.419847090 0.790076455 [6,] 0.21219262 0.424385247 0.787807377 [7,] 0.66291587 0.674168267 0.337084134 [8,] 0.80405798 0.391884036 0.195942018 [9,] 0.80025259 0.399494828 0.199747414 [10,] 0.74703107 0.505937851 0.252968925 [11,] 0.73318784 0.533624312 0.266812156 [12,] 0.65566707 0.688665851 0.344332925 [13,] 0.58877934 0.822441325 0.411220662 [14,] 0.77053654 0.458926913 0.229463456 [15,] 0.88507010 0.229859809 0.114929904 [16,] 0.85409869 0.291802615 0.145901308 [17,] 0.98421475 0.031570491 0.015785245 [18,] 0.97655926 0.046881486 0.023440743 [19,] 0.98272788 0.034544250 0.017272125 [20,] 0.99462245 0.010755097 0.005377548 [21,] 0.99170011 0.016599786 0.008299893 [22,] 0.98731390 0.025372206 0.012686103 [23,] 0.98510940 0.029781199 0.014890599 [24,] 0.99182106 0.016357873 0.008178937 [25,] 0.99320034 0.013599328 0.006799664 [26,] 0.98947982 0.021040356 0.010520178 [27,] 0.98462712 0.030745751 0.015372876 [28,] 0.98359592 0.032808162 0.016404081 [29,] 0.98728373 0.025432530 0.012716265 [30,] 0.98606865 0.027862710 0.013931355 [31,] 0.98695813 0.026083746 0.013041873 [32,] 0.99054055 0.018918898 0.009459449 [33,] 0.98699355 0.026012902 0.013006451 [34,] 0.97926717 0.041465654 0.020732827 [35,] 0.96652650 0.066946995 0.033473498 [36,] 0.99863588 0.002728236 0.001364118 [37,] 0.99783655 0.004326892 0.002163446 [38,] 0.99582015 0.008359703 0.004179852 [39,] 0.99238601 0.015227972 0.007613986 [40,] 0.99327730 0.013445405 0.006722702 [41,] 0.98767255 0.024654905 0.012327453 [42,] 0.98108319 0.037833618 0.018916809 [43,] 0.97461711 0.050765776 0.025382888 [44,] 0.98009768 0.039804636 0.019902318 [45,] 0.96849359 0.063012829 0.031506414 [46,] 0.94407574 0.111848521 0.055924260 [47,] 0.90576411 0.188471787 0.094235894 [48,] 0.87574967 0.248500665 0.124250332 [49,] 0.82553606 0.348927874 0.174463937 [50,] 0.86174675 0.276506495 0.138253248 [51,] 0.97402813 0.051943738 0.025971869 > postscript(file="/var/www/html/rcomp/tmp/1glbi1258717880.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/2wgr01258717880.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/3qvah1258717880.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/4ga8c1258717880.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/5etro1258717880.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 4.280979092 0.124936252 -15.113207538 -2.466598638 -18.759306438 6 7 8 9 10 -10.778684338 -14.985721538 -7.693523738 12.449260562 5.055073962 11 12 13 14 15 26.115757262 21.959714462 -14.475777638 5.896481362 12.168791462 16 17 18 19 20 0.618561962 -6.112697638 25.529321762 25.503824562 7.885262662 21 22 23 24 25 34.963284062 4.417644062 16.273839862 21.602753662 -2.849056638 26 27 28 29 30 0.006629262 7.145843962 14.489036162 -14.909230038 -2.696073438 31 32 33 34 35 0.134115262 -13.047934738 9.823049462 -13.404895438 -15.546659838 36 37 38 39 40 9.491585962 -10.982661938 -3.894441638 1.399796022 20.276899562 41 42 43 44 45 -12.334013238 1.935237122 -8.585925538 2.428862862 -8.203467638 46 47 48 49 50 -4.123916338 -15.929117838 1.612952562 4.077001532 0.991840902 51 52 53 54 55 -8.305456438 -18.070882238 -16.082100938 1.459969362 -15.071392148 56 57 58 59 60 -4.311575728 3.796532382 -14.093319738 2.776644572 -13.863844938 > postscript(file="/var/www/html/rcomp/tmp/69kxm1258717880.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 4.280979092 NA 1 0.124936252 4.280979092 2 -15.113207538 0.124936252 3 -2.466598638 -15.113207538 4 -18.759306438 -2.466598638 5 -10.778684338 -18.759306438 6 -14.985721538 -10.778684338 7 -7.693523738 -14.985721538 8 12.449260562 -7.693523738 9 5.055073962 12.449260562 10 26.115757262 5.055073962 11 21.959714462 26.115757262 12 -14.475777638 21.959714462 13 5.896481362 -14.475777638 14 12.168791462 5.896481362 15 0.618561962 12.168791462 16 -6.112697638 0.618561962 17 25.529321762 -6.112697638 18 25.503824562 25.529321762 19 7.885262662 25.503824562 20 34.963284062 7.885262662 21 4.417644062 34.963284062 22 16.273839862 4.417644062 23 21.602753662 16.273839862 24 -2.849056638 21.602753662 25 0.006629262 -2.849056638 26 7.145843962 0.006629262 27 14.489036162 7.145843962 28 -14.909230038 14.489036162 29 -2.696073438 -14.909230038 30 0.134115262 -2.696073438 31 -13.047934738 0.134115262 32 9.823049462 -13.047934738 33 -13.404895438 9.823049462 34 -15.546659838 -13.404895438 35 9.491585962 -15.546659838 36 -10.982661938 9.491585962 37 -3.894441638 -10.982661938 38 1.399796022 -3.894441638 39 20.276899562 1.399796022 40 -12.334013238 20.276899562 41 1.935237122 -12.334013238 42 -8.585925538 1.935237122 43 2.428862862 -8.585925538 44 -8.203467638 2.428862862 45 -4.123916338 -8.203467638 46 -15.929117838 -4.123916338 47 1.612952562 -15.929117838 48 4.077001532 1.612952562 49 0.991840902 4.077001532 50 -8.305456438 0.991840902 51 -18.070882238 -8.305456438 52 -16.082100938 -18.070882238 53 1.459969362 -16.082100938 54 -15.071392148 1.459969362 55 -4.311575728 -15.071392148 56 3.796532382 -4.311575728 57 -14.093319738 3.796532382 58 2.776644572 -14.093319738 59 -13.863844938 2.776644572 60 NA -13.863844938 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.124936252 4.280979092 [2,] -15.113207538 0.124936252 [3,] -2.466598638 -15.113207538 [4,] -18.759306438 -2.466598638 [5,] -10.778684338 -18.759306438 [6,] -14.985721538 -10.778684338 [7,] -7.693523738 -14.985721538 [8,] 12.449260562 -7.693523738 [9,] 5.055073962 12.449260562 [10,] 26.115757262 5.055073962 [11,] 21.959714462 26.115757262 [12,] -14.475777638 21.959714462 [13,] 5.896481362 -14.475777638 [14,] 12.168791462 5.896481362 [15,] 0.618561962 12.168791462 [16,] -6.112697638 0.618561962 [17,] 25.529321762 -6.112697638 [18,] 25.503824562 25.529321762 [19,] 7.885262662 25.503824562 [20,] 34.963284062 7.885262662 [21,] 4.417644062 34.963284062 [22,] 16.273839862 4.417644062 [23,] 21.602753662 16.273839862 [24,] -2.849056638 21.602753662 [25,] 0.006629262 -2.849056638 [26,] 7.145843962 0.006629262 [27,] 14.489036162 7.145843962 [28,] -14.909230038 14.489036162 [29,] -2.696073438 -14.909230038 [30,] 0.134115262 -2.696073438 [31,] -13.047934738 0.134115262 [32,] 9.823049462 -13.047934738 [33,] -13.404895438 9.823049462 [34,] -15.546659838 -13.404895438 [35,] 9.491585962 -15.546659838 [36,] -10.982661938 9.491585962 [37,] -3.894441638 -10.982661938 [38,] 1.399796022 -3.894441638 [39,] 20.276899562 1.399796022 [40,] -12.334013238 20.276899562 [41,] 1.935237122 -12.334013238 [42,] -8.585925538 1.935237122 [43,] 2.428862862 -8.585925538 [44,] -8.203467638 2.428862862 [45,] -4.123916338 -8.203467638 [46,] -15.929117838 -4.123916338 [47,] 1.612952562 -15.929117838 [48,] 4.077001532 1.612952562 [49,] 0.991840902 4.077001532 [50,] -8.305456438 0.991840902 [51,] -18.070882238 -8.305456438 [52,] -16.082100938 -18.070882238 [53,] 1.459969362 -16.082100938 [54,] -15.071392148 1.459969362 [55,] -4.311575728 -15.071392148 [56,] 3.796532382 -4.311575728 [57,] -14.093319738 3.796532382 [58,] 2.776644572 -14.093319738 [59,] -13.863844938 2.776644572 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.124936252 4.280979092 2 -15.113207538 0.124936252 3 -2.466598638 -15.113207538 4 -18.759306438 -2.466598638 5 -10.778684338 -18.759306438 6 -14.985721538 -10.778684338 7 -7.693523738 -14.985721538 8 12.449260562 -7.693523738 9 5.055073962 12.449260562 10 26.115757262 5.055073962 11 21.959714462 26.115757262 12 -14.475777638 21.959714462 13 5.896481362 -14.475777638 14 12.168791462 5.896481362 15 0.618561962 12.168791462 16 -6.112697638 0.618561962 17 25.529321762 -6.112697638 18 25.503824562 25.529321762 19 7.885262662 25.503824562 20 34.963284062 7.885262662 21 4.417644062 34.963284062 22 16.273839862 4.417644062 23 21.602753662 16.273839862 24 -2.849056638 21.602753662 25 0.006629262 -2.849056638 26 7.145843962 0.006629262 27 14.489036162 7.145843962 28 -14.909230038 14.489036162 29 -2.696073438 -14.909230038 30 0.134115262 -2.696073438 31 -13.047934738 0.134115262 32 9.823049462 -13.047934738 33 -13.404895438 9.823049462 34 -15.546659838 -13.404895438 35 9.491585962 -15.546659838 36 -10.982661938 9.491585962 37 -3.894441638 -10.982661938 38 1.399796022 -3.894441638 39 20.276899562 1.399796022 40 -12.334013238 20.276899562 41 1.935237122 -12.334013238 42 -8.585925538 1.935237122 43 2.428862862 -8.585925538 44 -8.203467638 2.428862862 45 -4.123916338 -8.203467638 46 -15.929117838 -4.123916338 47 1.612952562 -15.929117838 48 4.077001532 1.612952562 49 0.991840902 4.077001532 50 -8.305456438 0.991840902 51 -18.070882238 -8.305456438 52 -16.082100938 -18.070882238 53 1.459969362 -16.082100938 54 -15.071392148 1.459969362 55 -4.311575728 -15.071392148 56 3.796532382 -4.311575728 57 -14.093319738 3.796532382 58 2.776644572 -14.093319738 59 -13.863844938 2.776644572 > 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/7x1el1258717880.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/80kuy1258717880.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/9l3u31258717880.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/106i101258717880.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/11hp3l1258717880.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/12qmw51258717880.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/13oibr1258717880.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/14136k1258717880.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/15oqps1258717880.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/169kg11258717880.tab") + } > > system("convert tmp/1glbi1258717880.ps tmp/1glbi1258717880.png") > system("convert tmp/2wgr01258717880.ps tmp/2wgr01258717880.png") > system("convert tmp/3qvah1258717880.ps tmp/3qvah1258717880.png") > system("convert tmp/4ga8c1258717880.ps tmp/4ga8c1258717880.png") > system("convert tmp/5etro1258717880.ps tmp/5etro1258717880.png") > system("convert tmp/69kxm1258717880.ps tmp/69kxm1258717880.png") > system("convert tmp/7x1el1258717880.ps tmp/7x1el1258717880.png") > system("convert tmp/80kuy1258717880.ps tmp/80kuy1258717880.png") > system("convert tmp/9l3u31258717880.ps tmp/9l3u31258717880.png") > system("convert tmp/106i101258717880.ps tmp/106i101258717880.png") > > > proc.time() user system elapsed 2.472 1.571 4.249