R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(521 + ,103 + ,2708 + ,553 + ,234 + ,349 + ,42 + ,1146 + ,836 + ,93 + ,341 + ,58 + ,783 + ,492 + ,110 + ,440 + ,46 + ,3314 + ,419 + ,437 + ,367 + ,64 + ,3096 + ,601 + ,367 + ,537 + ,55 + ,1847 + ,459 + ,192 + ,423 + ,46 + ,2001 + ,56 + ,176 + ,470 + ,98 + ,3428 + ,701 + ,273 + ,380 + ,126 + ,3363 + ,3567 + ,171 + ,453 + ,49 + ,1405 + ,321 + ,217 + ,452 + ,52 + ,7120 + ,730 + ,394 + ,429 + ,89 + ,1198 + ,1260 + ,249 + ,351 + ,70 + ,4474 + ,1078 + ,621 + ,462 + ,47 + ,1490 + ,363 + ,192 + ,492 + ,110 + ,4757 + ,1523 + ,295 + ,363 + ,48 + ,1238 + ,692 + ,157 + ,372 + ,63 + ,2703 + ,700 + ,136 + ,490 + ,88 + ,4057 + ,647 + ,346 + ,347 + ,28 + ,1143 + ,872 + ,104 + ,329 + ,32 + ,810 + ,508 + ,138 + ,442 + ,41 + ,5211 + ,464 + ,694 + ,337 + ,51 + ,4417 + ,637 + ,504 + ,485 + ,59 + ,2779 + ,542 + ,306 + ,402 + ,31 + ,2713 + ,97 + ,218 + ,446 + ,98 + ,5791 + ,751 + ,340 + ,383 + ,112 + ,5152 + ,3749 + ,241 + ,426 + ,34 + ,2041 + ,451 + ,367 + ,426 + ,50 + ,13207 + ,1176 + ,556 + ,407 + ,66 + ,1506 + ,1687 + ,309 + ,391 + ,65 + ,6619 + ,1278 + ,792 + ,418 + ,38 + ,2168 + ,378 + ,301 + ,465 + ,91 + ,7846 + ,1588 + ,468 + ,336 + ,37 + ,1495 + ,868 + ,197 + ,349 + ,51 + ,3659 + ,850 + ,194 + ,503 + ,118 + ,8476 + ,750 + ,468 + ,384 + ,30 + ,2162 + ,2474 + ,106 + ,334 + ,32 + ,1452 + ,492 + ,114 + ,463 + ,43 + ,8953 + ,733 + ,838 + ,399 + ,52 + ,8239 + ,652 + ,580 + ,523 + ,63 + ,8218 + ,582 + ,420 + ,395 + ,37 + ,6257 + ,95 + ,316 + ,489 + ,129 + ,12742 + ,1042 + ,463 + ,392 + ,141 + ,9946 + ,3673 + ,285 + ,443 + ,37 + ,3532 + ,540 + ,340 + ,463 + ,86 + ,23300 + ,885 + ,539 + ,434 + ,67 + ,4225 + ,1370 + ,346 + ,421 + ,66 + ,10343 + ,915 + ,870 + ,434 + ,43 + ,4339 + ,424 + ,291 + ,484 + ,195 + ,14733 + ,1314 + ,645 + ,367 + ,44 + ,2718 + ,1028 + ,194 + ,380 + ,44 + ,6129 + ,1008 + ,225) + ,dim=c(5 + ,51) + ,dimnames=list(c('Cons' + ,'Inc' + ,'Price' + ,'Rds' + ,'Elec') + ,1:51)) > y <- array(NA,dim=c(5,51),dimnames=list(c('Cons','Inc','Price','Rds','Elec'),1:51)) > 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 > 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 Cons Inc Price Rds Elec 1 521 103 2708 553 234 2 349 42 1146 836 93 3 341 58 783 492 110 4 440 46 3314 419 437 5 367 64 3096 601 367 6 537 55 1847 459 192 7 423 46 2001 56 176 8 470 98 3428 701 273 9 380 126 3363 3567 171 10 453 49 1405 321 217 11 452 52 7120 730 394 12 429 89 1198 1260 249 13 351 70 4474 1078 621 14 462 47 1490 363 192 15 492 110 4757 1523 295 16 363 48 1238 692 157 17 372 63 2703 700 136 18 490 88 4057 647 346 19 347 28 1143 872 104 20 329 32 810 508 138 21 442 41 5211 464 694 22 337 51 4417 637 504 23 485 59 2779 542 306 24 402 31 2713 97 218 25 446 98 5791 751 340 26 383 112 5152 3749 241 27 426 34 2041 451 367 28 426 50 13207 1176 556 29 407 66 1506 1687 309 30 391 65 6619 1278 792 31 418 38 2168 378 301 32 465 91 7846 1588 468 33 336 37 1495 868 197 34 349 51 3659 850 194 35 503 118 8476 750 468 36 384 30 2162 2474 106 37 334 32 1452 492 114 38 463 43 8953 733 838 39 399 52 8239 652 580 40 523 63 8218 582 420 41 395 37 6257 95 316 42 489 129 12742 1042 463 43 392 141 9946 3673 285 44 443 37 3532 540 340 45 463 86 23300 885 539 46 434 67 4225 1370 346 47 421 66 10343 915 870 48 434 43 4339 424 291 49 484 195 14733 1314 645 50 367 44 2718 1028 194 51 380 44 6129 1008 225 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Inc Price Rds Elec 372.191567 0.944504 0.001164 -0.031753 0.027931 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -82.355 -30.009 1.893 31.011 119.922 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 372.191567 17.755587 20.962 < 2e-16 *** Inc 0.944504 0.253301 3.729 0.000526 *** Price 0.001164 0.002224 0.523 0.603145 Rds -0.031753 0.009677 -3.281 0.001976 ** Elec 0.027931 0.044503 0.628 0.533363 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 46.41 on 46 degrees of freedom Multiple R-squared: 0.363, Adjusted R-squared: 0.3076 F-statistic: 6.554 on 4 and 46 DF, p-value: 0.0002923 > 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.9896614 0.02067724 0.01033862 [2,] 0.9777838 0.04443234 0.02221617 [3,] 0.9731463 0.05370738 0.02685369 [4,] 0.9526936 0.09461279 0.04730640 [5,] 0.9174272 0.16514560 0.08257280 [6,] 0.9297663 0.14046731 0.07023366 [7,] 0.9291386 0.14172279 0.07086139 [8,] 0.9140382 0.17192370 0.08596185 [9,] 0.8899709 0.22005827 0.11002913 [10,] 0.9060376 0.18792471 0.09396236 [11,] 0.8877176 0.22456481 0.11228240 [12,] 0.8433663 0.31326743 0.15663371 [13,] 0.8456659 0.30866821 0.15433410 [14,] 0.8178685 0.36426294 0.18213147 [15,] 0.9106492 0.17870166 0.08935083 [16,] 0.9435727 0.11285467 0.05642733 [17,] 0.9131910 0.17361799 0.08680900 [18,] 0.9009823 0.19803543 0.09901771 [19,] 0.8656932 0.26861353 0.13430677 [20,] 0.8413196 0.31736084 0.15868042 [21,] 0.7803249 0.43935014 0.21967507 [22,] 0.7284298 0.54314039 0.27157019 [23,] 0.7088431 0.58231386 0.29115693 [24,] 0.6364229 0.72715416 0.36357708 [25,] 0.5847277 0.83054455 0.41527228 [26,] 0.5782756 0.84344890 0.42172445 [27,] 0.6082167 0.78356665 0.39178332 [28,] 0.5841594 0.83168115 0.41584057 [29,] 0.6003824 0.79923524 0.39961762 [30,] 0.6762267 0.64754663 0.32377332 [31,] 0.6310831 0.73783381 0.36891691 [32,] 0.5695037 0.86099259 0.43049629 [33,] 0.8759091 0.24818174 0.12409087 [34,] 0.8539185 0.29216296 0.14608148 [35,] 0.7952486 0.40950272 0.20475136 [36,] 0.6765882 0.64682352 0.32341176 > postscript(file="/var/www/rcomp/tmp/1gmej1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/252mz1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/35mn61298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/4wqqk1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/55rkb1298120480.ps",horizontal=F,onefile=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 = 51 Frequency = 1 1 2 3 4 5 6 59.3947376 -40.2472154 -74.3344582 21.6009468 -60.4120565 119.9218643 7 8 9 10 11 12 1.8934622 15.8889846 -6.6281306 37.0234007 34.5780919 4.4066614 13 14 15 16 17 18 -75.6319210 49.8453244 50.4938939 -38.3813840 -44.4143604 40.8479521 19 20 21 22 23 24 -28.1847896 -62.0828010 20.3651254 -82.3551914 62.5099481 -5.6393068 25 26 27 28 29 30 -11.1464153 11.3355641 23.3886446 13.0159372 15.6543246 -31.8327674 31 32 33 34 35 36 10.9881865 35.0742942 -50.8197954 -54.0505817 20.2299546 56.5521846 37 38 39 40 41 42 -57.6681190 39.6381458 -27.3968263 88.4842756 -25.2340111 0.2842368 43 44 45 46 47 48 -16.2798252 39.3990263 -4.5047774 27.4443945 -20.8188144 21.4774993 49 50 51 -65.8180877 -22.6912125 -15.1642138 > postscript(file="/var/www/rcomp/tmp/65wrx1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 51 Frequency = 1 lag(myerror, k = 1) myerror 0 59.3947376 NA 1 -40.2472154 59.3947376 2 -74.3344582 -40.2472154 3 21.6009468 -74.3344582 4 -60.4120565 21.6009468 5 119.9218643 -60.4120565 6 1.8934622 119.9218643 7 15.8889846 1.8934622 8 -6.6281306 15.8889846 9 37.0234007 -6.6281306 10 34.5780919 37.0234007 11 4.4066614 34.5780919 12 -75.6319210 4.4066614 13 49.8453244 -75.6319210 14 50.4938939 49.8453244 15 -38.3813840 50.4938939 16 -44.4143604 -38.3813840 17 40.8479521 -44.4143604 18 -28.1847896 40.8479521 19 -62.0828010 -28.1847896 20 20.3651254 -62.0828010 21 -82.3551914 20.3651254 22 62.5099481 -82.3551914 23 -5.6393068 62.5099481 24 -11.1464153 -5.6393068 25 11.3355641 -11.1464153 26 23.3886446 11.3355641 27 13.0159372 23.3886446 28 15.6543246 13.0159372 29 -31.8327674 15.6543246 30 10.9881865 -31.8327674 31 35.0742942 10.9881865 32 -50.8197954 35.0742942 33 -54.0505817 -50.8197954 34 20.2299546 -54.0505817 35 56.5521846 20.2299546 36 -57.6681190 56.5521846 37 39.6381458 -57.6681190 38 -27.3968263 39.6381458 39 88.4842756 -27.3968263 40 -25.2340111 88.4842756 41 0.2842368 -25.2340111 42 -16.2798252 0.2842368 43 39.3990263 -16.2798252 44 -4.5047774 39.3990263 45 27.4443945 -4.5047774 46 -20.8188144 27.4443945 47 21.4774993 -20.8188144 48 -65.8180877 21.4774993 49 -22.6912125 -65.8180877 50 -15.1642138 -22.6912125 51 NA -15.1642138 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -40.2472154 59.3947376 [2,] -74.3344582 -40.2472154 [3,] 21.6009468 -74.3344582 [4,] -60.4120565 21.6009468 [5,] 119.9218643 -60.4120565 [6,] 1.8934622 119.9218643 [7,] 15.8889846 1.8934622 [8,] -6.6281306 15.8889846 [9,] 37.0234007 -6.6281306 [10,] 34.5780919 37.0234007 [11,] 4.4066614 34.5780919 [12,] -75.6319210 4.4066614 [13,] 49.8453244 -75.6319210 [14,] 50.4938939 49.8453244 [15,] -38.3813840 50.4938939 [16,] -44.4143604 -38.3813840 [17,] 40.8479521 -44.4143604 [18,] -28.1847896 40.8479521 [19,] -62.0828010 -28.1847896 [20,] 20.3651254 -62.0828010 [21,] -82.3551914 20.3651254 [22,] 62.5099481 -82.3551914 [23,] -5.6393068 62.5099481 [24,] -11.1464153 -5.6393068 [25,] 11.3355641 -11.1464153 [26,] 23.3886446 11.3355641 [27,] 13.0159372 23.3886446 [28,] 15.6543246 13.0159372 [29,] -31.8327674 15.6543246 [30,] 10.9881865 -31.8327674 [31,] 35.0742942 10.9881865 [32,] -50.8197954 35.0742942 [33,] -54.0505817 -50.8197954 [34,] 20.2299546 -54.0505817 [35,] 56.5521846 20.2299546 [36,] -57.6681190 56.5521846 [37,] 39.6381458 -57.6681190 [38,] -27.3968263 39.6381458 [39,] 88.4842756 -27.3968263 [40,] -25.2340111 88.4842756 [41,] 0.2842368 -25.2340111 [42,] -16.2798252 0.2842368 [43,] 39.3990263 -16.2798252 [44,] -4.5047774 39.3990263 [45,] 27.4443945 -4.5047774 [46,] -20.8188144 27.4443945 [47,] 21.4774993 -20.8188144 [48,] -65.8180877 21.4774993 [49,] -22.6912125 -65.8180877 [50,] -15.1642138 -22.6912125 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -40.2472154 59.3947376 2 -74.3344582 -40.2472154 3 21.6009468 -74.3344582 4 -60.4120565 21.6009468 5 119.9218643 -60.4120565 6 1.8934622 119.9218643 7 15.8889846 1.8934622 8 -6.6281306 15.8889846 9 37.0234007 -6.6281306 10 34.5780919 37.0234007 11 4.4066614 34.5780919 12 -75.6319210 4.4066614 13 49.8453244 -75.6319210 14 50.4938939 49.8453244 15 -38.3813840 50.4938939 16 -44.4143604 -38.3813840 17 40.8479521 -44.4143604 18 -28.1847896 40.8479521 19 -62.0828010 -28.1847896 20 20.3651254 -62.0828010 21 -82.3551914 20.3651254 22 62.5099481 -82.3551914 23 -5.6393068 62.5099481 24 -11.1464153 -5.6393068 25 11.3355641 -11.1464153 26 23.3886446 11.3355641 27 13.0159372 23.3886446 28 15.6543246 13.0159372 29 -31.8327674 15.6543246 30 10.9881865 -31.8327674 31 35.0742942 10.9881865 32 -50.8197954 35.0742942 33 -54.0505817 -50.8197954 34 20.2299546 -54.0505817 35 56.5521846 20.2299546 36 -57.6681190 56.5521846 37 39.6381458 -57.6681190 38 -27.3968263 39.6381458 39 88.4842756 -27.3968263 40 -25.2340111 88.4842756 41 0.2842368 -25.2340111 42 -16.2798252 0.2842368 43 39.3990263 -16.2798252 44 -4.5047774 39.3990263 45 27.4443945 -4.5047774 46 -20.8188144 27.4443945 47 21.4774993 -20.8188144 48 -65.8180877 21.4774993 49 -22.6912125 -65.8180877 50 -15.1642138 -22.6912125 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/7dc181298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/8d0yo1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/9kdsn1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/10bfdp1298120480.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/11vjpz1298120480.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/121vuo1298120480.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/13eonf1298120480.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/148krg1298120480.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15vnq61298120480.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/16s79z1298120480.tab") + } > > try(system("convert tmp/1gmej1298120480.ps tmp/1gmej1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/252mz1298120480.ps tmp/252mz1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/35mn61298120480.ps tmp/35mn61298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/4wqqk1298120480.ps tmp/4wqqk1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/55rkb1298120480.ps tmp/55rkb1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/65wrx1298120480.ps tmp/65wrx1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/7dc181298120480.ps tmp/7dc181298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/8d0yo1298120480.ps tmp/8d0yo1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/9kdsn1298120480.ps tmp/9kdsn1298120480.png",intern=TRUE)) character(0) > try(system("convert tmp/10bfdp1298120480.ps tmp/10bfdp1298120480.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.244 0.852 7.051