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(7.8,0,7.6,0,7.5,0,7.6,0,7.5,0,7.3,0,7.6,0,7.5,0,7.6,0,7.9,0,7.9,0,8.1,0,8.2,0,8.0,0,7.5,0,6.8,0,6.5,0,6.6,0,7.6,0,8.0,0,8.0,0,7.7,0,7.5,0,7.6,0,7.7,0,7.9,0,7.8,0,7.5,0,7.5,0,7.1,0,7.5,0,7.5,0,7.6,0,7.7,1,7.9,1,8.1,1,8.2,1,8.2,1,8.1,1,7.9,1,7.3,1,6.9,1,6.6,1,6.7,1,6.9,1,7.0,1,7.1,1,7.2,1,7.1,1,6.9,1,7.0,1,6.8,1,6.4,1,6.7,1,6.7,1,6.4,1,6.3,1,6.2,1,6.5,1,6.8,1,6.8,1,6.5,1,6.3,1,5.9,1,5.9,1,6.4,1,6.4,1),dim=c(2,67),dimnames=list(c('y','x'),1:67)) > y <- array(NA,dim=c(2,67),dimnames=list(c('y','x'),1:67)) > 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 = 'Include Monthly Dummies' > par1 = '0' > #'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 1 7.8 0 1 0 0 0 0 0 0 0 0 0 0 2 7.6 0 0 1 0 0 0 0 0 0 0 0 0 3 7.5 0 0 0 1 0 0 0 0 0 0 0 0 4 7.6 0 0 0 0 1 0 0 0 0 0 0 0 5 7.5 0 0 0 0 0 1 0 0 0 0 0 0 6 7.3 0 0 0 0 0 0 1 0 0 0 0 0 7 7.6 0 0 0 0 0 0 0 1 0 0 0 0 8 7.5 0 0 0 0 0 0 0 0 1 0 0 0 9 7.6 0 0 0 0 0 0 0 0 0 1 0 0 10 7.9 0 0 0 0 0 0 0 0 0 0 1 0 11 7.9 0 0 0 0 0 0 0 0 0 0 0 1 12 8.1 0 0 0 0 0 0 0 0 0 0 0 0 13 8.2 0 1 0 0 0 0 0 0 0 0 0 0 14 8.0 0 0 1 0 0 0 0 0 0 0 0 0 15 7.5 0 0 0 1 0 0 0 0 0 0 0 0 16 6.8 0 0 0 0 1 0 0 0 0 0 0 0 17 6.5 0 0 0 0 0 1 0 0 0 0 0 0 18 6.6 0 0 0 0 0 0 1 0 0 0 0 0 19 7.6 0 0 0 0 0 0 0 1 0 0 0 0 20 8.0 0 0 0 0 0 0 0 0 1 0 0 0 21 8.0 0 0 0 0 0 0 0 0 0 1 0 0 22 7.7 0 0 0 0 0 0 0 0 0 0 1 0 23 7.5 0 0 0 0 0 0 0 0 0 0 0 1 24 7.6 0 0 0 0 0 0 0 0 0 0 0 0 25 7.7 0 1 0 0 0 0 0 0 0 0 0 0 26 7.9 0 0 1 0 0 0 0 0 0 0 0 0 27 7.8 0 0 0 1 0 0 0 0 0 0 0 0 28 7.5 0 0 0 0 1 0 0 0 0 0 0 0 29 7.5 0 0 0 0 0 1 0 0 0 0 0 0 30 7.1 0 0 0 0 0 0 1 0 0 0 0 0 31 7.5 0 0 0 0 0 0 0 1 0 0 0 0 32 7.5 0 0 0 0 0 0 0 0 1 0 0 0 33 7.6 0 0 0 0 0 0 0 0 0 1 0 0 34 7.7 1 0 0 0 0 0 0 0 0 0 1 0 35 7.9 1 0 0 0 0 0 0 0 0 0 0 1 36 8.1 1 0 0 0 0 0 0 0 0 0 0 0 37 8.2 1 1 0 0 0 0 0 0 0 0 0 0 38 8.2 1 0 1 0 0 0 0 0 0 0 0 0 39 8.1 1 0 0 1 0 0 0 0 0 0 0 0 40 7.9 1 0 0 0 1 0 0 0 0 0 0 0 41 7.3 1 0 0 0 0 1 0 0 0 0 0 0 42 6.9 1 0 0 0 0 0 1 0 0 0 0 0 43 6.6 1 0 0 0 0 0 0 1 0 0 0 0 44 6.7 1 0 0 0 0 0 0 0 1 0 0 0 45 6.9 1 0 0 0 0 0 0 0 0 1 0 0 46 7.0 1 0 0 0 0 0 0 0 0 0 1 0 47 7.1 1 0 0 0 0 0 0 0 0 0 0 1 48 7.2 1 0 0 0 0 0 0 0 0 0 0 0 49 7.1 1 1 0 0 0 0 0 0 0 0 0 0 50 6.9 1 0 1 0 0 0 0 0 0 0 0 0 51 7.0 1 0 0 1 0 0 0 0 0 0 0 0 52 6.8 1 0 0 0 1 0 0 0 0 0 0 0 53 6.4 1 0 0 0 0 1 0 0 0 0 0 0 54 6.7 1 0 0 0 0 0 1 0 0 0 0 0 55 6.7 1 0 0 0 0 0 0 1 0 0 0 0 56 6.4 1 0 0 0 0 0 0 0 1 0 0 0 57 6.3 1 0 0 0 0 0 0 0 0 1 0 0 58 6.2 1 0 0 0 0 0 0 0 0 0 1 0 59 6.5 1 0 0 0 0 0 0 0 0 0 0 1 60 6.8 1 0 0 0 0 0 0 0 0 0 0 0 61 6.8 1 1 0 0 0 0 0 0 0 0 0 0 62 6.5 1 0 1 0 0 0 0 0 0 0 0 0 63 6.3 1 0 0 1 0 0 0 0 0 0 0 0 64 5.9 1 0 0 0 1 0 0 0 0 0 0 0 65 5.9 1 0 0 0 0 1 0 0 0 0 0 0 66 6.4 1 0 0 0 0 0 1 0 0 0 0 0 67 6.4 1 0 0 0 0 0 0 1 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) x M1 M2 M3 M4 7.958909 -0.664848 0.006848 -0.109818 -0.259818 -0.543152 M5 M6 M7 M8 M9 M10 -0.776485 -0.793152 -0.559818 -0.472970 -0.412970 -0.260000 M11 -0.180000 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.850909 -0.272333 0.001091 0.200000 1.149091 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.958909 0.239188 33.275 < 2e-16 *** x -0.664848 0.125026 -5.318 2.06e-06 *** M1 0.006848 0.307777 0.022 0.9823 M2 -0.109818 0.307777 -0.357 0.7226 M3 -0.259818 0.307777 -0.844 0.4023 M4 -0.543152 0.307777 -1.765 0.0833 . M5 -0.776485 0.307777 -2.523 0.0146 * M6 -0.793152 0.307777 -2.577 0.0127 * M7 -0.559818 0.307777 -1.819 0.0745 . M8 -0.472970 0.322169 -1.468 0.1479 M9 -0.412970 0.322169 -1.282 0.2054 M10 -0.260000 0.321197 -0.809 0.4218 M11 -0.180000 0.321197 -0.560 0.5775 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5079 on 54 degrees of freedom Multiple R-squared: 0.4553, Adjusted R-squared: 0.3342 F-statistic: 3.761 on 12 and 54 DF, p-value: 0.000372 > postscript(file="/var/www/html/rcomp/tmp/1g1b41228170319.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/292qa1228170319.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/31nup1228170319.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/4t9se1228170319.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/5sltr1228170319.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 = 67 Frequency = 1 1 2 3 4 5 6 -0.165757576 -0.249090909 -0.199090909 0.184242424 0.317575758 0.134242424 7 8 9 10 11 12 0.200909091 0.014060606 0.054060606 0.201090909 0.121090909 0.141090909 13 14 15 16 17 18 0.234242424 0.150909091 -0.199090909 -0.615757576 -0.682424242 -0.565757576 19 20 21 22 23 24 0.200909091 0.514060606 0.454060606 0.001090909 -0.278909091 -0.358909091 25 26 27 28 29 30 -0.265757576 0.050909091 0.100909091 0.084242424 0.317575758 -0.065757576 31 32 33 34 35 36 0.100909091 0.014060606 0.054060606 0.665939394 0.785939394 0.805939394 37 38 39 40 41 42 0.899090909 1.015757576 1.065757576 1.149090909 0.782424242 0.399090909 43 44 45 46 47 48 -0.134242424 -0.121090909 0.018909091 -0.034060606 -0.014060606 -0.094060606 49 50 51 52 53 54 -0.200909091 -0.284242424 -0.034242424 0.049090909 -0.117575758 0.199090909 55 56 57 58 59 60 -0.034242424 -0.421090909 -0.581090909 -0.834060606 -0.614060606 -0.494060606 61 62 63 64 65 66 -0.500909091 -0.684242424 -0.734242424 -0.850909091 -0.617575758 -0.100909091 67 -0.334242424 > postscript(file="/var/www/html/rcomp/tmp/6udr71228170319.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 = 67 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.165757576 NA 1 -0.249090909 -0.165757576 2 -0.199090909 -0.249090909 3 0.184242424 -0.199090909 4 0.317575758 0.184242424 5 0.134242424 0.317575758 6 0.200909091 0.134242424 7 0.014060606 0.200909091 8 0.054060606 0.014060606 9 0.201090909 0.054060606 10 0.121090909 0.201090909 11 0.141090909 0.121090909 12 0.234242424 0.141090909 13 0.150909091 0.234242424 14 -0.199090909 0.150909091 15 -0.615757576 -0.199090909 16 -0.682424242 -0.615757576 17 -0.565757576 -0.682424242 18 0.200909091 -0.565757576 19 0.514060606 0.200909091 20 0.454060606 0.514060606 21 0.001090909 0.454060606 22 -0.278909091 0.001090909 23 -0.358909091 -0.278909091 24 -0.265757576 -0.358909091 25 0.050909091 -0.265757576 26 0.100909091 0.050909091 27 0.084242424 0.100909091 28 0.317575758 0.084242424 29 -0.065757576 0.317575758 30 0.100909091 -0.065757576 31 0.014060606 0.100909091 32 0.054060606 0.014060606 33 0.665939394 0.054060606 34 0.785939394 0.665939394 35 0.805939394 0.785939394 36 0.899090909 0.805939394 37 1.015757576 0.899090909 38 1.065757576 1.015757576 39 1.149090909 1.065757576 40 0.782424242 1.149090909 41 0.399090909 0.782424242 42 -0.134242424 0.399090909 43 -0.121090909 -0.134242424 44 0.018909091 -0.121090909 45 -0.034060606 0.018909091 46 -0.014060606 -0.034060606 47 -0.094060606 -0.014060606 48 -0.200909091 -0.094060606 49 -0.284242424 -0.200909091 50 -0.034242424 -0.284242424 51 0.049090909 -0.034242424 52 -0.117575758 0.049090909 53 0.199090909 -0.117575758 54 -0.034242424 0.199090909 55 -0.421090909 -0.034242424 56 -0.581090909 -0.421090909 57 -0.834060606 -0.581090909 58 -0.614060606 -0.834060606 59 -0.494060606 -0.614060606 60 -0.500909091 -0.494060606 61 -0.684242424 -0.500909091 62 -0.734242424 -0.684242424 63 -0.850909091 -0.734242424 64 -0.617575758 -0.850909091 65 -0.100909091 -0.617575758 66 -0.334242424 -0.100909091 67 NA -0.334242424 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.249090909 -0.165757576 [2,] -0.199090909 -0.249090909 [3,] 0.184242424 -0.199090909 [4,] 0.317575758 0.184242424 [5,] 0.134242424 0.317575758 [6,] 0.200909091 0.134242424 [7,] 0.014060606 0.200909091 [8,] 0.054060606 0.014060606 [9,] 0.201090909 0.054060606 [10,] 0.121090909 0.201090909 [11,] 0.141090909 0.121090909 [12,] 0.234242424 0.141090909 [13,] 0.150909091 0.234242424 [14,] -0.199090909 0.150909091 [15,] -0.615757576 -0.199090909 [16,] -0.682424242 -0.615757576 [17,] -0.565757576 -0.682424242 [18,] 0.200909091 -0.565757576 [19,] 0.514060606 0.200909091 [20,] 0.454060606 0.514060606 [21,] 0.001090909 0.454060606 [22,] -0.278909091 0.001090909 [23,] -0.358909091 -0.278909091 [24,] -0.265757576 -0.358909091 [25,] 0.050909091 -0.265757576 [26,] 0.100909091 0.050909091 [27,] 0.084242424 0.100909091 [28,] 0.317575758 0.084242424 [29,] -0.065757576 0.317575758 [30,] 0.100909091 -0.065757576 [31,] 0.014060606 0.100909091 [32,] 0.054060606 0.014060606 [33,] 0.665939394 0.054060606 [34,] 0.785939394 0.665939394 [35,] 0.805939394 0.785939394 [36,] 0.899090909 0.805939394 [37,] 1.015757576 0.899090909 [38,] 1.065757576 1.015757576 [39,] 1.149090909 1.065757576 [40,] 0.782424242 1.149090909 [41,] 0.399090909 0.782424242 [42,] -0.134242424 0.399090909 [43,] -0.121090909 -0.134242424 [44,] 0.018909091 -0.121090909 [45,] -0.034060606 0.018909091 [46,] -0.014060606 -0.034060606 [47,] -0.094060606 -0.014060606 [48,] -0.200909091 -0.094060606 [49,] -0.284242424 -0.200909091 [50,] -0.034242424 -0.284242424 [51,] 0.049090909 -0.034242424 [52,] -0.117575758 0.049090909 [53,] 0.199090909 -0.117575758 [54,] -0.034242424 0.199090909 [55,] -0.421090909 -0.034242424 [56,] -0.581090909 -0.421090909 [57,] -0.834060606 -0.581090909 [58,] -0.614060606 -0.834060606 [59,] -0.494060606 -0.614060606 [60,] -0.500909091 -0.494060606 [61,] -0.684242424 -0.500909091 [62,] -0.734242424 -0.684242424 [63,] -0.850909091 -0.734242424 [64,] -0.617575758 -0.850909091 [65,] -0.100909091 -0.617575758 [66,] -0.334242424 -0.100909091 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.249090909 -0.165757576 2 -0.199090909 -0.249090909 3 0.184242424 -0.199090909 4 0.317575758 0.184242424 5 0.134242424 0.317575758 6 0.200909091 0.134242424 7 0.014060606 0.200909091 8 0.054060606 0.014060606 9 0.201090909 0.054060606 10 0.121090909 0.201090909 11 0.141090909 0.121090909 12 0.234242424 0.141090909 13 0.150909091 0.234242424 14 -0.199090909 0.150909091 15 -0.615757576 -0.199090909 16 -0.682424242 -0.615757576 17 -0.565757576 -0.682424242 18 0.200909091 -0.565757576 19 0.514060606 0.200909091 20 0.454060606 0.514060606 21 0.001090909 0.454060606 22 -0.278909091 0.001090909 23 -0.358909091 -0.278909091 24 -0.265757576 -0.358909091 25 0.050909091 -0.265757576 26 0.100909091 0.050909091 27 0.084242424 0.100909091 28 0.317575758 0.084242424 29 -0.065757576 0.317575758 30 0.100909091 -0.065757576 31 0.014060606 0.100909091 32 0.054060606 0.014060606 33 0.665939394 0.054060606 34 0.785939394 0.665939394 35 0.805939394 0.785939394 36 0.899090909 0.805939394 37 1.015757576 0.899090909 38 1.065757576 1.015757576 39 1.149090909 1.065757576 40 0.782424242 1.149090909 41 0.399090909 0.782424242 42 -0.134242424 0.399090909 43 -0.121090909 -0.134242424 44 0.018909091 -0.121090909 45 -0.034060606 0.018909091 46 -0.014060606 -0.034060606 47 -0.094060606 -0.014060606 48 -0.200909091 -0.094060606 49 -0.284242424 -0.200909091 50 -0.034242424 -0.284242424 51 0.049090909 -0.034242424 52 -0.117575758 0.049090909 53 0.199090909 -0.117575758 54 -0.034242424 0.199090909 55 -0.421090909 -0.034242424 56 -0.581090909 -0.421090909 57 -0.834060606 -0.581090909 58 -0.614060606 -0.834060606 59 -0.494060606 -0.614060606 60 -0.500909091 -0.494060606 61 -0.684242424 -0.500909091 62 -0.734242424 -0.684242424 63 -0.850909091 -0.734242424 64 -0.617575758 -0.850909091 65 -0.100909091 -0.617575758 66 -0.334242424 -0.100909091 > 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/73f421228170319.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/8t0jr1228170319.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/99jfp1228170319.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/10dd671228170319.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/11cw671228170319.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/12obwl1228170319.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/13uvx01228170319.tab") > > system("convert tmp/1g1b41228170319.ps tmp/1g1b41228170319.png") > system("convert tmp/292qa1228170319.ps tmp/292qa1228170319.png") > system("convert tmp/31nup1228170319.ps tmp/31nup1228170319.png") > system("convert tmp/4t9se1228170319.ps tmp/4t9se1228170319.png") > system("convert tmp/5sltr1228170319.ps tmp/5sltr1228170319.png") > system("convert tmp/6udr71228170319.ps tmp/6udr71228170319.png") > system("convert tmp/73f421228170319.ps tmp/73f421228170319.png") > system("convert tmp/8t0jr1228170319.ps tmp/8t0jr1228170319.png") > system("convert tmp/99jfp1228170319.ps tmp/99jfp1228170319.png") > > > proc.time() user system elapsed 1.936 1.405 2.284