R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(87.0,0,96.3,0,107.1,0,115.2,0,106.1,0,89.5,0,91.3,0,97.6,0,100.7,0,104.6,0,94.7,0,101.8,0,102.5,0,105.3,0,110.3,1,109.8,1,117.3,1,118.8,1,131.3,1,125.9,1,133.1,1,147.0,1,145.8,1,164.4,1,149.8,1,137.7,1,151.7,1,156.8,1,180.0,1,180.4,1,170.4,1,191.6,1,199.5,1,218.2,1,217.5,1,205.0,1,194.0,1,199.3,1,219.3,1,211.1,1,215.2,1,240.2,1,242.2,1,240.7,1,255.4,1,253.0,1,218.2,1,203.7,1,205.6,1,215.6,1,188.5,1,202.9,1,214.0,1,230.3,1,230.0,1,241.0,1,259.6,1,247.8,1,270.3,1,289.7,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 = 'Linear Trend' > par2 = 'Include Monthly 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) > 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 87.0 0 1 0 0 0 0 0 0 0 0 0 0 1 2 96.3 0 0 1 0 0 0 0 0 0 0 0 0 2 3 107.1 0 0 0 1 0 0 0 0 0 0 0 0 3 4 115.2 0 0 0 0 1 0 0 0 0 0 0 0 4 5 106.1 0 0 0 0 0 1 0 0 0 0 0 0 5 6 89.5 0 0 0 0 0 0 1 0 0 0 0 0 6 7 91.3 0 0 0 0 0 0 0 1 0 0 0 0 7 8 97.6 0 0 0 0 0 0 0 0 1 0 0 0 8 9 100.7 0 0 0 0 0 0 0 0 0 1 0 0 9 10 104.6 0 0 0 0 0 0 0 0 0 0 1 0 10 11 94.7 0 0 0 0 0 0 0 0 0 0 0 1 11 12 101.8 0 0 0 0 0 0 0 0 0 0 0 0 12 13 102.5 0 1 0 0 0 0 0 0 0 0 0 0 13 14 105.3 0 0 1 0 0 0 0 0 0 0 0 0 14 15 110.3 1 0 0 1 0 0 0 0 0 0 0 0 15 16 109.8 1 0 0 0 1 0 0 0 0 0 0 0 16 17 117.3 1 0 0 0 0 1 0 0 0 0 0 0 17 18 118.8 1 0 0 0 0 0 1 0 0 0 0 0 18 19 131.3 1 0 0 0 0 0 0 1 0 0 0 0 19 20 125.9 1 0 0 0 0 0 0 0 1 0 0 0 20 21 133.1 1 0 0 0 0 0 0 0 0 1 0 0 21 22 147.0 1 0 0 0 0 0 0 0 0 0 1 0 22 23 145.8 1 0 0 0 0 0 0 0 0 0 0 1 23 24 164.4 1 0 0 0 0 0 0 0 0 0 0 0 24 25 149.8 1 1 0 0 0 0 0 0 0 0 0 0 25 26 137.7 1 0 1 0 0 0 0 0 0 0 0 0 26 27 151.7 1 0 0 1 0 0 0 0 0 0 0 0 27 28 156.8 1 0 0 0 1 0 0 0 0 0 0 0 28 29 180.0 1 0 0 0 0 1 0 0 0 0 0 0 29 30 180.4 1 0 0 0 0 0 1 0 0 0 0 0 30 31 170.4 1 0 0 0 0 0 0 1 0 0 0 0 31 32 191.6 1 0 0 0 0 0 0 0 1 0 0 0 32 33 199.5 1 0 0 0 0 0 0 0 0 1 0 0 33 34 218.2 1 0 0 0 0 0 0 0 0 0 1 0 34 35 217.5 1 0 0 0 0 0 0 0 0 0 0 1 35 36 205.0 1 0 0 0 0 0 0 0 0 0 0 0 36 37 194.0 1 1 0 0 0 0 0 0 0 0 0 0 37 38 199.3 1 0 1 0 0 0 0 0 0 0 0 0 38 39 219.3 1 0 0 1 0 0 0 0 0 0 0 0 39 40 211.1 1 0 0 0 1 0 0 0 0 0 0 0 40 41 215.2 1 0 0 0 0 1 0 0 0 0 0 0 41 42 240.2 1 0 0 0 0 0 1 0 0 0 0 0 42 43 242.2 1 0 0 0 0 0 0 1 0 0 0 0 43 44 240.7 1 0 0 0 0 0 0 0 1 0 0 0 44 45 255.4 1 0 0 0 0 0 0 0 0 1 0 0 45 46 253.0 1 0 0 0 0 0 0 0 0 0 1 0 46 47 218.2 1 0 0 0 0 0 0 0 0 0 0 1 47 48 203.7 1 0 0 0 0 0 0 0 0 0 0 0 48 49 205.6 1 1 0 0 0 0 0 0 0 0 0 0 49 50 215.6 1 0 1 0 0 0 0 0 0 0 0 0 50 51 188.5 1 0 0 1 0 0 0 0 0 0 0 0 51 52 202.9 1 0 0 0 1 0 0 0 0 0 0 0 52 53 214.0 1 0 0 0 0 1 0 0 0 0 0 0 53 54 230.3 1 0 0 0 0 0 1 0 0 0 0 0 54 55 230.0 1 0 0 0 0 0 0 1 0 0 0 0 55 56 241.0 1 0 0 0 0 0 0 0 1 0 0 0 56 57 259.6 1 0 0 0 0 0 0 0 0 1 0 0 57 58 247.8 1 0 0 0 0 0 0 0 0 0 1 0 58 59 270.3 1 0 0 0 0 0 0 0 0 0 0 1 59 60 289.7 1 0 0 0 0 0 0 0 0 0 0 0 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 82.657 3.817 -11.618 -11.536 -10.738 -9.936 M5 M6 M7 M8 M9 M10 -5.554 -3.212 -4.990 -1.648 5.674 7.156 M11 t -0.642 2.978 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -39.116 -14.399 -5.605 12.783 32.660 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 82.6575 10.6788 7.740 7.16e-10 *** X 3.8168 9.2481 0.413 0.682 M1 -11.6183 12.8813 -0.902 0.372 M2 -11.5363 12.8633 -0.897 0.374 M3 -10.7377 12.9322 -0.830 0.411 M4 -9.9358 12.8983 -0.770 0.445 M5 -5.5538 12.8684 -0.432 0.668 M6 -3.2118 12.8423 -0.250 0.804 M7 -4.9898 12.8203 -0.389 0.699 M8 -1.6479 12.8022 -0.129 0.898 M9 5.6741 12.7881 0.444 0.659 M10 7.1561 12.7780 0.560 0.578 M11 -0.6420 12.7720 -0.050 0.960 t 2.9780 0.2269 13.126 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 20.19 on 46 degrees of freedom Multiple R-squared: 0.9037, Adjusted R-squared: 0.8765 F-statistic: 33.2 on 13 and 46 DF, p-value: < 2.2e-16 > postscript(file="/var/www/html/rcomp/tmp/1a5xl1229456771.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/2jebu1229456771.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/3zobt1229456771.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/44xc21229456771.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/5yhks1229456771.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > 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 12.9827972 19.2227972 26.2461538 30.5661538 14.1061538 -7.8138462 7 8 9 10 11 12 -7.2138462 -7.2338462 -14.4338462 -14.9938462 -20.0738462 -16.5938462 13 14 15 16 17 18 -7.2535664 -7.5135664 -10.1069930 -14.3869930 -14.2469930 -18.0669930 19 20 21 22 23 24 -6.7669930 -18.4869930 -21.5869930 -12.1469930 -8.5269930 6.4530070 25 26 27 28 29 30 0.4932867 -14.6667133 -4.4433566 -3.1233566 12.7166434 7.7966434 31 32 33 34 35 36 -3.4033566 11.4766434 9.0766434 23.3166434 27.4366434 11.3166434 37 38 39 40 41 42 8.9569231 11.1969231 27.4202797 15.4402797 12.1802797 31.8602797 43 44 45 46 47 48 32.6602797 24.8402797 29.2402797 22.3802797 -7.5997203 -25.7197203 49 50 51 52 53 54 -15.1794406 -8.2394406 -39.1160839 -28.4960839 -24.7560839 -13.7760839 55 56 57 58 59 60 -15.2760839 -10.5960839 -2.2960839 -18.5560839 8.7639161 24.5439161 > postscript(file="/var/www/html/rcomp/tmp/6p92j1229456771.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 12.9827972 NA 1 19.2227972 12.9827972 2 26.2461538 19.2227972 3 30.5661538 26.2461538 4 14.1061538 30.5661538 5 -7.8138462 14.1061538 6 -7.2138462 -7.8138462 7 -7.2338462 -7.2138462 8 -14.4338462 -7.2338462 9 -14.9938462 -14.4338462 10 -20.0738462 -14.9938462 11 -16.5938462 -20.0738462 12 -7.2535664 -16.5938462 13 -7.5135664 -7.2535664 14 -10.1069930 -7.5135664 15 -14.3869930 -10.1069930 16 -14.2469930 -14.3869930 17 -18.0669930 -14.2469930 18 -6.7669930 -18.0669930 19 -18.4869930 -6.7669930 20 -21.5869930 -18.4869930 21 -12.1469930 -21.5869930 22 -8.5269930 -12.1469930 23 6.4530070 -8.5269930 24 0.4932867 6.4530070 25 -14.6667133 0.4932867 26 -4.4433566 -14.6667133 27 -3.1233566 -4.4433566 28 12.7166434 -3.1233566 29 7.7966434 12.7166434 30 -3.4033566 7.7966434 31 11.4766434 -3.4033566 32 9.0766434 11.4766434 33 23.3166434 9.0766434 34 27.4366434 23.3166434 35 11.3166434 27.4366434 36 8.9569231 11.3166434 37 11.1969231 8.9569231 38 27.4202797 11.1969231 39 15.4402797 27.4202797 40 12.1802797 15.4402797 41 31.8602797 12.1802797 42 32.6602797 31.8602797 43 24.8402797 32.6602797 44 29.2402797 24.8402797 45 22.3802797 29.2402797 46 -7.5997203 22.3802797 47 -25.7197203 -7.5997203 48 -15.1794406 -25.7197203 49 -8.2394406 -15.1794406 50 -39.1160839 -8.2394406 51 -28.4960839 -39.1160839 52 -24.7560839 -28.4960839 53 -13.7760839 -24.7560839 54 -15.2760839 -13.7760839 55 -10.5960839 -15.2760839 56 -2.2960839 -10.5960839 57 -18.5560839 -2.2960839 58 8.7639161 -18.5560839 59 24.5439161 8.7639161 60 NA 24.5439161 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 19.2227972 12.9827972 [2,] 26.2461538 19.2227972 [3,] 30.5661538 26.2461538 [4,] 14.1061538 30.5661538 [5,] -7.8138462 14.1061538 [6,] -7.2138462 -7.8138462 [7,] -7.2338462 -7.2138462 [8,] -14.4338462 -7.2338462 [9,] -14.9938462 -14.4338462 [10,] -20.0738462 -14.9938462 [11,] -16.5938462 -20.0738462 [12,] -7.2535664 -16.5938462 [13,] -7.5135664 -7.2535664 [14,] -10.1069930 -7.5135664 [15,] -14.3869930 -10.1069930 [16,] -14.2469930 -14.3869930 [17,] -18.0669930 -14.2469930 [18,] -6.7669930 -18.0669930 [19,] -18.4869930 -6.7669930 [20,] -21.5869930 -18.4869930 [21,] -12.1469930 -21.5869930 [22,] -8.5269930 -12.1469930 [23,] 6.4530070 -8.5269930 [24,] 0.4932867 6.4530070 [25,] -14.6667133 0.4932867 [26,] -4.4433566 -14.6667133 [27,] -3.1233566 -4.4433566 [28,] 12.7166434 -3.1233566 [29,] 7.7966434 12.7166434 [30,] -3.4033566 7.7966434 [31,] 11.4766434 -3.4033566 [32,] 9.0766434 11.4766434 [33,] 23.3166434 9.0766434 [34,] 27.4366434 23.3166434 [35,] 11.3166434 27.4366434 [36,] 8.9569231 11.3166434 [37,] 11.1969231 8.9569231 [38,] 27.4202797 11.1969231 [39,] 15.4402797 27.4202797 [40,] 12.1802797 15.4402797 [41,] 31.8602797 12.1802797 [42,] 32.6602797 31.8602797 [43,] 24.8402797 32.6602797 [44,] 29.2402797 24.8402797 [45,] 22.3802797 29.2402797 [46,] -7.5997203 22.3802797 [47,] -25.7197203 -7.5997203 [48,] -15.1794406 -25.7197203 [49,] -8.2394406 -15.1794406 [50,] -39.1160839 -8.2394406 [51,] -28.4960839 -39.1160839 [52,] -24.7560839 -28.4960839 [53,] -13.7760839 -24.7560839 [54,] -15.2760839 -13.7760839 [55,] -10.5960839 -15.2760839 [56,] -2.2960839 -10.5960839 [57,] -18.5560839 -2.2960839 [58,] 8.7639161 -18.5560839 [59,] 24.5439161 8.7639161 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 19.2227972 12.9827972 2 26.2461538 19.2227972 3 30.5661538 26.2461538 4 14.1061538 30.5661538 5 -7.8138462 14.1061538 6 -7.2138462 -7.8138462 7 -7.2338462 -7.2138462 8 -14.4338462 -7.2338462 9 -14.9938462 -14.4338462 10 -20.0738462 -14.9938462 11 -16.5938462 -20.0738462 12 -7.2535664 -16.5938462 13 -7.5135664 -7.2535664 14 -10.1069930 -7.5135664 15 -14.3869930 -10.1069930 16 -14.2469930 -14.3869930 17 -18.0669930 -14.2469930 18 -6.7669930 -18.0669930 19 -18.4869930 -6.7669930 20 -21.5869930 -18.4869930 21 -12.1469930 -21.5869930 22 -8.5269930 -12.1469930 23 6.4530070 -8.5269930 24 0.4932867 6.4530070 25 -14.6667133 0.4932867 26 -4.4433566 -14.6667133 27 -3.1233566 -4.4433566 28 12.7166434 -3.1233566 29 7.7966434 12.7166434 30 -3.4033566 7.7966434 31 11.4766434 -3.4033566 32 9.0766434 11.4766434 33 23.3166434 9.0766434 34 27.4366434 23.3166434 35 11.3166434 27.4366434 36 8.9569231 11.3166434 37 11.1969231 8.9569231 38 27.4202797 11.1969231 39 15.4402797 27.4202797 40 12.1802797 15.4402797 41 31.8602797 12.1802797 42 32.6602797 31.8602797 43 24.8402797 32.6602797 44 29.2402797 24.8402797 45 22.3802797 29.2402797 46 -7.5997203 22.3802797 47 -25.7197203 -7.5997203 48 -15.1794406 -25.7197203 49 -8.2394406 -15.1794406 50 -39.1160839 -8.2394406 51 -28.4960839 -39.1160839 52 -24.7560839 -28.4960839 53 -13.7760839 -24.7560839 54 -15.2760839 -13.7760839 55 -10.5960839 -15.2760839 56 -2.2960839 -10.5960839 57 -18.5560839 -2.2960839 58 8.7639161 -18.5560839 59 24.5439161 8.7639161 > 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/7k38x1229456771.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/8cgfa1229456771.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/911q31229456771.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 > > #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/10da9h1229456772.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/1113t11229456772.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/12t6d21229456772.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/13np1h1229456772.tab") > > system("convert tmp/1a5xl1229456771.ps tmp/1a5xl1229456771.png") > system("convert tmp/2jebu1229456771.ps tmp/2jebu1229456771.png") > system("convert tmp/3zobt1229456771.ps tmp/3zobt1229456771.png") > system("convert tmp/44xc21229456771.ps tmp/44xc21229456771.png") > system("convert tmp/5yhks1229456771.ps tmp/5yhks1229456771.png") > system("convert tmp/6p92j1229456771.ps tmp/6p92j1229456771.png") > system("convert tmp/7k38x1229456771.ps tmp/7k38x1229456771.png") > system("convert tmp/8cgfa1229456771.ps tmp/8cgfa1229456771.png") > system("convert tmp/911q31229456771.ps tmp/911q31229456771.png") > > > proc.time() user system elapsed 1.951 1.446 2.538