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(41.1,0,58,0,63,0,53.8,0,54.7,0,55.5,0,56.1,0,69.6,0,69.4,0,57.2,0,68,0,53.3,0,47.9,0,60.8,0,61.7,0,57.8,0,51.4,0,50.5,0,48.1,0,58.7,0,54,0,56.1,0,60.4,0,51.2,0,50.7,0,56.4,0,53.3,0,52.6,0,47.7,0,49.5,0,48.5,0,55.3,0,49.8,0,57.4,0,64.6,0,53,0,41.5,0,55.9,0,58.4,0,53.5,0,50.6,0,58.5,1,49.1,1,61.1,1,52.3,1,58.4,1,65.5,1,61.7,1,45.1,1,52.1,1,59.3,1,57.9,1,45,1,64.9,1,63.8,1,69.4,1,71.1,1,62.9,1,73.5,1,62.6,1),dim=c(2,60),dimnames=list(c('Tabakproductie','rookverbod'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Tabakproductie','rookverbod'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = 'Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > ylab = '' > xlab = '' > main = '' > #'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 Tabakproductie rookverbod M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 41.1 0 1 0 0 0 0 0 0 0 0 0 0 1 2 58.0 0 0 1 0 0 0 0 0 0 0 0 0 2 3 63.0 0 0 0 1 0 0 0 0 0 0 0 0 3 4 53.8 0 0 0 0 1 0 0 0 0 0 0 0 4 5 54.7 0 0 0 0 0 1 0 0 0 0 0 0 5 6 55.5 0 0 0 0 0 0 1 0 0 0 0 0 6 7 56.1 0 0 0 0 0 0 0 1 0 0 0 0 7 8 69.6 0 0 0 0 0 0 0 0 1 0 0 0 8 9 69.4 0 0 0 0 0 0 0 0 0 1 0 0 9 10 57.2 0 0 0 0 0 0 0 0 0 0 1 0 10 11 68.0 0 0 0 0 0 0 0 0 0 0 0 1 11 12 53.3 0 0 0 0 0 0 0 0 0 0 0 0 12 13 47.9 0 1 0 0 0 0 0 0 0 0 0 0 13 14 60.8 0 0 1 0 0 0 0 0 0 0 0 0 14 15 61.7 0 0 0 1 0 0 0 0 0 0 0 0 15 16 57.8 0 0 0 0 1 0 0 0 0 0 0 0 16 17 51.4 0 0 0 0 0 1 0 0 0 0 0 0 17 18 50.5 0 0 0 0 0 0 1 0 0 0 0 0 18 19 48.1 0 0 0 0 0 0 0 1 0 0 0 0 19 20 58.7 0 0 0 0 0 0 0 0 1 0 0 0 20 21 54.0 0 0 0 0 0 0 0 0 0 1 0 0 21 22 56.1 0 0 0 0 0 0 0 0 0 0 1 0 22 23 60.4 0 0 0 0 0 0 0 0 0 0 0 1 23 24 51.2 0 0 0 0 0 0 0 0 0 0 0 0 24 25 50.7 0 1 0 0 0 0 0 0 0 0 0 0 25 26 56.4 0 0 1 0 0 0 0 0 0 0 0 0 26 27 53.3 0 0 0 1 0 0 0 0 0 0 0 0 27 28 52.6 0 0 0 0 1 0 0 0 0 0 0 0 28 29 47.7 0 0 0 0 0 1 0 0 0 0 0 0 29 30 49.5 0 0 0 0 0 0 1 0 0 0 0 0 30 31 48.5 0 0 0 0 0 0 0 1 0 0 0 0 31 32 55.3 0 0 0 0 0 0 0 0 1 0 0 0 32 33 49.8 0 0 0 0 0 0 0 0 0 1 0 0 33 34 57.4 0 0 0 0 0 0 0 0 0 0 1 0 34 35 64.6 0 0 0 0 0 0 0 0 0 0 0 1 35 36 53.0 0 0 0 0 0 0 0 0 0 0 0 0 36 37 41.5 0 1 0 0 0 0 0 0 0 0 0 0 37 38 55.9 0 0 1 0 0 0 0 0 0 0 0 0 38 39 58.4 0 0 0 1 0 0 0 0 0 0 0 0 39 40 53.5 0 0 0 0 1 0 0 0 0 0 0 0 40 41 50.6 0 0 0 0 0 1 0 0 0 0 0 0 41 42 58.5 1 0 0 0 0 0 1 0 0 0 0 0 42 43 49.1 1 0 0 0 0 0 0 1 0 0 0 0 43 44 61.1 1 0 0 0 0 0 0 0 1 0 0 0 44 45 52.3 1 0 0 0 0 0 0 0 0 1 0 0 45 46 58.4 1 0 0 0 0 0 0 0 0 0 1 0 46 47 65.5 1 0 0 0 0 0 0 0 0 0 0 1 47 48 61.7 1 0 0 0 0 0 0 0 0 0 0 0 48 49 45.1 1 1 0 0 0 0 0 0 0 0 0 0 49 50 52.1 1 0 1 0 0 0 0 0 0 0 0 0 50 51 59.3 1 0 0 1 0 0 0 0 0 0 0 0 51 52 57.9 1 0 0 0 1 0 0 0 0 0 0 0 52 53 45.0 1 0 0 0 0 1 0 0 0 0 0 0 53 54 64.9 1 0 0 0 0 0 1 0 0 0 0 0 54 55 63.8 1 0 0 0 0 0 0 1 0 0 0 0 55 56 69.4 1 0 0 0 0 0 0 0 1 0 0 0 56 57 71.1 1 0 0 0 0 0 0 0 0 1 0 0 57 58 62.9 1 0 0 0 0 0 0 0 0 0 1 0 58 59 73.5 1 0 0 0 0 0 0 0 0 0 0 1 59 60 62.6 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) rookverbod M1 M2 M3 M4 57.0990 6.2173 -10.8422 0.6274 3.2170 -0.7134 M5 M6 M7 M8 M9 M10 -5.8638 -1.1176 -3.6880 6.1016 2.6912 1.8608 M11 t 9.9504 -0.0896 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9.675066 -3.568397 0.006546 2.866176 10.416319 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 57.09898 2.82405 20.219 < 2e-16 *** rookverbod 6.21727 2.43205 2.556 0.01394 * M1 -10.84223 3.25275 -3.333 0.00170 ** M2 0.62738 3.24687 0.193 0.84763 M3 3.21698 3.24229 0.992 0.32629 M4 -0.71341 3.23902 -0.220 0.82665 M5 -5.86380 3.23705 -1.811 0.07660 . M6 -1.11765 3.24704 -0.344 0.73226 M7 -3.68804 3.23984 -1.138 0.26087 M8 6.10157 3.23394 1.887 0.06552 . M9 2.69118 3.22935 0.833 0.40895 M10 1.86078 3.22606 0.577 0.56689 M11 9.95039 3.22408 3.086 0.00343 ** t -0.08961 0.06515 -1.375 0.17566 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.097 on 46 degrees of freedom Multiple R-squared: 0.6147, Adjusted R-squared: 0.5058 F-statistic: 5.645 on 13 and 46 DF, p-value: 5.224e-06 > postscript(file="/var/www/html/freestat/rcomp/tmp/1nl9p1228122659.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/freestat/rcomp/tmp/20p371228122659.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/freestat/rcomp/tmp/3xjqd1228122659.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/freestat/rcomp/tmp/4y26h1228122659.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/freestat/rcomp/tmp/5wvpq1228122659.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 -5.06713472 0.45286528 2.95286528 -2.22713472 3.91286528 0.05631879 7 8 9 10 11 12 3.31631879 7.11631879 10.41631879 -0.86368121 1.93631879 -2.72368121 13 14 15 16 17 18 2.80815939 4.32815939 2.72815939 2.84815939 1.68815939 -3.86838710 19 20 21 22 23 24 -3.60838710 -2.70838710 -3.90838710 -0.88838710 -4.58838710 -3.74838710 25 26 27 28 29 30 6.68345351 1.00345351 -4.59654649 -1.27654649 -0.93654649 -3.79309298 31 32 33 34 35 36 -2.13309298 -5.03309298 -7.03309298 1.48690702 0.68690702 -0.87309298 37 38 39 40 41 42 -1.44125237 1.57874763 1.57874763 0.69874763 3.03874763 0.06493359 43 44 45 46 47 48 -6.67506641 -4.37506641 -9.67506641 -2.65506641 -3.55506641 2.68493359 49 50 51 52 53 54 -2.98322581 -7.36322581 -2.66322581 -0.04322581 -7.70322581 7.54022770 55 56 57 58 59 60 9.10022770 5.00022770 10.20022770 2.92022770 5.52022770 4.66022770 > postscript(file="/var/www/html/freestat/rcomp/tmp/6bvxx1228122659.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 -5.06713472 NA 1 0.45286528 -5.06713472 2 2.95286528 0.45286528 3 -2.22713472 2.95286528 4 3.91286528 -2.22713472 5 0.05631879 3.91286528 6 3.31631879 0.05631879 7 7.11631879 3.31631879 8 10.41631879 7.11631879 9 -0.86368121 10.41631879 10 1.93631879 -0.86368121 11 -2.72368121 1.93631879 12 2.80815939 -2.72368121 13 4.32815939 2.80815939 14 2.72815939 4.32815939 15 2.84815939 2.72815939 16 1.68815939 2.84815939 17 -3.86838710 1.68815939 18 -3.60838710 -3.86838710 19 -2.70838710 -3.60838710 20 -3.90838710 -2.70838710 21 -0.88838710 -3.90838710 22 -4.58838710 -0.88838710 23 -3.74838710 -4.58838710 24 6.68345351 -3.74838710 25 1.00345351 6.68345351 26 -4.59654649 1.00345351 27 -1.27654649 -4.59654649 28 -0.93654649 -1.27654649 29 -3.79309298 -0.93654649 30 -2.13309298 -3.79309298 31 -5.03309298 -2.13309298 32 -7.03309298 -5.03309298 33 1.48690702 -7.03309298 34 0.68690702 1.48690702 35 -0.87309298 0.68690702 36 -1.44125237 -0.87309298 37 1.57874763 -1.44125237 38 1.57874763 1.57874763 39 0.69874763 1.57874763 40 3.03874763 0.69874763 41 0.06493359 3.03874763 42 -6.67506641 0.06493359 43 -4.37506641 -6.67506641 44 -9.67506641 -4.37506641 45 -2.65506641 -9.67506641 46 -3.55506641 -2.65506641 47 2.68493359 -3.55506641 48 -2.98322581 2.68493359 49 -7.36322581 -2.98322581 50 -2.66322581 -7.36322581 51 -0.04322581 -2.66322581 52 -7.70322581 -0.04322581 53 7.54022770 -7.70322581 54 9.10022770 7.54022770 55 5.00022770 9.10022770 56 10.20022770 5.00022770 57 2.92022770 10.20022770 58 5.52022770 2.92022770 59 4.66022770 5.52022770 60 NA 4.66022770 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.45286528 -5.06713472 [2,] 2.95286528 0.45286528 [3,] -2.22713472 2.95286528 [4,] 3.91286528 -2.22713472 [5,] 0.05631879 3.91286528 [6,] 3.31631879 0.05631879 [7,] 7.11631879 3.31631879 [8,] 10.41631879 7.11631879 [9,] -0.86368121 10.41631879 [10,] 1.93631879 -0.86368121 [11,] -2.72368121 1.93631879 [12,] 2.80815939 -2.72368121 [13,] 4.32815939 2.80815939 [14,] 2.72815939 4.32815939 [15,] 2.84815939 2.72815939 [16,] 1.68815939 2.84815939 [17,] -3.86838710 1.68815939 [18,] -3.60838710 -3.86838710 [19,] -2.70838710 -3.60838710 [20,] -3.90838710 -2.70838710 [21,] -0.88838710 -3.90838710 [22,] -4.58838710 -0.88838710 [23,] -3.74838710 -4.58838710 [24,] 6.68345351 -3.74838710 [25,] 1.00345351 6.68345351 [26,] -4.59654649 1.00345351 [27,] -1.27654649 -4.59654649 [28,] -0.93654649 -1.27654649 [29,] -3.79309298 -0.93654649 [30,] -2.13309298 -3.79309298 [31,] -5.03309298 -2.13309298 [32,] -7.03309298 -5.03309298 [33,] 1.48690702 -7.03309298 [34,] 0.68690702 1.48690702 [35,] -0.87309298 0.68690702 [36,] -1.44125237 -0.87309298 [37,] 1.57874763 -1.44125237 [38,] 1.57874763 1.57874763 [39,] 0.69874763 1.57874763 [40,] 3.03874763 0.69874763 [41,] 0.06493359 3.03874763 [42,] -6.67506641 0.06493359 [43,] -4.37506641 -6.67506641 [44,] -9.67506641 -4.37506641 [45,] -2.65506641 -9.67506641 [46,] -3.55506641 -2.65506641 [47,] 2.68493359 -3.55506641 [48,] -2.98322581 2.68493359 [49,] -7.36322581 -2.98322581 [50,] -2.66322581 -7.36322581 [51,] -0.04322581 -2.66322581 [52,] -7.70322581 -0.04322581 [53,] 7.54022770 -7.70322581 [54,] 9.10022770 7.54022770 [55,] 5.00022770 9.10022770 [56,] 10.20022770 5.00022770 [57,] 2.92022770 10.20022770 [58,] 5.52022770 2.92022770 [59,] 4.66022770 5.52022770 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.45286528 -5.06713472 2 2.95286528 0.45286528 3 -2.22713472 2.95286528 4 3.91286528 -2.22713472 5 0.05631879 3.91286528 6 3.31631879 0.05631879 7 7.11631879 3.31631879 8 10.41631879 7.11631879 9 -0.86368121 10.41631879 10 1.93631879 -0.86368121 11 -2.72368121 1.93631879 12 2.80815939 -2.72368121 13 4.32815939 2.80815939 14 2.72815939 4.32815939 15 2.84815939 2.72815939 16 1.68815939 2.84815939 17 -3.86838710 1.68815939 18 -3.60838710 -3.86838710 19 -2.70838710 -3.60838710 20 -3.90838710 -2.70838710 21 -0.88838710 -3.90838710 22 -4.58838710 -0.88838710 23 -3.74838710 -4.58838710 24 6.68345351 -3.74838710 25 1.00345351 6.68345351 26 -4.59654649 1.00345351 27 -1.27654649 -4.59654649 28 -0.93654649 -1.27654649 29 -3.79309298 -0.93654649 30 -2.13309298 -3.79309298 31 -5.03309298 -2.13309298 32 -7.03309298 -5.03309298 33 1.48690702 -7.03309298 34 0.68690702 1.48690702 35 -0.87309298 0.68690702 36 -1.44125237 -0.87309298 37 1.57874763 -1.44125237 38 1.57874763 1.57874763 39 0.69874763 1.57874763 40 3.03874763 0.69874763 41 0.06493359 3.03874763 42 -6.67506641 0.06493359 43 -4.37506641 -6.67506641 44 -9.67506641 -4.37506641 45 -2.65506641 -9.67506641 46 -3.55506641 -2.65506641 47 2.68493359 -3.55506641 48 -2.98322581 2.68493359 49 -7.36322581 -2.98322581 50 -2.66322581 -7.36322581 51 -0.04322581 -2.66322581 52 -7.70322581 -0.04322581 53 7.54022770 -7.70322581 54 9.10022770 7.54022770 55 5.00022770 9.10022770 56 10.20022770 5.00022770 57 2.92022770 10.20022770 58 5.52022770 2.92022770 59 4.66022770 5.52022770 > 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/freestat/rcomp/tmp/7at0e1228122659.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/freestat/rcomp/tmp/88lkp1228122659.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/freestat/rcomp/tmp/9kfh51228122659.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/10y2qu1228122659.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/freestat/rcomp/tmp/115yyb1228122659.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/freestat/rcomp/tmp/12thcu1228122659.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/freestat/rcomp/tmp/13a0ee1228122659.tab") > > system("convert tmp/1nl9p1228122659.ps tmp/1nl9p1228122659.png") > system("convert tmp/20p371228122659.ps tmp/20p371228122659.png") > system("convert tmp/3xjqd1228122659.ps tmp/3xjqd1228122659.png") > system("convert tmp/4y26h1228122659.ps tmp/4y26h1228122659.png") > system("convert tmp/5wvpq1228122659.ps tmp/5wvpq1228122659.png") > system("convert tmp/6bvxx1228122659.ps tmp/6bvxx1228122659.png") > system("convert tmp/7at0e1228122659.ps tmp/7at0e1228122659.png") > system("convert tmp/88lkp1228122659.ps tmp/88lkp1228122659.png") > system("convert tmp/9kfh51228122659.ps tmp/9kfh51228122659.png") > > > proc.time() user system elapsed 2.994 2.252 3.328