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(104.08,99.2,103.86,93.6,107.47,104.2,111.1,95.3,117.33,102.7,119.04,103.1,123.68,100,125.9,107.2,124.54,107,119.39,119,118.8,110.4,114.81,101.7,117.9,102.4,120.53,98.8,125.15,105.6,126.49,104.4,131.85,106.3,127.4,107.2,131.08,108.5,122.37,106.9,124.34,114.2,119.61,125.9,119.97,110.6,116.46,110.5,117.03,106.7,120.96,104.7,124.71,107.4,127.08,109.8,131.91,103.4,137.69,114.8,142.46,114.3,144.32,109.6,138.06,118.3,124.45,127.3,126.71,112.3,121.83,114.9,122.51,108.2,125.48,105.4,127.77,122.1,128.03,113.5,132.84,110,133.41,125.3,139.99,114.3,138.53,115.6,136.12,127.1,124.75,123,122.88,122.2,121.46,126.4,118.4,112.7,122.45,105.8,128.94,120.9,133.25,116.3,137.94,115.7,140.04,127.9,130.74,108.3,131.55,121.1,129.47,128.6,125.45,123.1,127.87,127.7,124.68,126.6),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 104.08 99.2 2 103.86 93.6 3 107.47 104.2 4 111.10 95.3 5 117.33 102.7 6 119.04 103.1 7 123.68 100.0 8 125.90 107.2 9 124.54 107.0 10 119.39 119.0 11 118.80 110.4 12 114.81 101.7 13 117.90 102.4 14 120.53 98.8 15 125.15 105.6 16 126.49 104.4 17 131.85 106.3 18 127.40 107.2 19 131.08 108.5 20 122.37 106.9 21 124.34 114.2 22 119.61 125.9 23 119.97 110.6 24 116.46 110.5 25 117.03 106.7 26 120.96 104.7 27 124.71 107.4 28 127.08 109.8 29 131.91 103.4 30 137.69 114.8 31 142.46 114.3 32 144.32 109.6 33 138.06 118.3 34 124.45 127.3 35 126.71 112.3 36 121.83 114.9 37 122.51 108.2 38 125.48 105.4 39 127.77 122.1 40 128.03 113.5 41 132.84 110.0 42 133.41 125.3 43 139.99 114.3 44 138.53 115.6 45 136.12 127.1 46 124.75 123.0 47 122.88 122.2 48 121.46 126.4 49 118.40 112.7 50 122.45 105.8 51 128.94 120.9 52 133.25 116.3 53 137.94 115.7 54 140.04 127.9 55 130.74 108.3 56 131.55 121.1 57 129.47 128.6 58 125.45 123.1 59 127.87 127.7 60 124.68 126.6 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 75.6033 0.4452 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -15.6849 -5.6953 -0.3691 4.1579 19.9253 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 75.6033 12.4507 6.072 1.04e-07 *** X 0.4452 0.1105 4.027 0.000166 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 7.72 on 58 degrees of freedom Multiple R-squared: 0.2185, Adjusted R-squared: 0.205 F-statistic: 16.22 on 1 and 58 DF, p-value: 0.0001662 > 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.4640749 0.92814973 0.53592513 [2,] 0.4680689 0.93613779 0.53193111 [3,] 0.6827044 0.63459124 0.31729562 [4,] 0.6216707 0.75665863 0.37832932 [5,] 0.5157055 0.96858896 0.48429448 [6,] 0.6307705 0.73845908 0.36922954 [7,] 0.5484528 0.90309435 0.45154717 [8,] 0.4820679 0.96413581 0.51793209 [9,] 0.4191280 0.83825598 0.58087201 [10,] 0.4173728 0.83474561 0.58262719 [11,] 0.4080358 0.81607153 0.59196423 [12,] 0.4268593 0.85371867 0.57314066 [13,] 0.5362360 0.92752809 0.46376404 [14,] 0.4979327 0.99586544 0.50206728 [15,] 0.4996999 0.99939970 0.50030015 [16,] 0.4285623 0.85712464 0.57143768 [17,] 0.3643969 0.72879385 0.63560307 [18,] 0.4817722 0.96354443 0.51822779 [19,] 0.4414392 0.88287846 0.55856077 [20,] 0.4710236 0.94204727 0.52897636 [21,] 0.4873149 0.97462986 0.51268507 [22,] 0.4635351 0.92707014 0.53646493 [23,] 0.4268257 0.85365137 0.57317432 [24,] 0.3881082 0.77621639 0.61189180 [25,] 0.4489693 0.89793858 0.55103071 [26,] 0.5392989 0.92140215 0.46070108 [27,] 0.7484049 0.50319015 0.25159507 [28,] 0.9396323 0.12073546 0.06036773 [29,] 0.9489064 0.10218726 0.05109363 [30,] 0.9504271 0.09914576 0.04957288 [31,] 0.9274554 0.14508918 0.07254459 [32,] 0.9215482 0.15690357 0.07845178 [33,] 0.9064600 0.18708008 0.09354004 [34,] 0.8791797 0.24164061 0.12082031 [35,] 0.8377814 0.32443726 0.16221863 [36,] 0.7854032 0.42919361 0.21459681 [37,] 0.7499038 0.50019243 0.25009622 [38,] 0.6896027 0.62079469 0.31039734 [39,] 0.7847716 0.43045673 0.21522836 [40,] 0.8459928 0.30801444 0.15400722 [41,] 0.8345355 0.33092892 0.16546446 [42,] 0.7953793 0.40924145 0.20462072 [43,] 0.7764843 0.44703131 0.22351566 [44,] 0.8159761 0.36804771 0.18402385 [45,] 0.8812725 0.23745509 0.11872755 [46,] 0.9064235 0.18715304 0.09357652 [47,] 0.8500439 0.29991229 0.14995615 [48,] 0.7666163 0.46676747 0.23338374 [49,] 0.7765018 0.44699643 0.22349821 [50,] 0.9746749 0.05065028 0.02532514 [51,] 0.9223476 0.15530488 0.07765244 > postscript(file="/var/www/html/rcomp/tmp/1gxwu1258761893.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/20e2r1258761893.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/3kn7d1258761893.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/4dvgv1258761893.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/5fpyf1258761893.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 -15.6848500 -13.4118572 -14.5207365 -6.9286586 -3.9929705 -2.4610415 7 8 9 10 11 12 3.5590082 2.5737316 1.3027671 -9.1893605 -5.9508357 -6.0677932 13 14 15 16 17 18 -3.2894174 0.9432209 2.5360153 4.4102281 8.9243912 4.0737316 19 20 21 22 23 24 7.1750011 -0.8227152 -2.1025094 -12.0410838 -4.8698712 -8.3353534 25 26 27 28 29 30 -6.0736797 -1.2533251 1.2946962 2.5962707 10.2754054 10.9803842 31 32 33 34 35 36 15.9729728 19.9253061 9.7922637 -7.8243320 1.1133274 -4.9241335 37 38 39 40 41 42 -1.2614457 2.9550508 -2.1894101 1.8991147 8.2672352 2.0260226 43 44 45 46 47 48 13.5029728 11.4642423 3.9347035 -5.6100696 -7.1239278 -10.4136724 49 50 51 52 53 54 -7.3747435 -0.2530202 -0.4851973 5.8726182 10.8297246 7.4985616 55 56 57 58 59 60 6.9240366 2.0357672 -3.3830625 -4.9545874 -4.5824029 -7.2827079 > postscript(file="/var/www/html/rcomp/tmp/6hf3b1258761893.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 -15.6848500 NA 1 -13.4118572 -15.6848500 2 -14.5207365 -13.4118572 3 -6.9286586 -14.5207365 4 -3.9929705 -6.9286586 5 -2.4610415 -3.9929705 6 3.5590082 -2.4610415 7 2.5737316 3.5590082 8 1.3027671 2.5737316 9 -9.1893605 1.3027671 10 -5.9508357 -9.1893605 11 -6.0677932 -5.9508357 12 -3.2894174 -6.0677932 13 0.9432209 -3.2894174 14 2.5360153 0.9432209 15 4.4102281 2.5360153 16 8.9243912 4.4102281 17 4.0737316 8.9243912 18 7.1750011 4.0737316 19 -0.8227152 7.1750011 20 -2.1025094 -0.8227152 21 -12.0410838 -2.1025094 22 -4.8698712 -12.0410838 23 -8.3353534 -4.8698712 24 -6.0736797 -8.3353534 25 -1.2533251 -6.0736797 26 1.2946962 -1.2533251 27 2.5962707 1.2946962 28 10.2754054 2.5962707 29 10.9803842 10.2754054 30 15.9729728 10.9803842 31 19.9253061 15.9729728 32 9.7922637 19.9253061 33 -7.8243320 9.7922637 34 1.1133274 -7.8243320 35 -4.9241335 1.1133274 36 -1.2614457 -4.9241335 37 2.9550508 -1.2614457 38 -2.1894101 2.9550508 39 1.8991147 -2.1894101 40 8.2672352 1.8991147 41 2.0260226 8.2672352 42 13.5029728 2.0260226 43 11.4642423 13.5029728 44 3.9347035 11.4642423 45 -5.6100696 3.9347035 46 -7.1239278 -5.6100696 47 -10.4136724 -7.1239278 48 -7.3747435 -10.4136724 49 -0.2530202 -7.3747435 50 -0.4851973 -0.2530202 51 5.8726182 -0.4851973 52 10.8297246 5.8726182 53 7.4985616 10.8297246 54 6.9240366 7.4985616 55 2.0357672 6.9240366 56 -3.3830625 2.0357672 57 -4.9545874 -3.3830625 58 -4.5824029 -4.9545874 59 -7.2827079 -4.5824029 60 NA -7.2827079 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -13.4118572 -15.6848500 [2,] -14.5207365 -13.4118572 [3,] -6.9286586 -14.5207365 [4,] -3.9929705 -6.9286586 [5,] -2.4610415 -3.9929705 [6,] 3.5590082 -2.4610415 [7,] 2.5737316 3.5590082 [8,] 1.3027671 2.5737316 [9,] -9.1893605 1.3027671 [10,] -5.9508357 -9.1893605 [11,] -6.0677932 -5.9508357 [12,] -3.2894174 -6.0677932 [13,] 0.9432209 -3.2894174 [14,] 2.5360153 0.9432209 [15,] 4.4102281 2.5360153 [16,] 8.9243912 4.4102281 [17,] 4.0737316 8.9243912 [18,] 7.1750011 4.0737316 [19,] -0.8227152 7.1750011 [20,] -2.1025094 -0.8227152 [21,] -12.0410838 -2.1025094 [22,] -4.8698712 -12.0410838 [23,] -8.3353534 -4.8698712 [24,] -6.0736797 -8.3353534 [25,] -1.2533251 -6.0736797 [26,] 1.2946962 -1.2533251 [27,] 2.5962707 1.2946962 [28,] 10.2754054 2.5962707 [29,] 10.9803842 10.2754054 [30,] 15.9729728 10.9803842 [31,] 19.9253061 15.9729728 [32,] 9.7922637 19.9253061 [33,] -7.8243320 9.7922637 [34,] 1.1133274 -7.8243320 [35,] -4.9241335 1.1133274 [36,] -1.2614457 -4.9241335 [37,] 2.9550508 -1.2614457 [38,] -2.1894101 2.9550508 [39,] 1.8991147 -2.1894101 [40,] 8.2672352 1.8991147 [41,] 2.0260226 8.2672352 [42,] 13.5029728 2.0260226 [43,] 11.4642423 13.5029728 [44,] 3.9347035 11.4642423 [45,] -5.6100696 3.9347035 [46,] -7.1239278 -5.6100696 [47,] -10.4136724 -7.1239278 [48,] -7.3747435 -10.4136724 [49,] -0.2530202 -7.3747435 [50,] -0.4851973 -0.2530202 [51,] 5.8726182 -0.4851973 [52,] 10.8297246 5.8726182 [53,] 7.4985616 10.8297246 [54,] 6.9240366 7.4985616 [55,] 2.0357672 6.9240366 [56,] -3.3830625 2.0357672 [57,] -4.9545874 -3.3830625 [58,] -4.5824029 -4.9545874 [59,] -7.2827079 -4.5824029 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -13.4118572 -15.6848500 2 -14.5207365 -13.4118572 3 -6.9286586 -14.5207365 4 -3.9929705 -6.9286586 5 -2.4610415 -3.9929705 6 3.5590082 -2.4610415 7 2.5737316 3.5590082 8 1.3027671 2.5737316 9 -9.1893605 1.3027671 10 -5.9508357 -9.1893605 11 -6.0677932 -5.9508357 12 -3.2894174 -6.0677932 13 0.9432209 -3.2894174 14 2.5360153 0.9432209 15 4.4102281 2.5360153 16 8.9243912 4.4102281 17 4.0737316 8.9243912 18 7.1750011 4.0737316 19 -0.8227152 7.1750011 20 -2.1025094 -0.8227152 21 -12.0410838 -2.1025094 22 -4.8698712 -12.0410838 23 -8.3353534 -4.8698712 24 -6.0736797 -8.3353534 25 -1.2533251 -6.0736797 26 1.2946962 -1.2533251 27 2.5962707 1.2946962 28 10.2754054 2.5962707 29 10.9803842 10.2754054 30 15.9729728 10.9803842 31 19.9253061 15.9729728 32 9.7922637 19.9253061 33 -7.8243320 9.7922637 34 1.1133274 -7.8243320 35 -4.9241335 1.1133274 36 -1.2614457 -4.9241335 37 2.9550508 -1.2614457 38 -2.1894101 2.9550508 39 1.8991147 -2.1894101 40 8.2672352 1.8991147 41 2.0260226 8.2672352 42 13.5029728 2.0260226 43 11.4642423 13.5029728 44 3.9347035 11.4642423 45 -5.6100696 3.9347035 46 -7.1239278 -5.6100696 47 -10.4136724 -7.1239278 48 -7.3747435 -10.4136724 49 -0.2530202 -7.3747435 50 -0.4851973 -0.2530202 51 5.8726182 -0.4851973 52 10.8297246 5.8726182 53 7.4985616 10.8297246 54 6.9240366 7.4985616 55 2.0357672 6.9240366 56 -3.3830625 2.0357672 57 -4.9545874 -3.3830625 58 -4.5824029 -4.9545874 59 -7.2827079 -4.5824029 > 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/7qbat1258761893.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/8vwuo1258761893.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/9yr0l1258761893.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/10dga81258761893.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/11pw381258761893.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/12f19t1258761893.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/13hrwv1258761893.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/14uzwy1258761893.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/15ojf81258761893.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/16z6q71258761893.tab") + } > > system("convert tmp/1gxwu1258761893.ps tmp/1gxwu1258761893.png") > system("convert tmp/20e2r1258761893.ps tmp/20e2r1258761893.png") > system("convert tmp/3kn7d1258761893.ps tmp/3kn7d1258761893.png") > system("convert tmp/4dvgv1258761893.ps tmp/4dvgv1258761893.png") > system("convert tmp/5fpyf1258761893.ps tmp/5fpyf1258761893.png") > system("convert tmp/6hf3b1258761893.ps tmp/6hf3b1258761893.png") > system("convert tmp/7qbat1258761893.ps tmp/7qbat1258761893.png") > system("convert tmp/8vwuo1258761893.ps tmp/8vwuo1258761893.png") > system("convert tmp/9yr0l1258761893.ps tmp/9yr0l1258761893.png") > system("convert tmp/10dga81258761893.ps tmp/10dga81258761893.png") > > > proc.time() user system elapsed 2.498 1.588 3.376