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(20.7246301,0,21.44580352,0,22.09413114,0,21.53321848,0,23.3470789,0,23.5656163,0,26.42117166,0,25.21193138,0,26.43574082,0,29.33500366,0,29.40056488,0,33.05013946,0,28.38072368,0,26.0059506,0,29.31314992,0,30.36212944,0,35.74543406,0,36.15337054,0,34.20838768,0,37.90895432,0,38.70297354,0,42.11944156,0,42.16314904,0,39.79566054,0,37.36261082,0,38.3533137,0,42.60022384,0,41.24529196,0,42.15586446,0,46.94183352,0,47.42990038,0,47.0583868,0,50.18347162,0,50.12519498,0,43.22669772,0,40.04333626,0,40.37114236,0,42.2141411,0,36.99838182,0,39.74466848,0,42.68035422,0,46.2935059,0,46.97097184,0,48.72655562,0,52.36884562,0,50.05234918,0,54.03701444,0,57.78128856,0,64.71620872,0,63.4122689,0,64.3592643,0,66.02743312,0,72.13919574,0,76.60464328,0,86.97060062,0,93.48301514,0,95.58825876,0,81.88596378,1,70.5511573,1,50.38015528,1,36.24807008,1),dim=c(2,61),dimnames=list(c('Olie','Dumivariabele'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Olie','Dumivariabele'),1:61)) > 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 Olie Dumivariabele M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 20.72463 0 1 0 0 0 0 0 0 0 0 0 0 1 2 21.44580 0 0 1 0 0 0 0 0 0 0 0 0 2 3 22.09413 0 0 0 1 0 0 0 0 0 0 0 0 3 4 21.53322 0 0 0 0 1 0 0 0 0 0 0 0 4 5 23.34708 0 0 0 0 0 1 0 0 0 0 0 0 5 6 23.56562 0 0 0 0 0 0 1 0 0 0 0 0 6 7 26.42117 0 0 0 0 0 0 0 1 0 0 0 0 7 8 25.21193 0 0 0 0 0 0 0 0 1 0 0 0 8 9 26.43574 0 0 0 0 0 0 0 0 0 1 0 0 9 10 29.33500 0 0 0 0 0 0 0 0 0 0 1 0 10 11 29.40056 0 0 0 0 0 0 0 0 0 0 0 1 11 12 33.05014 0 0 0 0 0 0 0 0 0 0 0 0 12 13 28.38072 0 1 0 0 0 0 0 0 0 0 0 0 13 14 26.00595 0 0 1 0 0 0 0 0 0 0 0 0 14 15 29.31315 0 0 0 1 0 0 0 0 0 0 0 0 15 16 30.36213 0 0 0 0 1 0 0 0 0 0 0 0 16 17 35.74543 0 0 0 0 0 1 0 0 0 0 0 0 17 18 36.15337 0 0 0 0 0 0 1 0 0 0 0 0 18 19 34.20839 0 0 0 0 0 0 0 1 0 0 0 0 19 20 37.90895 0 0 0 0 0 0 0 0 1 0 0 0 20 21 38.70297 0 0 0 0 0 0 0 0 0 1 0 0 21 22 42.11944 0 0 0 0 0 0 0 0 0 0 1 0 22 23 42.16315 0 0 0 0 0 0 0 0 0 0 0 1 23 24 39.79566 0 0 0 0 0 0 0 0 0 0 0 0 24 25 37.36261 0 1 0 0 0 0 0 0 0 0 0 0 25 26 38.35331 0 0 1 0 0 0 0 0 0 0 0 0 26 27 42.60022 0 0 0 1 0 0 0 0 0 0 0 0 27 28 41.24529 0 0 0 0 1 0 0 0 0 0 0 0 28 29 42.15586 0 0 0 0 0 1 0 0 0 0 0 0 29 30 46.94183 0 0 0 0 0 0 1 0 0 0 0 0 30 31 47.42990 0 0 0 0 0 0 0 1 0 0 0 0 31 32 47.05839 0 0 0 0 0 0 0 0 1 0 0 0 32 33 50.18347 0 0 0 0 0 0 0 0 0 1 0 0 33 34 50.12519 0 0 0 0 0 0 0 0 0 0 1 0 34 35 43.22670 0 0 0 0 0 0 0 0 0 0 0 1 35 36 40.04334 0 0 0 0 0 0 0 0 0 0 0 0 36 37 40.37114 0 1 0 0 0 0 0 0 0 0 0 0 37 38 42.21414 0 0 1 0 0 0 0 0 0 0 0 0 38 39 36.99838 0 0 0 1 0 0 0 0 0 0 0 0 39 40 39.74467 0 0 0 0 1 0 0 0 0 0 0 0 40 41 42.68035 0 0 0 0 0 1 0 0 0 0 0 0 41 42 46.29351 0 0 0 0 0 0 1 0 0 0 0 0 42 43 46.97097 0 0 0 0 0 0 0 1 0 0 0 0 43 44 48.72656 0 0 0 0 0 0 0 0 1 0 0 0 44 45 52.36885 0 0 0 0 0 0 0 0 0 1 0 0 45 46 50.05235 0 0 0 0 0 0 0 0 0 0 1 0 46 47 54.03701 0 0 0 0 0 0 0 0 0 0 0 1 47 48 57.78129 0 0 0 0 0 0 0 0 0 0 0 0 48 49 64.71621 0 1 0 0 0 0 0 0 0 0 0 0 49 50 63.41227 0 0 1 0 0 0 0 0 0 0 0 0 50 51 64.35926 0 0 0 1 0 0 0 0 0 0 0 0 51 52 66.02743 0 0 0 0 1 0 0 0 0 0 0 0 52 53 72.13920 0 0 0 0 0 1 0 0 0 0 0 0 53 54 76.60464 0 0 0 0 0 0 1 0 0 0 0 0 54 55 86.97060 0 0 0 0 0 0 0 1 0 0 0 0 55 56 93.48302 0 0 0 0 0 0 0 0 1 0 0 0 56 57 95.58826 0 0 0 0 0 0 0 0 0 1 0 0 57 58 81.88596 1 0 0 0 0 0 0 0 0 0 1 0 58 59 70.55116 1 0 0 0 0 0 0 0 0 0 0 1 59 60 50.38016 1 0 0 0 0 0 0 0 0 0 0 0 60 61 36.24807 1 1 0 0 0 0 0 0 0 0 0 0 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Dumivariabele M1 M2 M3 13.6377 -10.6175 -2.0557 1.0349 0.9134 M4 M5 M6 M7 M8 0.7147 3.2375 5.0275 6.6077 7.7770 M9 M10 M11 t 9.0469 8.3099 4.5738 0.9082 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -20.118 -4.423 0.191 3.548 21.208 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 13.63768 4.81914 2.830 0.00683 ** Dumivariabele -10.61746 5.67324 -1.871 0.06751 . M1 -2.05570 5.62034 -0.366 0.71619 M2 1.03489 5.95570 0.174 0.86280 M3 0.91341 5.95266 0.153 0.87870 M4 0.71470 5.95058 0.120 0.90491 M5 3.23752 5.94944 0.544 0.58890 M6 5.02751 5.94926 0.845 0.40236 M7 6.60770 5.95003 1.111 0.27242 M8 7.77704 5.95175 1.307 0.19768 M9 9.04691 5.95443 1.519 0.13537 M10 8.30992 5.86123 1.418 0.16285 M11 4.57382 5.85978 0.781 0.43898 t 0.90822 0.07529 12.063 5.37e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 9.264 on 47 degrees of freedom Multiple R-squared: 0.7892, Adjusted R-squared: 0.7309 F-statistic: 13.53 on 13 and 47 DF, p-value: 9.118e-12 > postscript(file="/var/www/html/freestat/rcomp/tmp/1ppc61229870508.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/2bntb1229870508.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/3vmmq1229870508.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/42wss1229870508.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/51qfk1229870508.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 = 61 Frequency = 1 1 2 3 4 5 6 8.23443210 4.95679532 4.81838830 3.54795755 1.93078079 -0.54889025 7 8 9 10 11 12 -0.18174741 -3.46854991 -4.42282989 -1.69479110 1.19864407 8.51381931 13 14 15 16 17 18 4.99188200 -1.38170128 1.13876340 1.47822482 3.43049226 1.14022031 19 20 21 22 23 24 -3.29317508 -1.67017065 -3.05424085 0.19100312 3.06258455 4.36069671 25 26 27 28 29 30 3.07512546 0.06701814 3.52719364 1.46274366 -1.05772102 1.03003961 31 32 33 34 35 36 -0.97030606 -3.41938185 -2.47238645 -2.70188714 -6.77251045 -6.29027125 37 38 39 40 41 42 -4.81498668 -6.97079814 -12.97329206 -10.93652350 -11.43187494 -10.51693169 43 44 45 46 47 48 -12.32787828 -12.64985671 -11.18565613 -13.67337663 -6.86083741 0.54903737 49 50 51 52 53 54 8.63143599 3.32868597 3.48894673 4.44759746 7.12832290 8.89556201 55 56 57 58 59 60 16.77310682 21.20795913 21.13511333 17.87905176 9.37211923 -7.13328213 61 -20.11788886 > postscript(file="/var/www/html/freestat/rcomp/tmp/6q38a1229870508.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 8.23443210 NA 1 4.95679532 8.23443210 2 4.81838830 4.95679532 3 3.54795755 4.81838830 4 1.93078079 3.54795755 5 -0.54889025 1.93078079 6 -0.18174741 -0.54889025 7 -3.46854991 -0.18174741 8 -4.42282989 -3.46854991 9 -1.69479110 -4.42282989 10 1.19864407 -1.69479110 11 8.51381931 1.19864407 12 4.99188200 8.51381931 13 -1.38170128 4.99188200 14 1.13876340 -1.38170128 15 1.47822482 1.13876340 16 3.43049226 1.47822482 17 1.14022031 3.43049226 18 -3.29317508 1.14022031 19 -1.67017065 -3.29317508 20 -3.05424085 -1.67017065 21 0.19100312 -3.05424085 22 3.06258455 0.19100312 23 4.36069671 3.06258455 24 3.07512546 4.36069671 25 0.06701814 3.07512546 26 3.52719364 0.06701814 27 1.46274366 3.52719364 28 -1.05772102 1.46274366 29 1.03003961 -1.05772102 30 -0.97030606 1.03003961 31 -3.41938185 -0.97030606 32 -2.47238645 -3.41938185 33 -2.70188714 -2.47238645 34 -6.77251045 -2.70188714 35 -6.29027125 -6.77251045 36 -4.81498668 -6.29027125 37 -6.97079814 -4.81498668 38 -12.97329206 -6.97079814 39 -10.93652350 -12.97329206 40 -11.43187494 -10.93652350 41 -10.51693169 -11.43187494 42 -12.32787828 -10.51693169 43 -12.64985671 -12.32787828 44 -11.18565613 -12.64985671 45 -13.67337663 -11.18565613 46 -6.86083741 -13.67337663 47 0.54903737 -6.86083741 48 8.63143599 0.54903737 49 3.32868597 8.63143599 50 3.48894673 3.32868597 51 4.44759746 3.48894673 52 7.12832290 4.44759746 53 8.89556201 7.12832290 54 16.77310682 8.89556201 55 21.20795913 16.77310682 56 21.13511333 21.20795913 57 17.87905176 21.13511333 58 9.37211923 17.87905176 59 -7.13328213 9.37211923 60 -20.11788886 -7.13328213 61 NA -20.11788886 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.95679532 8.23443210 [2,] 4.81838830 4.95679532 [3,] 3.54795755 4.81838830 [4,] 1.93078079 3.54795755 [5,] -0.54889025 1.93078079 [6,] -0.18174741 -0.54889025 [7,] -3.46854991 -0.18174741 [8,] -4.42282989 -3.46854991 [9,] -1.69479110 -4.42282989 [10,] 1.19864407 -1.69479110 [11,] 8.51381931 1.19864407 [12,] 4.99188200 8.51381931 [13,] -1.38170128 4.99188200 [14,] 1.13876340 -1.38170128 [15,] 1.47822482 1.13876340 [16,] 3.43049226 1.47822482 [17,] 1.14022031 3.43049226 [18,] -3.29317508 1.14022031 [19,] -1.67017065 -3.29317508 [20,] -3.05424085 -1.67017065 [21,] 0.19100312 -3.05424085 [22,] 3.06258455 0.19100312 [23,] 4.36069671 3.06258455 [24,] 3.07512546 4.36069671 [25,] 0.06701814 3.07512546 [26,] 3.52719364 0.06701814 [27,] 1.46274366 3.52719364 [28,] -1.05772102 1.46274366 [29,] 1.03003961 -1.05772102 [30,] -0.97030606 1.03003961 [31,] -3.41938185 -0.97030606 [32,] -2.47238645 -3.41938185 [33,] -2.70188714 -2.47238645 [34,] -6.77251045 -2.70188714 [35,] -6.29027125 -6.77251045 [36,] -4.81498668 -6.29027125 [37,] -6.97079814 -4.81498668 [38,] -12.97329206 -6.97079814 [39,] -10.93652350 -12.97329206 [40,] -11.43187494 -10.93652350 [41,] -10.51693169 -11.43187494 [42,] -12.32787828 -10.51693169 [43,] -12.64985671 -12.32787828 [44,] -11.18565613 -12.64985671 [45,] -13.67337663 -11.18565613 [46,] -6.86083741 -13.67337663 [47,] 0.54903737 -6.86083741 [48,] 8.63143599 0.54903737 [49,] 3.32868597 8.63143599 [50,] 3.48894673 3.32868597 [51,] 4.44759746 3.48894673 [52,] 7.12832290 4.44759746 [53,] 8.89556201 7.12832290 [54,] 16.77310682 8.89556201 [55,] 21.20795913 16.77310682 [56,] 21.13511333 21.20795913 [57,] 17.87905176 21.13511333 [58,] 9.37211923 17.87905176 [59,] -7.13328213 9.37211923 [60,] -20.11788886 -7.13328213 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.95679532 8.23443210 2 4.81838830 4.95679532 3 3.54795755 4.81838830 4 1.93078079 3.54795755 5 -0.54889025 1.93078079 6 -0.18174741 -0.54889025 7 -3.46854991 -0.18174741 8 -4.42282989 -3.46854991 9 -1.69479110 -4.42282989 10 1.19864407 -1.69479110 11 8.51381931 1.19864407 12 4.99188200 8.51381931 13 -1.38170128 4.99188200 14 1.13876340 -1.38170128 15 1.47822482 1.13876340 16 3.43049226 1.47822482 17 1.14022031 3.43049226 18 -3.29317508 1.14022031 19 -1.67017065 -3.29317508 20 -3.05424085 -1.67017065 21 0.19100312 -3.05424085 22 3.06258455 0.19100312 23 4.36069671 3.06258455 24 3.07512546 4.36069671 25 0.06701814 3.07512546 26 3.52719364 0.06701814 27 1.46274366 3.52719364 28 -1.05772102 1.46274366 29 1.03003961 -1.05772102 30 -0.97030606 1.03003961 31 -3.41938185 -0.97030606 32 -2.47238645 -3.41938185 33 -2.70188714 -2.47238645 34 -6.77251045 -2.70188714 35 -6.29027125 -6.77251045 36 -4.81498668 -6.29027125 37 -6.97079814 -4.81498668 38 -12.97329206 -6.97079814 39 -10.93652350 -12.97329206 40 -11.43187494 -10.93652350 41 -10.51693169 -11.43187494 42 -12.32787828 -10.51693169 43 -12.64985671 -12.32787828 44 -11.18565613 -12.64985671 45 -13.67337663 -11.18565613 46 -6.86083741 -13.67337663 47 0.54903737 -6.86083741 48 8.63143599 0.54903737 49 3.32868597 8.63143599 50 3.48894673 3.32868597 51 4.44759746 3.48894673 52 7.12832290 4.44759746 53 8.89556201 7.12832290 54 16.77310682 8.89556201 55 21.20795913 16.77310682 56 21.13511333 21.20795913 57 17.87905176 21.13511333 58 9.37211923 17.87905176 59 -7.13328213 9.37211923 60 -20.11788886 -7.13328213 > 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/7j8nt1229870508.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/8damy1229870508.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/958s71229870508.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/10pm4z1229870508.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/11wgj21229870508.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/123b0n1229870508.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/13526f1229870508.tab") > > system("convert tmp/1ppc61229870508.ps tmp/1ppc61229870508.png") > system("convert tmp/2bntb1229870508.ps tmp/2bntb1229870508.png") > system("convert tmp/3vmmq1229870508.ps tmp/3vmmq1229870508.png") > system("convert tmp/42wss1229870508.ps tmp/42wss1229870508.png") > system("convert tmp/51qfk1229870508.ps tmp/51qfk1229870508.png") > system("convert tmp/6q38a1229870508.ps tmp/6q38a1229870508.png") > system("convert tmp/7j8nt1229870508.ps tmp/7j8nt1229870508.png") > system("convert tmp/8damy1229870508.ps tmp/8damy1229870508.png") > system("convert tmp/958s71229870508.ps tmp/958s71229870508.png") > > > proc.time() user system elapsed 3.070 2.304 5.493