R version 2.7.0 (2008-04-22) 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(106.60,106.80,107.00,107.10,107.30,107.40,107.60,107.70,107.90,108.20,108.30,108.50,108.92,109.23,109.41,109.65,109.91,110.01,110.20,110.49,110.57,110.72,110.94,111.09,111.28,111.41,111.62,111.76,111.89,112.04,112.12,112.30,112.47,112.59,112.78,112.73,112.99,113.10,113.33,113.38,113.68,113.65,113.81,113.88,114.02,114.25,114.28,114.38,114.73,114.97,115.05,115.29,115.37,115.54,115.76,115.92,116.02,116.21,116.26,116.51),dim=c(1,60),dimnames=list(c('Y'),1:60)) > y <- array(NA,dim=c(1,60),dimnames=list(c('Y'),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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 106.60 1 0 0 0 0 0 0 0 0 0 0 1 2 106.80 0 1 0 0 0 0 0 0 0 0 0 2 3 107.00 0 0 1 0 0 0 0 0 0 0 0 3 4 107.10 0 0 0 1 0 0 0 0 0 0 0 4 5 107.30 0 0 0 0 1 0 0 0 0 0 0 5 6 107.40 0 0 0 0 0 1 0 0 0 0 0 6 7 107.60 0 0 0 0 0 0 1 0 0 0 0 7 8 107.70 0 0 0 0 0 0 0 1 0 0 0 8 9 107.90 0 0 0 0 0 0 0 0 1 0 0 9 10 108.20 0 0 0 0 0 0 0 0 0 1 0 10 11 108.30 0 0 0 0 0 0 0 0 0 0 1 11 12 108.50 0 0 0 0 0 0 0 0 0 0 0 12 13 108.92 1 0 0 0 0 0 0 0 0 0 0 13 14 109.23 0 1 0 0 0 0 0 0 0 0 0 14 15 109.41 0 0 1 0 0 0 0 0 0 0 0 15 16 109.65 0 0 0 1 0 0 0 0 0 0 0 16 17 109.91 0 0 0 0 1 0 0 0 0 0 0 17 18 110.01 0 0 0 0 0 1 0 0 0 0 0 18 19 110.20 0 0 0 0 0 0 1 0 0 0 0 19 20 110.49 0 0 0 0 0 0 0 1 0 0 0 20 21 110.57 0 0 0 0 0 0 0 0 1 0 0 21 22 110.72 0 0 0 0 0 0 0 0 0 1 0 22 23 110.94 0 0 0 0 0 0 0 0 0 0 1 23 24 111.09 0 0 0 0 0 0 0 0 0 0 0 24 25 111.28 1 0 0 0 0 0 0 0 0 0 0 25 26 111.41 0 1 0 0 0 0 0 0 0 0 0 26 27 111.62 0 0 1 0 0 0 0 0 0 0 0 27 28 111.76 0 0 0 1 0 0 0 0 0 0 0 28 29 111.89 0 0 0 0 1 0 0 0 0 0 0 29 30 112.04 0 0 0 0 0 1 0 0 0 0 0 30 31 112.12 0 0 0 0 0 0 1 0 0 0 0 31 32 112.30 0 0 0 0 0 0 0 1 0 0 0 32 33 112.47 0 0 0 0 0 0 0 0 1 0 0 33 34 112.59 0 0 0 0 0 0 0 0 0 1 0 34 35 112.78 0 0 0 0 0 0 0 0 0 0 1 35 36 112.73 0 0 0 0 0 0 0 0 0 0 0 36 37 112.99 1 0 0 0 0 0 0 0 0 0 0 37 38 113.10 0 1 0 0 0 0 0 0 0 0 0 38 39 113.33 0 0 1 0 0 0 0 0 0 0 0 39 40 113.38 0 0 0 1 0 0 0 0 0 0 0 40 41 113.68 0 0 0 0 1 0 0 0 0 0 0 41 42 113.65 0 0 0 0 0 1 0 0 0 0 0 42 43 113.81 0 0 0 0 0 0 1 0 0 0 0 43 44 113.88 0 0 0 0 0 0 0 1 0 0 0 44 45 114.02 0 0 0 0 0 0 0 0 1 0 0 45 46 114.25 0 0 0 0 0 0 0 0 0 1 0 46 47 114.28 0 0 0 0 0 0 0 0 0 0 1 47 48 114.38 0 0 0 0 0 0 0 0 0 0 0 48 49 114.73 1 0 0 0 0 0 0 0 0 0 0 49 50 114.97 0 1 0 0 0 0 0 0 0 0 0 50 51 115.05 0 0 1 0 0 0 0 0 0 0 0 51 52 115.29 0 0 0 1 0 0 0 0 0 0 0 52 53 115.37 0 0 0 0 1 0 0 0 0 0 0 53 54 115.54 0 0 0 0 0 1 0 0 0 0 0 54 55 115.76 0 0 0 0 0 0 1 0 0 0 0 55 56 115.92 0 0 0 0 0 0 0 1 0 0 0 56 57 116.02 0 0 0 0 0 0 0 0 1 0 0 57 58 116.21 0 0 0 0 0 0 0 0 0 1 0 58 59 116.26 0 0 0 0 0 0 0 0 0 0 1 59 60 116.51 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) M1 M2 M3 M4 M5 106.69025 0.08059 0.11326 0.12794 0.11661 0.14528 M6 M7 M8 M9 M10 M11 0.07796 0.08263 0.07731 0.04998 0.08265 0.03533 t 0.16533 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.39017 -0.20385 -0.06692 0.26098 0.43192 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.067e+02 1.467e-01 727.141 <2e-16 *** M1 8.059e-02 1.785e-01 0.451 0.654 M2 1.133e-01 1.782e-01 0.635 0.528 M3 1.279e-01 1.780e-01 0.719 0.476 M4 1.166e-01 1.778e-01 0.656 0.515 M5 1.453e-01 1.776e-01 0.818 0.417 M6 7.796e-02 1.774e-01 0.439 0.662 M7 8.263e-02 1.773e-01 0.466 0.643 M8 7.731e-02 1.772e-01 0.436 0.665 M9 4.998e-02 1.771e-01 0.282 0.779 M10 8.265e-02 1.770e-01 0.467 0.643 M11 3.533e-02 1.770e-01 0.200 0.843 t 1.653e-01 2.128e-03 77.674 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.2798 on 47 degrees of freedom Multiple R-squared: 0.9925, Adjusted R-squared: 0.9906 F-statistic: 521.5 on 12 and 47 DF, p-value: < 2.2e-16 > postscript(file="/var/www/html/rcomp/tmp/1br1k1227442069.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/283k21227442069.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/3g4tz1227442069.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/42ukg1227442069.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/52vq71227442069.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 -3.361667e-01 -3.341667e-01 -3.141667e-01 -3.681667e-01 -3.621667e-01 6 7 8 9 10 -3.601667e-01 -3.301667e-01 -3.901667e-01 -3.281667e-01 -2.261667e-01 11 12 13 14 15 -2.441667e-01 -1.741667e-01 -8.333333e-05 1.119167e-01 1.119167e-01 16 17 18 19 20 1.979167e-01 2.639167e-01 2.659167e-01 2.859167e-01 4.159167e-01 21 22 23 24 25 3.579167e-01 3.099167e-01 4.119167e-01 4.319167e-01 3.760000e-01 26 27 28 29 30 3.080000e-01 3.380000e-01 3.240000e-01 2.600000e-01 3.120000e-01 31 32 33 34 35 2.220000e-01 2.420000e-01 2.740000e-01 1.960000e-01 2.680000e-01 36 37 38 39 40 8.800000e-02 1.020833e-01 1.408333e-02 6.408333e-02 -3.991667e-02 41 42 43 44 45 6.608333e-02 -6.191667e-02 -7.191667e-02 -1.619167e-01 -1.599167e-01 46 47 48 49 50 -1.279167e-01 -2.159167e-01 -2.459167e-01 -1.418333e-01 -9.983333e-02 51 52 53 54 55 -1.998333e-01 -1.138333e-01 -2.278333e-01 -1.558333e-01 -1.058333e-01 56 57 58 59 60 -1.058333e-01 -1.438333e-01 -1.518333e-01 -2.198333e-01 -9.983333e-02 > postscript(file="/var/www/html/rcomp/tmp/6j8a31227442069.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 -3.361667e-01 NA 1 -3.341667e-01 -3.361667e-01 2 -3.141667e-01 -3.341667e-01 3 -3.681667e-01 -3.141667e-01 4 -3.621667e-01 -3.681667e-01 5 -3.601667e-01 -3.621667e-01 6 -3.301667e-01 -3.601667e-01 7 -3.901667e-01 -3.301667e-01 8 -3.281667e-01 -3.901667e-01 9 -2.261667e-01 -3.281667e-01 10 -2.441667e-01 -2.261667e-01 11 -1.741667e-01 -2.441667e-01 12 -8.333333e-05 -1.741667e-01 13 1.119167e-01 -8.333333e-05 14 1.119167e-01 1.119167e-01 15 1.979167e-01 1.119167e-01 16 2.639167e-01 1.979167e-01 17 2.659167e-01 2.639167e-01 18 2.859167e-01 2.659167e-01 19 4.159167e-01 2.859167e-01 20 3.579167e-01 4.159167e-01 21 3.099167e-01 3.579167e-01 22 4.119167e-01 3.099167e-01 23 4.319167e-01 4.119167e-01 24 3.760000e-01 4.319167e-01 25 3.080000e-01 3.760000e-01 26 3.380000e-01 3.080000e-01 27 3.240000e-01 3.380000e-01 28 2.600000e-01 3.240000e-01 29 3.120000e-01 2.600000e-01 30 2.220000e-01 3.120000e-01 31 2.420000e-01 2.220000e-01 32 2.740000e-01 2.420000e-01 33 1.960000e-01 2.740000e-01 34 2.680000e-01 1.960000e-01 35 8.800000e-02 2.680000e-01 36 1.020833e-01 8.800000e-02 37 1.408333e-02 1.020833e-01 38 6.408333e-02 1.408333e-02 39 -3.991667e-02 6.408333e-02 40 6.608333e-02 -3.991667e-02 41 -6.191667e-02 6.608333e-02 42 -7.191667e-02 -6.191667e-02 43 -1.619167e-01 -7.191667e-02 44 -1.599167e-01 -1.619167e-01 45 -1.279167e-01 -1.599167e-01 46 -2.159167e-01 -1.279167e-01 47 -2.459167e-01 -2.159167e-01 48 -1.418333e-01 -2.459167e-01 49 -9.983333e-02 -1.418333e-01 50 -1.998333e-01 -9.983333e-02 51 -1.138333e-01 -1.998333e-01 52 -2.278333e-01 -1.138333e-01 53 -1.558333e-01 -2.278333e-01 54 -1.058333e-01 -1.558333e-01 55 -1.058333e-01 -1.058333e-01 56 -1.438333e-01 -1.058333e-01 57 -1.518333e-01 -1.438333e-01 58 -2.198333e-01 -1.518333e-01 59 -9.983333e-02 -2.198333e-01 60 NA -9.983333e-02 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.341667e-01 -3.361667e-01 [2,] -3.141667e-01 -3.341667e-01 [3,] -3.681667e-01 -3.141667e-01 [4,] -3.621667e-01 -3.681667e-01 [5,] -3.601667e-01 -3.621667e-01 [6,] -3.301667e-01 -3.601667e-01 [7,] -3.901667e-01 -3.301667e-01 [8,] -3.281667e-01 -3.901667e-01 [9,] -2.261667e-01 -3.281667e-01 [10,] -2.441667e-01 -2.261667e-01 [11,] -1.741667e-01 -2.441667e-01 [12,] -8.333333e-05 -1.741667e-01 [13,] 1.119167e-01 -8.333333e-05 [14,] 1.119167e-01 1.119167e-01 [15,] 1.979167e-01 1.119167e-01 [16,] 2.639167e-01 1.979167e-01 [17,] 2.659167e-01 2.639167e-01 [18,] 2.859167e-01 2.659167e-01 [19,] 4.159167e-01 2.859167e-01 [20,] 3.579167e-01 4.159167e-01 [21,] 3.099167e-01 3.579167e-01 [22,] 4.119167e-01 3.099167e-01 [23,] 4.319167e-01 4.119167e-01 [24,] 3.760000e-01 4.319167e-01 [25,] 3.080000e-01 3.760000e-01 [26,] 3.380000e-01 3.080000e-01 [27,] 3.240000e-01 3.380000e-01 [28,] 2.600000e-01 3.240000e-01 [29,] 3.120000e-01 2.600000e-01 [30,] 2.220000e-01 3.120000e-01 [31,] 2.420000e-01 2.220000e-01 [32,] 2.740000e-01 2.420000e-01 [33,] 1.960000e-01 2.740000e-01 [34,] 2.680000e-01 1.960000e-01 [35,] 8.800000e-02 2.680000e-01 [36,] 1.020833e-01 8.800000e-02 [37,] 1.408333e-02 1.020833e-01 [38,] 6.408333e-02 1.408333e-02 [39,] -3.991667e-02 6.408333e-02 [40,] 6.608333e-02 -3.991667e-02 [41,] -6.191667e-02 6.608333e-02 [42,] -7.191667e-02 -6.191667e-02 [43,] -1.619167e-01 -7.191667e-02 [44,] -1.599167e-01 -1.619167e-01 [45,] -1.279167e-01 -1.599167e-01 [46,] -2.159167e-01 -1.279167e-01 [47,] -2.459167e-01 -2.159167e-01 [48,] -1.418333e-01 -2.459167e-01 [49,] -9.983333e-02 -1.418333e-01 [50,] -1.998333e-01 -9.983333e-02 [51,] -1.138333e-01 -1.998333e-01 [52,] -2.278333e-01 -1.138333e-01 [53,] -1.558333e-01 -2.278333e-01 [54,] -1.058333e-01 -1.558333e-01 [55,] -1.058333e-01 -1.058333e-01 [56,] -1.438333e-01 -1.058333e-01 [57,] -1.518333e-01 -1.438333e-01 [58,] -2.198333e-01 -1.518333e-01 [59,] -9.983333e-02 -2.198333e-01 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.341667e-01 -3.361667e-01 2 -3.141667e-01 -3.341667e-01 3 -3.681667e-01 -3.141667e-01 4 -3.621667e-01 -3.681667e-01 5 -3.601667e-01 -3.621667e-01 6 -3.301667e-01 -3.601667e-01 7 -3.901667e-01 -3.301667e-01 8 -3.281667e-01 -3.901667e-01 9 -2.261667e-01 -3.281667e-01 10 -2.441667e-01 -2.261667e-01 11 -1.741667e-01 -2.441667e-01 12 -8.333333e-05 -1.741667e-01 13 1.119167e-01 -8.333333e-05 14 1.119167e-01 1.119167e-01 15 1.979167e-01 1.119167e-01 16 2.639167e-01 1.979167e-01 17 2.659167e-01 2.639167e-01 18 2.859167e-01 2.659167e-01 19 4.159167e-01 2.859167e-01 20 3.579167e-01 4.159167e-01 21 3.099167e-01 3.579167e-01 22 4.119167e-01 3.099167e-01 23 4.319167e-01 4.119167e-01 24 3.760000e-01 4.319167e-01 25 3.080000e-01 3.760000e-01 26 3.380000e-01 3.080000e-01 27 3.240000e-01 3.380000e-01 28 2.600000e-01 3.240000e-01 29 3.120000e-01 2.600000e-01 30 2.220000e-01 3.120000e-01 31 2.420000e-01 2.220000e-01 32 2.740000e-01 2.420000e-01 33 1.960000e-01 2.740000e-01 34 2.680000e-01 1.960000e-01 35 8.800000e-02 2.680000e-01 36 1.020833e-01 8.800000e-02 37 1.408333e-02 1.020833e-01 38 6.408333e-02 1.408333e-02 39 -3.991667e-02 6.408333e-02 40 6.608333e-02 -3.991667e-02 41 -6.191667e-02 6.608333e-02 42 -7.191667e-02 -6.191667e-02 43 -1.619167e-01 -7.191667e-02 44 -1.599167e-01 -1.619167e-01 45 -1.279167e-01 -1.599167e-01 46 -2.159167e-01 -1.279167e-01 47 -2.459167e-01 -2.159167e-01 48 -1.418333e-01 -2.459167e-01 49 -9.983333e-02 -1.418333e-01 50 -1.998333e-01 -9.983333e-02 51 -1.138333e-01 -1.998333e-01 52 -2.278333e-01 -1.138333e-01 53 -1.558333e-01 -2.278333e-01 54 -1.058333e-01 -1.558333e-01 55 -1.058333e-01 -1.058333e-01 56 -1.438333e-01 -1.058333e-01 57 -1.518333e-01 -1.438333e-01 58 -2.198333e-01 -1.518333e-01 59 -9.983333e-02 -2.198333e-01 > 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/7t3ba1227442069.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/8we861227442069.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/92u8m1227442069.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/10z0o71227442069.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/11lbrl1227442069.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/12jd5c1227442069.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/13kukc1227442069.tab") > > system("convert tmp/1br1k1227442069.ps tmp/1br1k1227442069.png") > system("convert tmp/283k21227442069.ps tmp/283k21227442069.png") > system("convert tmp/3g4tz1227442069.ps tmp/3g4tz1227442069.png") > system("convert tmp/42ukg1227442069.ps tmp/42ukg1227442069.png") > system("convert tmp/52vq71227442069.ps tmp/52vq71227442069.png") > system("convert tmp/6j8a31227442069.ps tmp/6j8a31227442069.png") > system("convert tmp/7t3ba1227442069.ps tmp/7t3ba1227442069.png") > system("convert tmp/8we861227442069.ps tmp/8we861227442069.png") > system("convert tmp/92u8m1227442069.ps tmp/92u8m1227442069.png") > > > proc.time() user system elapsed 3.958 2.444 4.312