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(10.400,1,10.800,1,10.600,1,11.200,1,11.800,1,11.300,1,10.800,1,10.600,1,10.900,1,10.200,1,10.100,1,10.100,1,10.000,1,10.100,0,10.300,0,10.900,0,10.700,0,10.500,0,10.600,0,10.600,0,10.800,0,10.700,0,10.400,0,10.400,0,10.600,0,10.900,0,10.900,0,10.500,0,10.100,0,10.200,0,10.300,0,10.600,0,10.800,0,10.500,0,10.500,0,10.500,0,10.400,0,10.500,0,10.700,0,11.000,0,11.600,0,11.600,0,11.700,0,11.700,0,11.800,0,12.100,0,11.800,0,11.300,0,11.200,0,11.700,0,11.900,0,12.600,0,12.500,0,12.800,0,13.500,0,13.900,0,14.500,0,14.100,0,13.200,0,13.100,0,13.300,0,13.200,0,13.200,0,14.000,0,14.300,0,14.300,0,14.500,0,14.500,1,13.300,1,12.700,1,12.700,1,12.900,1,12.500,1,12.600,0,13.200,0,13.600,0,14.000,0,14.100,0,14.200,0,13.900,0,13.800,0,14.100,0,14.700,0,14.400,0,14.700,0,14.500,0,14.700,0,14.900,0,15.400,0,16.100,0,16.300,0),dim=c(2,91),dimnames=list(c('Y','D'),1:91)) > y <- array(NA,dim=c(2,91),dimnames=list(c('Y','D'),1:91)) > 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) > 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 D 1 10.4 1 2 10.8 1 3 10.6 1 4 11.2 1 5 11.8 1 6 11.3 1 7 10.8 1 8 10.6 1 9 10.9 1 10 10.2 1 11 10.1 1 12 10.1 1 13 10.0 1 14 10.1 0 15 10.3 0 16 10.9 0 17 10.7 0 18 10.5 0 19 10.6 0 20 10.6 0 21 10.8 0 22 10.7 0 23 10.4 0 24 10.4 0 25 10.6 0 26 10.9 0 27 10.9 0 28 10.5 0 29 10.1 0 30 10.2 0 31 10.3 0 32 10.6 0 33 10.8 0 34 10.5 0 35 10.5 0 36 10.5 0 37 10.4 0 38 10.5 0 39 10.7 0 40 11.0 0 41 11.6 0 42 11.6 0 43 11.7 0 44 11.7 0 45 11.8 0 46 12.1 0 47 11.8 0 48 11.3 0 49 11.2 0 50 11.7 0 51 11.9 0 52 12.6 0 53 12.5 0 54 12.8 0 55 13.5 0 56 13.9 0 57 14.5 0 58 14.1 0 59 13.2 0 60 13.1 0 61 13.3 0 62 13.2 0 63 13.2 0 64 14.0 0 65 14.3 0 66 14.3 0 67 14.5 0 68 14.5 1 69 13.3 1 70 12.7 1 71 12.7 1 72 12.9 1 73 12.5 1 74 12.6 0 75 13.2 0 76 13.6 0 77 14.0 0 78 14.1 0 79 14.2 0 80 13.9 0 81 13.8 0 82 14.1 0 83 14.7 0 84 14.4 0 85 14.7 0 86 14.5 0 87 14.7 0 88 14.9 0 89 15.4 0 90 16.1 0 91 16.3 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D 12.3556 -0.9135 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.2556 -1.5056 -0.5421 1.5012 3.9444 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 12.3556 0.1954 63.232 <2e-16 *** D -0.9135 0.4276 -2.136 0.0354 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.658 on 89 degrees of freedom Multiple R-squared: 0.04877, Adjusted R-squared: 0.03808 F-statistic: 4.563 on 1 and 89 DF, p-value: 0.03542 > postscript(file="/var/www/html/rcomp/tmp/1xey11227572372.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/2sx4r1227572372.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/3q70s1227572372.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/4dxk01227572372.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/5bzf41227572372.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 = 91 Frequency = 1 1 2 3 4 5 6 7 -1.0421053 -0.6421053 -0.8421053 -0.2421053 0.3578947 -0.1421053 -0.6421053 8 9 10 11 12 13 14 -0.8421053 -0.5421053 -1.2421053 -1.3421053 -1.3421053 -1.4421053 -2.2555556 15 16 17 18 19 20 21 -2.0555556 -1.4555556 -1.6555556 -1.8555556 -1.7555556 -1.7555556 -1.5555556 22 23 24 25 26 27 28 -1.6555556 -1.9555556 -1.9555556 -1.7555556 -1.4555556 -1.4555556 -1.8555556 29 30 31 32 33 34 35 -2.2555556 -2.1555556 -2.0555556 -1.7555556 -1.5555556 -1.8555556 -1.8555556 36 37 38 39 40 41 42 -1.8555556 -1.9555556 -1.8555556 -1.6555556 -1.3555556 -0.7555556 -0.7555556 43 44 45 46 47 48 49 -0.6555556 -0.6555556 -0.5555556 -0.2555556 -0.5555556 -1.0555556 -1.1555556 50 51 52 53 54 55 56 -0.6555556 -0.4555556 0.2444444 0.1444444 0.4444444 1.1444444 1.5444444 57 58 59 60 61 62 63 2.1444444 1.7444444 0.8444444 0.7444444 0.9444444 0.8444444 0.8444444 64 65 66 67 68 69 70 1.6444444 1.9444444 1.9444444 2.1444444 3.0578947 1.8578947 1.2578947 71 72 73 74 75 76 77 1.2578947 1.4578947 1.0578947 0.2444444 0.8444444 1.2444444 1.6444444 78 79 80 81 82 83 84 1.7444444 1.8444444 1.5444444 1.4444444 1.7444444 2.3444444 2.0444444 85 86 87 88 89 90 91 2.3444444 2.1444444 2.3444444 2.5444444 3.0444444 3.7444444 3.9444444 > postscript(file="/var/www/html/rcomp/tmp/6prpk1227572372.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 = 91 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.0421053 NA 1 -0.6421053 -1.0421053 2 -0.8421053 -0.6421053 3 -0.2421053 -0.8421053 4 0.3578947 -0.2421053 5 -0.1421053 0.3578947 6 -0.6421053 -0.1421053 7 -0.8421053 -0.6421053 8 -0.5421053 -0.8421053 9 -1.2421053 -0.5421053 10 -1.3421053 -1.2421053 11 -1.3421053 -1.3421053 12 -1.4421053 -1.3421053 13 -2.2555556 -1.4421053 14 -2.0555556 -2.2555556 15 -1.4555556 -2.0555556 16 -1.6555556 -1.4555556 17 -1.8555556 -1.6555556 18 -1.7555556 -1.8555556 19 -1.7555556 -1.7555556 20 -1.5555556 -1.7555556 21 -1.6555556 -1.5555556 22 -1.9555556 -1.6555556 23 -1.9555556 -1.9555556 24 -1.7555556 -1.9555556 25 -1.4555556 -1.7555556 26 -1.4555556 -1.4555556 27 -1.8555556 -1.4555556 28 -2.2555556 -1.8555556 29 -2.1555556 -2.2555556 30 -2.0555556 -2.1555556 31 -1.7555556 -2.0555556 32 -1.5555556 -1.7555556 33 -1.8555556 -1.5555556 34 -1.8555556 -1.8555556 35 -1.8555556 -1.8555556 36 -1.9555556 -1.8555556 37 -1.8555556 -1.9555556 38 -1.6555556 -1.8555556 39 -1.3555556 -1.6555556 40 -0.7555556 -1.3555556 41 -0.7555556 -0.7555556 42 -0.6555556 -0.7555556 43 -0.6555556 -0.6555556 44 -0.5555556 -0.6555556 45 -0.2555556 -0.5555556 46 -0.5555556 -0.2555556 47 -1.0555556 -0.5555556 48 -1.1555556 -1.0555556 49 -0.6555556 -1.1555556 50 -0.4555556 -0.6555556 51 0.2444444 -0.4555556 52 0.1444444 0.2444444 53 0.4444444 0.1444444 54 1.1444444 0.4444444 55 1.5444444 1.1444444 56 2.1444444 1.5444444 57 1.7444444 2.1444444 58 0.8444444 1.7444444 59 0.7444444 0.8444444 60 0.9444444 0.7444444 61 0.8444444 0.9444444 62 0.8444444 0.8444444 63 1.6444444 0.8444444 64 1.9444444 1.6444444 65 1.9444444 1.9444444 66 2.1444444 1.9444444 67 3.0578947 2.1444444 68 1.8578947 3.0578947 69 1.2578947 1.8578947 70 1.2578947 1.2578947 71 1.4578947 1.2578947 72 1.0578947 1.4578947 73 0.2444444 1.0578947 74 0.8444444 0.2444444 75 1.2444444 0.8444444 76 1.6444444 1.2444444 77 1.7444444 1.6444444 78 1.8444444 1.7444444 79 1.5444444 1.8444444 80 1.4444444 1.5444444 81 1.7444444 1.4444444 82 2.3444444 1.7444444 83 2.0444444 2.3444444 84 2.3444444 2.0444444 85 2.1444444 2.3444444 86 2.3444444 2.1444444 87 2.5444444 2.3444444 88 3.0444444 2.5444444 89 3.7444444 3.0444444 90 3.9444444 3.7444444 91 NA 3.9444444 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.6421053 -1.0421053 [2,] -0.8421053 -0.6421053 [3,] -0.2421053 -0.8421053 [4,] 0.3578947 -0.2421053 [5,] -0.1421053 0.3578947 [6,] -0.6421053 -0.1421053 [7,] -0.8421053 -0.6421053 [8,] -0.5421053 -0.8421053 [9,] -1.2421053 -0.5421053 [10,] -1.3421053 -1.2421053 [11,] -1.3421053 -1.3421053 [12,] -1.4421053 -1.3421053 [13,] -2.2555556 -1.4421053 [14,] -2.0555556 -2.2555556 [15,] -1.4555556 -2.0555556 [16,] -1.6555556 -1.4555556 [17,] -1.8555556 -1.6555556 [18,] -1.7555556 -1.8555556 [19,] -1.7555556 -1.7555556 [20,] -1.5555556 -1.7555556 [21,] -1.6555556 -1.5555556 [22,] -1.9555556 -1.6555556 [23,] -1.9555556 -1.9555556 [24,] -1.7555556 -1.9555556 [25,] -1.4555556 -1.7555556 [26,] -1.4555556 -1.4555556 [27,] -1.8555556 -1.4555556 [28,] -2.2555556 -1.8555556 [29,] -2.1555556 -2.2555556 [30,] -2.0555556 -2.1555556 [31,] -1.7555556 -2.0555556 [32,] -1.5555556 -1.7555556 [33,] -1.8555556 -1.5555556 [34,] -1.8555556 -1.8555556 [35,] -1.8555556 -1.8555556 [36,] -1.9555556 -1.8555556 [37,] -1.8555556 -1.9555556 [38,] -1.6555556 -1.8555556 [39,] -1.3555556 -1.6555556 [40,] -0.7555556 -1.3555556 [41,] -0.7555556 -0.7555556 [42,] -0.6555556 -0.7555556 [43,] -0.6555556 -0.6555556 [44,] -0.5555556 -0.6555556 [45,] -0.2555556 -0.5555556 [46,] -0.5555556 -0.2555556 [47,] -1.0555556 -0.5555556 [48,] -1.1555556 -1.0555556 [49,] -0.6555556 -1.1555556 [50,] -0.4555556 -0.6555556 [51,] 0.2444444 -0.4555556 [52,] 0.1444444 0.2444444 [53,] 0.4444444 0.1444444 [54,] 1.1444444 0.4444444 [55,] 1.5444444 1.1444444 [56,] 2.1444444 1.5444444 [57,] 1.7444444 2.1444444 [58,] 0.8444444 1.7444444 [59,] 0.7444444 0.8444444 [60,] 0.9444444 0.7444444 [61,] 0.8444444 0.9444444 [62,] 0.8444444 0.8444444 [63,] 1.6444444 0.8444444 [64,] 1.9444444 1.6444444 [65,] 1.9444444 1.9444444 [66,] 2.1444444 1.9444444 [67,] 3.0578947 2.1444444 [68,] 1.8578947 3.0578947 [69,] 1.2578947 1.8578947 [70,] 1.2578947 1.2578947 [71,] 1.4578947 1.2578947 [72,] 1.0578947 1.4578947 [73,] 0.2444444 1.0578947 [74,] 0.8444444 0.2444444 [75,] 1.2444444 0.8444444 [76,] 1.6444444 1.2444444 [77,] 1.7444444 1.6444444 [78,] 1.8444444 1.7444444 [79,] 1.5444444 1.8444444 [80,] 1.4444444 1.5444444 [81,] 1.7444444 1.4444444 [82,] 2.3444444 1.7444444 [83,] 2.0444444 2.3444444 [84,] 2.3444444 2.0444444 [85,] 2.1444444 2.3444444 [86,] 2.3444444 2.1444444 [87,] 2.5444444 2.3444444 [88,] 3.0444444 2.5444444 [89,] 3.7444444 3.0444444 [90,] 3.9444444 3.7444444 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.6421053 -1.0421053 2 -0.8421053 -0.6421053 3 -0.2421053 -0.8421053 4 0.3578947 -0.2421053 5 -0.1421053 0.3578947 6 -0.6421053 -0.1421053 7 -0.8421053 -0.6421053 8 -0.5421053 -0.8421053 9 -1.2421053 -0.5421053 10 -1.3421053 -1.2421053 11 -1.3421053 -1.3421053 12 -1.4421053 -1.3421053 13 -2.2555556 -1.4421053 14 -2.0555556 -2.2555556 15 -1.4555556 -2.0555556 16 -1.6555556 -1.4555556 17 -1.8555556 -1.6555556 18 -1.7555556 -1.8555556 19 -1.7555556 -1.7555556 20 -1.5555556 -1.7555556 21 -1.6555556 -1.5555556 22 -1.9555556 -1.6555556 23 -1.9555556 -1.9555556 24 -1.7555556 -1.9555556 25 -1.4555556 -1.7555556 26 -1.4555556 -1.4555556 27 -1.8555556 -1.4555556 28 -2.2555556 -1.8555556 29 -2.1555556 -2.2555556 30 -2.0555556 -2.1555556 31 -1.7555556 -2.0555556 32 -1.5555556 -1.7555556 33 -1.8555556 -1.5555556 34 -1.8555556 -1.8555556 35 -1.8555556 -1.8555556 36 -1.9555556 -1.8555556 37 -1.8555556 -1.9555556 38 -1.6555556 -1.8555556 39 -1.3555556 -1.6555556 40 -0.7555556 -1.3555556 41 -0.7555556 -0.7555556 42 -0.6555556 -0.7555556 43 -0.6555556 -0.6555556 44 -0.5555556 -0.6555556 45 -0.2555556 -0.5555556 46 -0.5555556 -0.2555556 47 -1.0555556 -0.5555556 48 -1.1555556 -1.0555556 49 -0.6555556 -1.1555556 50 -0.4555556 -0.6555556 51 0.2444444 -0.4555556 52 0.1444444 0.2444444 53 0.4444444 0.1444444 54 1.1444444 0.4444444 55 1.5444444 1.1444444 56 2.1444444 1.5444444 57 1.7444444 2.1444444 58 0.8444444 1.7444444 59 0.7444444 0.8444444 60 0.9444444 0.7444444 61 0.8444444 0.9444444 62 0.8444444 0.8444444 63 1.6444444 0.8444444 64 1.9444444 1.6444444 65 1.9444444 1.9444444 66 2.1444444 1.9444444 67 3.0578947 2.1444444 68 1.8578947 3.0578947 69 1.2578947 1.8578947 70 1.2578947 1.2578947 71 1.4578947 1.2578947 72 1.0578947 1.4578947 73 0.2444444 1.0578947 74 0.8444444 0.2444444 75 1.2444444 0.8444444 76 1.6444444 1.2444444 77 1.7444444 1.6444444 78 1.8444444 1.7444444 79 1.5444444 1.8444444 80 1.4444444 1.5444444 81 1.7444444 1.4444444 82 2.3444444 1.7444444 83 2.0444444 2.3444444 84 2.3444444 2.0444444 85 2.1444444 2.3444444 86 2.3444444 2.1444444 87 2.5444444 2.3444444 88 3.0444444 2.5444444 89 3.7444444 3.0444444 90 3.9444444 3.7444444 > 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/7dvkz1227572372.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/864741227572372.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/9gzz61227572372.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/108plj1227572372.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/11y4ag1227572372.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/12h3hm1227572372.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/139vme1227572372.tab") > > system("convert tmp/1xey11227572372.ps tmp/1xey11227572372.png") > system("convert tmp/2sx4r1227572372.ps tmp/2sx4r1227572372.png") > system("convert tmp/3q70s1227572372.ps tmp/3q70s1227572372.png") > system("convert tmp/4dxk01227572372.ps tmp/4dxk01227572372.png") > system("convert tmp/5bzf41227572372.ps tmp/5bzf41227572372.png") > system("convert tmp/6prpk1227572372.ps tmp/6prpk1227572372.png") > system("convert tmp/7dvkz1227572372.ps tmp/7dvkz1227572372.png") > system("convert tmp/864741227572372.ps tmp/864741227572372.png") > system("convert tmp/9gzz61227572372.ps tmp/9gzz61227572372.png") > > > proc.time() user system elapsed 1.950 1.463 2.360