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(90269 + ,561000 + ,90398 + ,90390 + ,555000 + ,90269 + ,88219 + ,544000 + ,90390 + ,87032 + ,537000 + ,88219 + ,87175 + ,543000 + ,87032 + ,92603 + ,594000 + ,87175 + ,93571 + ,611000 + ,92603 + ,94118 + ,613000 + ,93571 + ,92159 + ,611000 + ,94118 + ,89528 + ,594000 + ,92159 + ,89955 + ,595000 + ,89528 + ,89587 + ,591000 + ,89955 + ,89488 + ,589000 + ,89587 + ,88521 + ,584000 + ,89488 + ,86587 + ,573000 + ,88521 + ,85159 + ,567000 + ,86587 + ,84915 + ,569000 + ,85159 + ,91378 + ,621000 + ,84915 + ,92729 + ,629000 + ,91378 + ,92194 + ,628000 + ,92729 + ,89664 + ,612000 + ,92194 + ,86285 + ,595000 + ,89664 + ,86858 + ,597000 + ,86285 + ,87184 + ,593000 + ,86858 + ,86629 + ,590000 + ,87184 + ,85220 + ,580000 + ,86629 + ,84816 + ,574000 + ,85220 + ,84831 + ,573000 + ,84816 + ,84957 + ,573000 + ,84831 + ,90951 + ,620000 + ,84957 + ,92134 + ,626000 + ,90951 + ,91790 + ,620000 + ,92134 + ,86625 + ,588000 + ,91790 + ,83324 + ,566000 + ,86625 + ,82719 + ,557000 + ,83324 + ,83614 + ,561000 + ,82719 + ,81640 + ,549000 + ,83614 + ,78665 + ,532000 + ,81640 + ,77828 + ,526000 + ,78665 + ,75728 + ,511000 + ,77828 + ,72187 + ,499000 + ,75728 + ,79357 + ,555000 + ,72187 + ,81329 + ,565000 + ,79357 + ,77304 + ,542000 + ,81329 + ,75576 + ,527000 + ,77304 + ,72932 + ,510000 + ,75576 + ,74291 + ,514000 + ,72932 + ,74988 + ,517000 + ,74291 + ,73302 + ,508000 + ,74988 + ,70483 + ,493000 + ,73302 + ,69848 + ,490000 + ,70483 + ,66466 + ,469000 + ,69848 + ,67610 + ,478000 + ,66466 + ,75091 + ,528000 + ,67610 + ,76207 + ,534000 + ,75091 + ,73454 + ,518000 + ,76207 + ,72008 + ,506000 + ,73454 + ,71362 + ,502000 + ,72008 + ,74250 + ,516000 + ,71362) + ,dim=c(3 + ,59) + ,dimnames=list(c('Y' + ,'X' + ,'Y1') + ,1:59)) > y <- array(NA,dim=c(3,59),dimnames=list(c('Y','X','Y1'),1:59)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = '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 Y1 t 1 90269 561000 90398 1 2 90390 555000 90269 2 3 88219 544000 90390 3 4 87032 537000 88219 4 5 87175 543000 87032 5 6 92603 594000 87175 6 7 93571 611000 92603 7 8 94118 613000 93571 8 9 92159 611000 94118 9 10 89528 594000 92159 10 11 89955 595000 89528 11 12 89587 591000 89955 12 13 89488 589000 89587 13 14 88521 584000 89488 14 15 86587 573000 88521 15 16 85159 567000 86587 16 17 84915 569000 85159 17 18 91378 621000 84915 18 19 92729 629000 91378 19 20 92194 628000 92729 20 21 89664 612000 92194 21 22 86285 595000 89664 22 23 86858 597000 86285 23 24 87184 593000 86858 24 25 86629 590000 87184 25 26 85220 580000 86629 26 27 84816 574000 85220 27 28 84831 573000 84816 28 29 84957 573000 84831 29 30 90951 620000 84957 30 31 92134 626000 90951 31 32 91790 620000 92134 32 33 86625 588000 91790 33 34 83324 566000 86625 34 35 82719 557000 83324 35 36 83614 561000 82719 36 37 81640 549000 83614 37 38 78665 532000 81640 38 39 77828 526000 78665 39 40 75728 511000 77828 40 41 72187 499000 75728 41 42 79357 555000 72187 42 43 81329 565000 79357 43 44 77304 542000 81329 44 45 75576 527000 77304 45 46 72932 510000 75576 46 47 74291 514000 72932 47 48 74988 517000 74291 48 49 73302 508000 74988 49 50 70483 493000 73302 50 51 69848 490000 70483 51 52 66466 469000 69848 52 53 67610 478000 66466 53 54 75091 528000 67610 54 55 76207 534000 75091 55 56 73454 518000 76207 56 57 72008 506000 73454 57 58 71362 502000 72008 58 59 74250 516000 71362 59 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X Y1 t 20602.0407 0.1056 0.1025 -175.1823 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2467.70 -867.71 46.49 758.60 2294.35 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.060e+04 3.776e+03 5.455 1.20e-06 *** X 1.056e-01 7.142e-03 14.781 < 2e-16 *** Y1 1.025e-01 5.890e-02 1.740 0.0874 . t -1.752e+02 1.838e+01 -9.529 3.05e-13 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1135 on 55 degrees of freedom Multiple R-squared: 0.9794, Adjusted R-squared: 0.9783 F-statistic: 872 on 3 and 55 DF, p-value: < 2.2e-16 > 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.22725299 0.454505977 0.7727470116 [2,] 0.16801071 0.336021411 0.8319892946 [3,] 0.21821521 0.436430423 0.7817847887 [4,] 0.22135744 0.442714880 0.7786425601 [5,] 0.13788787 0.275775732 0.8621121338 [6,] 0.11919590 0.238391793 0.8808041036 [7,] 0.15454364 0.309087284 0.8454563581 [8,] 0.14200191 0.284003823 0.8579980885 [9,] 0.09963156 0.199263127 0.9003684367 [10,] 0.07907636 0.158152720 0.9209236402 [11,] 0.05965025 0.119300499 0.9403497507 [12,] 0.05137919 0.102758389 0.9486208053 [13,] 0.21134531 0.422690628 0.7886546862 [14,] 0.29378891 0.587577826 0.7062110872 [15,] 0.29098069 0.581961381 0.7090193096 [16,] 0.41174087 0.823481731 0.5882591343 [17,] 0.45106552 0.902131039 0.5489344806 [18,] 0.54508823 0.909823535 0.4549117675 [19,] 0.62354588 0.752908234 0.3764541168 [20,] 0.66850188 0.662996236 0.3314981180 [21,] 0.70437587 0.591248262 0.2956241308 [22,] 0.73920245 0.521595102 0.2607975511 [23,] 0.77491381 0.450172380 0.2250861899 [24,] 0.91696000 0.166079997 0.0830399985 [25,] 0.97821967 0.043560668 0.0217803342 [26,] 0.98872240 0.022555203 0.0112776017 [27,] 0.98538759 0.029224816 0.0146124082 [28,] 0.97927900 0.041441993 0.0207209967 [29,] 0.97222482 0.055550361 0.0277751804 [30,] 0.97946023 0.041079548 0.0205397739 [31,] 0.98002970 0.039940600 0.0199703002 [32,] 0.97764922 0.044701568 0.0223507841 [33,] 0.98768754 0.024624911 0.0123124553 [34,] 0.99928171 0.001436585 0.0007182924 [35,] 0.99925004 0.001499927 0.0007499633 [36,] 0.99879250 0.002415006 0.0012075029 [37,] 0.99727668 0.005446633 0.0027233166 [38,] 0.99812965 0.003740694 0.0018703469 [39,] 0.99713065 0.005738705 0.0028693523 [40,] 0.99681910 0.006361807 0.0031809035 [41,] 0.99231545 0.015369102 0.0076845509 [42,] 0.99120550 0.017589000 0.0087944998 [43,] 0.99226668 0.015466641 0.0077333205 [44,] 0.98848824 0.023023511 0.0115117556 [45,] 0.98367857 0.032642860 0.0163214300 [46,] 0.97279797 0.054404062 0.0272020310 > postscript(file="/var/www/html/rcomp/tmp/1xim81258573753.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/2hoqy1258573753.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/31efw1258573753.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/48kzt1258573753.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/5iez41258573753.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 = 59 Frequency = 1 1 2 3 4 5 6 1351.53297 2294.34673 1447.37134 1397.08607 1203.54508 1408.10711 7 8 9 10 11 12 200.19109 612.00437 -1016.75261 -1477.09220 -710.76402 -525.08363 13 14 15 16 17 18 -200.04052 -453.87004 -952.31044 -1373.45933 -1507.02307 -333.35608 19 20 21 22 23 24 -314.26310 -707.00902 -1317.89607 -2467.70031 -1584.25968 -719.54631 25 26 27 28 29 30 -816.07989 -937.32383 -388.29245 -51.12670 248.51792 1443.09411 31 32 33 34 35 36 1553.40176 1896.71746 320.33603 46.49487 905.18587 1615.11759 37 38 39 40 41 42 991.36441 188.56252 465.13046 209.63470 -1674.08975 122.29369 43 44 45 46 47 48 478.77371 -1145.14034 -701.82221 -1198.84248 184.11480 600.27734 49 50 51 52 53 54 -31.88169 -919.34326 -773.47105 -1698.26743 -982.49428 1278.01932 55 56 57 58 59 1168.88900 165.75171 443.96875 543.65742 2195.11361 > postscript(file="/var/www/html/rcomp/tmp/68vgs1258573753.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 = 59 Frequency = 1 lag(myerror, k = 1) myerror 0 1351.53297 NA 1 2294.34673 1351.53297 2 1447.37134 2294.34673 3 1397.08607 1447.37134 4 1203.54508 1397.08607 5 1408.10711 1203.54508 6 200.19109 1408.10711 7 612.00437 200.19109 8 -1016.75261 612.00437 9 -1477.09220 -1016.75261 10 -710.76402 -1477.09220 11 -525.08363 -710.76402 12 -200.04052 -525.08363 13 -453.87004 -200.04052 14 -952.31044 -453.87004 15 -1373.45933 -952.31044 16 -1507.02307 -1373.45933 17 -333.35608 -1507.02307 18 -314.26310 -333.35608 19 -707.00902 -314.26310 20 -1317.89607 -707.00902 21 -2467.70031 -1317.89607 22 -1584.25968 -2467.70031 23 -719.54631 -1584.25968 24 -816.07989 -719.54631 25 -937.32383 -816.07989 26 -388.29245 -937.32383 27 -51.12670 -388.29245 28 248.51792 -51.12670 29 1443.09411 248.51792 30 1553.40176 1443.09411 31 1896.71746 1553.40176 32 320.33603 1896.71746 33 46.49487 320.33603 34 905.18587 46.49487 35 1615.11759 905.18587 36 991.36441 1615.11759 37 188.56252 991.36441 38 465.13046 188.56252 39 209.63470 465.13046 40 -1674.08975 209.63470 41 122.29369 -1674.08975 42 478.77371 122.29369 43 -1145.14034 478.77371 44 -701.82221 -1145.14034 45 -1198.84248 -701.82221 46 184.11480 -1198.84248 47 600.27734 184.11480 48 -31.88169 600.27734 49 -919.34326 -31.88169 50 -773.47105 -919.34326 51 -1698.26743 -773.47105 52 -982.49428 -1698.26743 53 1278.01932 -982.49428 54 1168.88900 1278.01932 55 165.75171 1168.88900 56 443.96875 165.75171 57 543.65742 443.96875 58 2195.11361 543.65742 59 NA 2195.11361 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2294.34673 1351.53297 [2,] 1447.37134 2294.34673 [3,] 1397.08607 1447.37134 [4,] 1203.54508 1397.08607 [5,] 1408.10711 1203.54508 [6,] 200.19109 1408.10711 [7,] 612.00437 200.19109 [8,] -1016.75261 612.00437 [9,] -1477.09220 -1016.75261 [10,] -710.76402 -1477.09220 [11,] -525.08363 -710.76402 [12,] -200.04052 -525.08363 [13,] -453.87004 -200.04052 [14,] -952.31044 -453.87004 [15,] -1373.45933 -952.31044 [16,] -1507.02307 -1373.45933 [17,] -333.35608 -1507.02307 [18,] -314.26310 -333.35608 [19,] -707.00902 -314.26310 [20,] -1317.89607 -707.00902 [21,] -2467.70031 -1317.89607 [22,] -1584.25968 -2467.70031 [23,] -719.54631 -1584.25968 [24,] -816.07989 -719.54631 [25,] -937.32383 -816.07989 [26,] -388.29245 -937.32383 [27,] -51.12670 -388.29245 [28,] 248.51792 -51.12670 [29,] 1443.09411 248.51792 [30,] 1553.40176 1443.09411 [31,] 1896.71746 1553.40176 [32,] 320.33603 1896.71746 [33,] 46.49487 320.33603 [34,] 905.18587 46.49487 [35,] 1615.11759 905.18587 [36,] 991.36441 1615.11759 [37,] 188.56252 991.36441 [38,] 465.13046 188.56252 [39,] 209.63470 465.13046 [40,] -1674.08975 209.63470 [41,] 122.29369 -1674.08975 [42,] 478.77371 122.29369 [43,] -1145.14034 478.77371 [44,] -701.82221 -1145.14034 [45,] -1198.84248 -701.82221 [46,] 184.11480 -1198.84248 [47,] 600.27734 184.11480 [48,] -31.88169 600.27734 [49,] -919.34326 -31.88169 [50,] -773.47105 -919.34326 [51,] -1698.26743 -773.47105 [52,] -982.49428 -1698.26743 [53,] 1278.01932 -982.49428 [54,] 1168.88900 1278.01932 [55,] 165.75171 1168.88900 [56,] 443.96875 165.75171 [57,] 543.65742 443.96875 [58,] 2195.11361 543.65742 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2294.34673 1351.53297 2 1447.37134 2294.34673 3 1397.08607 1447.37134 4 1203.54508 1397.08607 5 1408.10711 1203.54508 6 200.19109 1408.10711 7 612.00437 200.19109 8 -1016.75261 612.00437 9 -1477.09220 -1016.75261 10 -710.76402 -1477.09220 11 -525.08363 -710.76402 12 -200.04052 -525.08363 13 -453.87004 -200.04052 14 -952.31044 -453.87004 15 -1373.45933 -952.31044 16 -1507.02307 -1373.45933 17 -333.35608 -1507.02307 18 -314.26310 -333.35608 19 -707.00902 -314.26310 20 -1317.89607 -707.00902 21 -2467.70031 -1317.89607 22 -1584.25968 -2467.70031 23 -719.54631 -1584.25968 24 -816.07989 -719.54631 25 -937.32383 -816.07989 26 -388.29245 -937.32383 27 -51.12670 -388.29245 28 248.51792 -51.12670 29 1443.09411 248.51792 30 1553.40176 1443.09411 31 1896.71746 1553.40176 32 320.33603 1896.71746 33 46.49487 320.33603 34 905.18587 46.49487 35 1615.11759 905.18587 36 991.36441 1615.11759 37 188.56252 991.36441 38 465.13046 188.56252 39 209.63470 465.13046 40 -1674.08975 209.63470 41 122.29369 -1674.08975 42 478.77371 122.29369 43 -1145.14034 478.77371 44 -701.82221 -1145.14034 45 -1198.84248 -701.82221 46 184.11480 -1198.84248 47 600.27734 184.11480 48 -31.88169 600.27734 49 -919.34326 -31.88169 50 -773.47105 -919.34326 51 -1698.26743 -773.47105 52 -982.49428 -1698.26743 53 1278.01932 -982.49428 54 1168.88900 1278.01932 55 165.75171 1168.88900 56 443.96875 165.75171 57 543.65742 443.96875 58 2195.11361 543.65742 > 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/7m6zh1258573753.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/8w1mm1258573753.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/9wyrq1258573753.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/1053w71258573753.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/11hyyi1258573753.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/1289r01258573753.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/13a4ey1258573753.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/14aonh1258573753.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/15q67t1258573753.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/1626zj1258573753.tab") + } > > system("convert tmp/1xim81258573753.ps tmp/1xim81258573753.png") > system("convert tmp/2hoqy1258573753.ps tmp/2hoqy1258573753.png") > system("convert tmp/31efw1258573753.ps tmp/31efw1258573753.png") > system("convert tmp/48kzt1258573753.ps tmp/48kzt1258573753.png") > system("convert tmp/5iez41258573753.ps tmp/5iez41258573753.png") > system("convert tmp/68vgs1258573753.ps tmp/68vgs1258573753.png") > system("convert tmp/7m6zh1258573753.ps tmp/7m6zh1258573753.png") > system("convert tmp/8w1mm1258573753.ps tmp/8w1mm1258573753.png") > system("convert tmp/9wyrq1258573753.ps tmp/9wyrq1258573753.png") > system("convert tmp/1053w71258573753.ps tmp/1053w71258573753.png") > > > proc.time() user system elapsed 2.401 1.550 2.798