R version 2.6.1 (2007-11-26) Copyright (C) 2007 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(115.4 + ,126.6 + ,117 + ,106.9 + ,93.9 + ,103.8 + ,107.1 + ,89.8 + ,100.8 + ,99.3 + ,93.4 + ,110.6 + ,99.2 + ,101.5 + ,104 + ,108.3 + ,110.4 + ,112.6 + ,105.6 + ,105.9 + ,107.3 + ,99.5 + ,108.4 + ,98.9 + ,107.4 + ,113.9 + ,109.8 + ,93.1 + ,86.1 + ,104.9 + ,88.1 + ,69.4 + ,102.2 + ,110.7 + ,101.2 + ,123.9 + ,113.1 + ,100.5 + ,124.9 + ,99.6 + ,98 + ,112.7 + ,93.6 + ,106.6 + ,121.9 + ,98.6 + ,90.1 + ,100.6 + ,99.6 + ,96.9 + ,104.3 + ,114.3 + ,125.9 + ,120.4 + ,107.8 + ,112 + ,107.5 + ,101.2 + ,100 + ,102.9 + ,112.5 + ,123.9 + ,125.6 + ,100.5 + ,79.8 + ,107.5 + ,93.9 + ,83.4 + ,108.8 + ,116.2 + ,113.6 + ,128.4 + ,112 + ,112.9 + ,121.1 + ,106.4 + ,104 + ,119.5 + ,95.7 + ,109.9 + ,128.7 + ,96 + ,99 + ,108.7 + ,95.8 + ,106.3 + ,105.5 + ,103 + ,128.9 + ,119.8 + ,102.2 + ,111.1 + ,111.3 + ,98.4 + ,102.9 + ,110.6 + ,111.4 + ,130 + ,120.1 + ,86.6 + ,87 + ,97.5 + ,91.3 + ,87.5 + ,107.7 + ,107.9 + ,117.6 + ,127.3 + ,101.8 + ,103.4 + ,117.2 + ,104.4 + ,110.8 + ,119.8 + ,93.4 + ,112.6 + ,116.2 + ,100.1 + ,102.5 + ,111 + ,98.5 + ,112.4 + ,112.4 + ,112.9 + ,135.6 + ,130.6 + ,101.4 + ,105.1 + ,109.1 + ,107.1 + ,127.7 + ,118.8 + ,110.8 + ,137 + ,123.9 + ,90.3 + ,91 + ,101.6 + ,95.5 + ,90.5 + ,112.8 + ,111.4 + ,122.4 + ,128 + ,113 + ,123.3 + ,129.6 + ,107.5 + ,124.3 + ,125.8 + ,95.9 + ,120 + ,119.5 + ,106.3 + ,118.1 + ,115.7 + ,105.2 + ,119 + ,113.6 + ,117.2 + ,142.7 + ,129.7 + ,106.9 + ,123.6 + ,112 + ,108.2 + ,129.6 + ,116.8 + ,113 + ,151.6 + ,127 + ,96.1 + ,108.7 + ,112.9 + ,100.2 + ,99.3 + ,113.3 + ,108.1 + ,126.4 + ,121.7) + ,dim=c(3 + ,60) + ,dimnames=list(c('Interm' + ,'Invest' + ,'Consum') + ,1:60)) > y <- array(NA,dim=c(3,60),dimnames=list(c('Interm','Invest','Consum'),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 = 'No Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '3' > #'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 Consum Interm Invest M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 117.0 115.4 126.6 1 0 0 0 0 0 0 0 0 0 0 2 103.8 106.9 93.9 0 1 0 0 0 0 0 0 0 0 0 3 100.8 107.1 89.8 0 0 1 0 0 0 0 0 0 0 0 4 110.6 99.3 93.4 0 0 0 1 0 0 0 0 0 0 0 5 104.0 99.2 101.5 0 0 0 0 1 0 0 0 0 0 0 6 112.6 108.3 110.4 0 0 0 0 0 1 0 0 0 0 0 7 107.3 105.6 105.9 0 0 0 0 0 0 1 0 0 0 0 8 98.9 99.5 108.4 0 0 0 0 0 0 0 1 0 0 0 9 109.8 107.4 113.9 0 0 0 0 0 0 0 0 1 0 0 10 104.9 93.1 86.1 0 0 0 0 0 0 0 0 0 1 0 11 102.2 88.1 69.4 0 0 0 0 0 0 0 0 0 0 1 12 123.9 110.7 101.2 0 0 0 0 0 0 0 0 0 0 0 13 124.9 113.1 100.5 1 0 0 0 0 0 0 0 0 0 0 14 112.7 99.6 98.0 0 1 0 0 0 0 0 0 0 0 0 15 121.9 93.6 106.6 0 0 1 0 0 0 0 0 0 0 0 16 100.6 98.6 90.1 0 0 0 1 0 0 0 0 0 0 0 17 104.3 99.6 96.9 0 0 0 0 1 0 0 0 0 0 0 18 120.4 114.3 125.9 0 0 0 0 0 1 0 0 0 0 0 19 107.5 107.8 112.0 0 0 0 0 0 0 1 0 0 0 0 20 102.9 101.2 100.0 0 0 0 0 0 0 0 1 0 0 0 21 125.6 112.5 123.9 0 0 0 0 0 0 0 0 1 0 0 22 107.5 100.5 79.8 0 0 0 0 0 0 0 0 0 1 0 23 108.8 93.9 83.4 0 0 0 0 0 0 0 0 0 0 1 24 128.4 116.2 113.6 0 0 0 0 0 0 0 0 0 0 0 25 121.1 112.0 112.9 1 0 0 0 0 0 0 0 0 0 0 26 119.5 106.4 104.0 0 1 0 0 0 0 0 0 0 0 0 27 128.7 95.7 109.9 0 0 1 0 0 0 0 0 0 0 0 28 108.7 96.0 99.0 0 0 0 1 0 0 0 0 0 0 0 29 105.5 95.8 106.3 0 0 0 0 1 0 0 0 0 0 0 30 119.8 103.0 128.9 0 0 0 0 0 1 0 0 0 0 0 31 111.3 102.2 111.1 0 0 0 0 0 0 1 0 0 0 0 32 110.6 98.4 102.9 0 0 0 0 0 0 0 1 0 0 0 33 120.1 111.4 130.0 0 0 0 0 0 0 0 0 1 0 0 34 97.5 86.6 87.0 0 0 0 0 0 0 0 0 0 1 0 35 107.7 91.3 87.5 0 0 0 0 0 0 0 0 0 0 1 36 127.3 107.9 117.6 0 0 0 0 0 0 0 0 0 0 0 37 117.2 101.8 103.4 1 0 0 0 0 0 0 0 0 0 0 38 119.8 104.4 110.8 0 1 0 0 0 0 0 0 0 0 0 39 116.2 93.4 112.6 0 0 1 0 0 0 0 0 0 0 0 40 111.0 100.1 102.5 0 0 0 1 0 0 0 0 0 0 0 41 112.4 98.5 112.4 0 0 0 0 1 0 0 0 0 0 0 42 130.6 112.9 135.6 0 0 0 0 0 1 0 0 0 0 0 43 109.1 101.4 105.1 0 0 0 0 0 0 1 0 0 0 0 44 118.8 107.1 127.7 0 0 0 0 0 0 0 1 0 0 0 45 123.9 110.8 137.0 0 0 0 0 0 0 0 0 1 0 0 46 101.6 90.3 91.0 0 0 0 0 0 0 0 0 0 1 0 47 112.8 95.5 90.5 0 0 0 0 0 0 0 0 0 0 1 48 128.0 111.4 122.4 0 0 0 0 0 0 0 0 0 0 0 49 129.6 113.0 123.3 1 0 0 0 0 0 0 0 0 0 0 50 125.8 107.5 124.3 0 1 0 0 0 0 0 0 0 0 0 51 119.5 95.9 120.0 0 0 1 0 0 0 0 0 0 0 0 52 115.7 106.3 118.1 0 0 0 1 0 0 0 0 0 0 0 53 113.6 105.2 119.0 0 0 0 0 1 0 0 0 0 0 0 54 129.7 117.2 142.7 0 0 0 0 0 1 0 0 0 0 0 55 112.0 106.9 123.6 0 0 0 0 0 0 1 0 0 0 0 56 116.8 108.2 129.6 0 0 0 0 0 0 0 1 0 0 0 57 127.0 113.0 151.6 0 0 0 0 0 0 0 0 1 0 0 58 112.9 96.1 108.7 0 0 0 0 0 0 0 0 0 1 0 59 113.3 100.2 99.3 0 0 0 0 0 0 0 0 0 0 1 60 121.7 108.1 126.4 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Interm Invest M1 M2 M3 67.4292 0.1226 0.3857 -2.8060 -4.9439 -3.4942 M4 M5 M6 M7 M8 M9 -9.1907 -13.0473 -8.0802 -13.8615 -14.3093 -10.4006 M10 M11 -8.9085 -3.1517 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.9067 -2.0120 0.3386 2.3992 10.6389 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 67.42920 17.63962 3.823 0.000395 *** Interm 0.12265 0.16926 0.725 0.472358 Invest 0.38570 0.06445 5.985 3.05e-07 *** M1 -2.80600 2.98025 -0.942 0.351352 M2 -4.94393 3.12901 -1.580 0.120953 M3 -3.49422 3.69017 -0.947 0.348637 M4 -9.19073 3.44496 -2.668 0.010505 * M5 -13.04730 3.46083 -3.770 0.000464 *** M6 -8.08018 3.07585 -2.627 0.011664 * M7 -13.86150 3.12523 -4.435 5.68e-05 *** M8 -14.30929 3.24556 -4.409 6.19e-05 *** M9 -10.40057 3.12451 -3.329 0.001724 ** M10 -8.90850 4.10489 -2.170 0.035190 * M11 -3.15171 4.11248 -0.766 0.447367 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.701 on 46 degrees of freedom Multiple R-Squared: 0.787, Adjusted R-squared: 0.7268 F-statistic: 13.07 on 13 and 46 DF, p-value: 2.239e-11 > postscript(file="/var/www/html/rcomp/tmp/17so81198181092.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/2x7ol1198181092.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/3u2i81198181092.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/4ce2f1198181092.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/5v4pp1198181092.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 -10.60669821 -8.01381031 -10.90666990 4.15797805 -1.69736888 -2.61333954 7 8 9 10 11 12 -0.06521559 -8.23351471 -4.33251878 1.75178342 0.34945778 3.86057450 13 14 15 16 17 18 7.64220361 0.20015045 5.36930488 -4.48335275 0.32779850 -1.52760629 19 20 21 22 23 24 -2.48782236 -1.20212516 6.98495676 5.87410108 0.83827306 2.90330687 25 26 27 28 29 30 -0.80558130 3.85192891 10.63892721 0.50279097 -1.63172987 -1.89877828 31 32 33 34 35 36 2.34614282 5.72275737 -0.73290865 -5.19813010 -1.52421599 1.27848668 37 38 39 40 41 42 0.20960178 1.77445645 -2.62037439 0.94997521 2.58433891 5.10279754 43 44 45 46 47 48 2.55847098 3.29031457 0.44077013 -3.09473705 1.90355412 -0.30215169 49 50 51 52 53 54 3.56047412 2.18727451 -2.48118779 -1.12739148 0.41696135 0.93692657 55 56 57 58 59 60 -2.35157585 0.42256792 -2.36029946 0.66698265 -1.56706897 -7.74021636 > postscript(file="/var/www/html/rcomp/tmp/6i2731198181092.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 -10.60669821 NA 1 -8.01381031 -10.60669821 2 -10.90666990 -8.01381031 3 4.15797805 -10.90666990 4 -1.69736888 4.15797805 5 -2.61333954 -1.69736888 6 -0.06521559 -2.61333954 7 -8.23351471 -0.06521559 8 -4.33251878 -8.23351471 9 1.75178342 -4.33251878 10 0.34945778 1.75178342 11 3.86057450 0.34945778 12 7.64220361 3.86057450 13 0.20015045 7.64220361 14 5.36930488 0.20015045 15 -4.48335275 5.36930488 16 0.32779850 -4.48335275 17 -1.52760629 0.32779850 18 -2.48782236 -1.52760629 19 -1.20212516 -2.48782236 20 6.98495676 -1.20212516 21 5.87410108 6.98495676 22 0.83827306 5.87410108 23 2.90330687 0.83827306 24 -0.80558130 2.90330687 25 3.85192891 -0.80558130 26 10.63892721 3.85192891 27 0.50279097 10.63892721 28 -1.63172987 0.50279097 29 -1.89877828 -1.63172987 30 2.34614282 -1.89877828 31 5.72275737 2.34614282 32 -0.73290865 5.72275737 33 -5.19813010 -0.73290865 34 -1.52421599 -5.19813010 35 1.27848668 -1.52421599 36 0.20960178 1.27848668 37 1.77445645 0.20960178 38 -2.62037439 1.77445645 39 0.94997521 -2.62037439 40 2.58433891 0.94997521 41 5.10279754 2.58433891 42 2.55847098 5.10279754 43 3.29031457 2.55847098 44 0.44077013 3.29031457 45 -3.09473705 0.44077013 46 1.90355412 -3.09473705 47 -0.30215169 1.90355412 48 3.56047412 -0.30215169 49 2.18727451 3.56047412 50 -2.48118779 2.18727451 51 -1.12739148 -2.48118779 52 0.41696135 -1.12739148 53 0.93692657 0.41696135 54 -2.35157585 0.93692657 55 0.42256792 -2.35157585 56 -2.36029946 0.42256792 57 0.66698265 -2.36029946 58 -1.56706897 0.66698265 59 -7.74021636 -1.56706897 60 NA -7.74021636 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -8.01381031 -10.60669821 [2,] -10.90666990 -8.01381031 [3,] 4.15797805 -10.90666990 [4,] -1.69736888 4.15797805 [5,] -2.61333954 -1.69736888 [6,] -0.06521559 -2.61333954 [7,] -8.23351471 -0.06521559 [8,] -4.33251878 -8.23351471 [9,] 1.75178342 -4.33251878 [10,] 0.34945778 1.75178342 [11,] 3.86057450 0.34945778 [12,] 7.64220361 3.86057450 [13,] 0.20015045 7.64220361 [14,] 5.36930488 0.20015045 [15,] -4.48335275 5.36930488 [16,] 0.32779850 -4.48335275 [17,] -1.52760629 0.32779850 [18,] -2.48782236 -1.52760629 [19,] -1.20212516 -2.48782236 [20,] 6.98495676 -1.20212516 [21,] 5.87410108 6.98495676 [22,] 0.83827306 5.87410108 [23,] 2.90330687 0.83827306 [24,] -0.80558130 2.90330687 [25,] 3.85192891 -0.80558130 [26,] 10.63892721 3.85192891 [27,] 0.50279097 10.63892721 [28,] -1.63172987 0.50279097 [29,] -1.89877828 -1.63172987 [30,] 2.34614282 -1.89877828 [31,] 5.72275737 2.34614282 [32,] -0.73290865 5.72275737 [33,] -5.19813010 -0.73290865 [34,] -1.52421599 -5.19813010 [35,] 1.27848668 -1.52421599 [36,] 0.20960178 1.27848668 [37,] 1.77445645 0.20960178 [38,] -2.62037439 1.77445645 [39,] 0.94997521 -2.62037439 [40,] 2.58433891 0.94997521 [41,] 5.10279754 2.58433891 [42,] 2.55847098 5.10279754 [43,] 3.29031457 2.55847098 [44,] 0.44077013 3.29031457 [45,] -3.09473705 0.44077013 [46,] 1.90355412 -3.09473705 [47,] -0.30215169 1.90355412 [48,] 3.56047412 -0.30215169 [49,] 2.18727451 3.56047412 [50,] -2.48118779 2.18727451 [51,] -1.12739148 -2.48118779 [52,] 0.41696135 -1.12739148 [53,] 0.93692657 0.41696135 [54,] -2.35157585 0.93692657 [55,] 0.42256792 -2.35157585 [56,] -2.36029946 0.42256792 [57,] 0.66698265 -2.36029946 [58,] -1.56706897 0.66698265 [59,] -7.74021636 -1.56706897 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -8.01381031 -10.60669821 2 -10.90666990 -8.01381031 3 4.15797805 -10.90666990 4 -1.69736888 4.15797805 5 -2.61333954 -1.69736888 6 -0.06521559 -2.61333954 7 -8.23351471 -0.06521559 8 -4.33251878 -8.23351471 9 1.75178342 -4.33251878 10 0.34945778 1.75178342 11 3.86057450 0.34945778 12 7.64220361 3.86057450 13 0.20015045 7.64220361 14 5.36930488 0.20015045 15 -4.48335275 5.36930488 16 0.32779850 -4.48335275 17 -1.52760629 0.32779850 18 -2.48782236 -1.52760629 19 -1.20212516 -2.48782236 20 6.98495676 -1.20212516 21 5.87410108 6.98495676 22 0.83827306 5.87410108 23 2.90330687 0.83827306 24 -0.80558130 2.90330687 25 3.85192891 -0.80558130 26 10.63892721 3.85192891 27 0.50279097 10.63892721 28 -1.63172987 0.50279097 29 -1.89877828 -1.63172987 30 2.34614282 -1.89877828 31 5.72275737 2.34614282 32 -0.73290865 5.72275737 33 -5.19813010 -0.73290865 34 -1.52421599 -5.19813010 35 1.27848668 -1.52421599 36 0.20960178 1.27848668 37 1.77445645 0.20960178 38 -2.62037439 1.77445645 39 0.94997521 -2.62037439 40 2.58433891 0.94997521 41 5.10279754 2.58433891 42 2.55847098 5.10279754 43 3.29031457 2.55847098 44 0.44077013 3.29031457 45 -3.09473705 0.44077013 46 1.90355412 -3.09473705 47 -0.30215169 1.90355412 48 3.56047412 -0.30215169 49 2.18727451 3.56047412 50 -2.48118779 2.18727451 51 -1.12739148 -2.48118779 52 0.41696135 -1.12739148 53 0.93692657 0.41696135 54 -2.35157585 0.93692657 55 0.42256792 -2.35157585 56 -2.36029946 0.42256792 57 0.66698265 -2.36029946 58 -1.56706897 0.66698265 59 -7.74021636 -1.56706897 > 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/7rr661198181092.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/8k6gw1198181092.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/91u491198181092.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 > 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/10hjzb1198181092.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/11cyop1198181092.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/123a8q1198181092.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/13paf91198181092.tab") > > system("convert tmp/17so81198181092.ps tmp/17so81198181092.png") > system("convert tmp/2x7ol1198181092.ps tmp/2x7ol1198181092.png") > system("convert tmp/3u2i81198181092.ps tmp/3u2i81198181092.png") > system("convert tmp/4ce2f1198181092.ps tmp/4ce2f1198181092.png") > system("convert tmp/5v4pp1198181092.ps tmp/5v4pp1198181092.png") > system("convert tmp/6i2731198181092.ps tmp/6i2731198181092.png") > system("convert tmp/7rr661198181092.ps tmp/7rr661198181092.png") > system("convert tmp/8k6gw1198181092.ps tmp/8k6gw1198181092.png") > system("convert tmp/91u491198181092.ps tmp/91u491198181092.png") > > > proc.time() user system elapsed 4.025 2.456 4.348