R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485,18730,14538),dim=c(1,84),dimnames=list(c('y'),1:84)) > y <- array(NA,dim=c(1,84),dimnames=list(c('y'),1:84)) > 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 = '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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 31514 1 0 0 0 0 0 0 0 0 0 0 2 27071 0 1 0 0 0 0 0 0 0 0 0 3 29462 0 0 1 0 0 0 0 0 0 0 0 4 26105 0 0 0 1 0 0 0 0 0 0 0 5 22397 0 0 0 0 1 0 0 0 0 0 0 6 23843 0 0 0 0 0 1 0 0 0 0 0 7 21705 0 0 0 0 0 0 1 0 0 0 0 8 18089 0 0 0 0 0 0 0 1 0 0 0 9 20764 0 0 0 0 0 0 0 0 1 0 0 10 25316 0 0 0 0 0 0 0 0 0 1 0 11 17704 0 0 0 0 0 0 0 0 0 0 1 12 15548 0 0 0 0 0 0 0 0 0 0 0 13 28029 1 0 0 0 0 0 0 0 0 0 0 14 29383 0 1 0 0 0 0 0 0 0 0 0 15 36438 0 0 1 0 0 0 0 0 0 0 0 16 32034 0 0 0 1 0 0 0 0 0 0 0 17 22679 0 0 0 0 1 0 0 0 0 0 0 18 24319 0 0 0 0 0 1 0 0 0 0 0 19 18004 0 0 0 0 0 0 1 0 0 0 0 20 17537 0 0 0 0 0 0 0 1 0 0 0 21 20366 0 0 0 0 0 0 0 0 1 0 0 22 22782 0 0 0 0 0 0 0 0 0 1 0 23 19169 0 0 0 0 0 0 0 0 0 0 1 24 13807 0 0 0 0 0 0 0 0 0 0 0 25 29743 1 0 0 0 0 0 0 0 0 0 0 26 25591 0 1 0 0 0 0 0 0 0 0 0 27 29096 0 0 1 0 0 0 0 0 0 0 0 28 26482 0 0 0 1 0 0 0 0 0 0 0 29 22405 0 0 0 0 1 0 0 0 0 0 0 30 27044 0 0 0 0 0 1 0 0 0 0 0 31 17970 0 0 0 0 0 0 1 0 0 0 0 32 18730 0 0 0 0 0 0 0 1 0 0 0 33 19684 0 0 0 0 0 0 0 0 1 0 0 34 19785 0 0 0 0 0 0 0 0 0 1 0 35 18479 0 0 0 0 0 0 0 0 0 0 1 36 10698 0 0 0 0 0 0 0 0 0 0 0 37 31956 1 0 0 0 0 0 0 0 0 0 0 38 29506 0 1 0 0 0 0 0 0 0 0 0 39 34506 0 0 1 0 0 0 0 0 0 0 0 40 27165 0 0 0 1 0 0 0 0 0 0 0 41 26736 0 0 0 0 1 0 0 0 0 0 0 42 23691 0 0 0 0 0 1 0 0 0 0 0 43 18157 0 0 0 0 0 0 1 0 0 0 0 44 17328 0 0 0 0 0 0 0 1 0 0 0 45 18205 0 0 0 0 0 0 0 0 1 0 0 46 20995 0 0 0 0 0 0 0 0 0 1 0 47 17382 0 0 0 0 0 0 0 0 0 0 1 48 9367 0 0 0 0 0 0 0 0 0 0 0 49 31124 1 0 0 0 0 0 0 0 0 0 0 50 26551 0 1 0 0 0 0 0 0 0 0 0 51 30651 0 0 1 0 0 0 0 0 0 0 0 52 25859 0 0 0 1 0 0 0 0 0 0 0 53 25100 0 0 0 0 1 0 0 0 0 0 0 54 25778 0 0 0 0 0 1 0 0 0 0 0 55 20418 0 0 0 0 0 0 1 0 0 0 0 56 18688 0 0 0 0 0 0 0 1 0 0 0 57 20424 0 0 0 0 0 0 0 0 1 0 0 58 24776 0 0 0 0 0 0 0 0 0 1 0 59 19814 0 0 0 0 0 0 0 0 0 0 1 60 12738 0 0 0 0 0 0 0 0 0 0 0 61 31566 1 0 0 0 0 0 0 0 0 0 0 62 30111 0 1 0 0 0 0 0 0 0 0 0 63 30019 0 0 1 0 0 0 0 0 0 0 0 64 31934 0 0 0 1 0 0 0 0 0 0 0 65 25826 0 0 0 0 1 0 0 0 0 0 0 66 26835 0 0 0 0 0 1 0 0 0 0 0 67 20205 0 0 0 0 0 0 1 0 0 0 0 68 17789 0 0 0 0 0 0 0 1 0 0 0 69 20520 0 0 0 0 0 0 0 0 1 0 0 70 22518 0 0 0 0 0 0 0 0 0 1 0 71 15572 0 0 0 0 0 0 0 0 0 0 1 72 11509 0 0 0 0 0 0 0 0 0 0 0 73 25447 1 0 0 0 0 0 0 0 0 0 0 74 24090 0 1 0 0 0 0 0 0 0 0 0 75 27786 0 0 1 0 0 0 0 0 0 0 0 76 26195 0 0 0 1 0 0 0 0 0 0 0 77 20516 0 0 0 0 1 0 0 0 0 0 0 78 22759 0 0 0 0 0 1 0 0 0 0 0 79 19028 0 0 0 0 0 0 1 0 0 0 0 80 16971 0 0 0 0 0 0 0 1 0 0 0 81 20036 0 0 0 0 0 0 0 0 1 0 0 82 22485 0 0 0 0 0 0 0 0 0 1 0 83 18730 0 0 0 0 0 0 0 0 0 0 1 84 14538 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) M1 M2 M3 M4 M5 12601 17311 14871 18536 15367 11065 M6 M7 M8 M9 M10 M11 12295 6755 5275 7399 10065 5521 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4464.3 -1289.3 -174.3 1268.1 5301.1 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 12600.7 772.4 16.314 < 2e-16 *** M1 17310.6 1092.4 15.847 < 2e-16 *** M2 14871.1 1092.4 13.614 < 2e-16 *** M3 18536.1 1092.4 16.969 < 2e-16 *** M4 15367.0 1092.4 14.068 < 2e-16 *** M5 11064.9 1092.4 10.129 1.71e-15 *** M6 12294.9 1092.4 11.255 < 2e-16 *** M7 6754.6 1092.4 6.184 3.40e-08 *** M8 5275.3 1092.4 4.829 7.48e-06 *** M9 7399.1 1092.4 6.774 2.88e-09 *** M10 10064.6 1092.4 9.214 8.37e-14 *** M11 5520.7 1092.4 5.054 3.17e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2044 on 72 degrees of freedom Multiple R-squared: 0.8888, Adjusted R-squared: 0.8718 F-statistic: 52.31 on 11 and 72 DF, p-value: < 2.2e-16 > postscript(file="/var/www/html/rcomp/tmp/1bds91291913847.ps",horizontal=F,onefile=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/2m4ru1291913847.ps",horizontal=F,onefile=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/3m4ru1291913847.ps",horizontal=F,onefile=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/4m4ru1291913847.ps",horizontal=F,onefile=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/5xd9x1291913847.ps",horizontal=F,onefile=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 = 84 Frequency = 1 1 2 3 4 5 6 1602.71429 -400.85714 -1674.85714 -1862.71429 -1268.57143 -1052.57143 7 8 9 10 11 12 2349.71429 213.00000 764.14286 2650.71429 -417.42857 2947.28571 13 14 15 16 17 18 -1882.28571 1911.14286 5301.14286 4066.28571 -986.57143 -576.57143 19 20 21 22 23 24 -1351.28571 -339.00000 366.14286 116.71429 1047.57143 1206.28571 25 26 27 28 29 30 -168.28571 -1880.85714 -2040.85714 -1485.71429 -1260.57143 2148.42857 31 32 33 34 35 36 -1385.28571 854.00000 -315.85714 -2880.28571 357.57143 -1902.71429 37 38 39 40 41 42 2044.71429 2034.14286 3369.14286 -802.71429 3070.42857 -1204.57143 43 44 45 46 47 48 -1198.28571 -548.00000 -1794.85714 -1670.28571 -739.42857 -3233.71429 49 50 51 52 53 54 1212.71429 -920.85714 -485.85714 -2108.71429 1434.42857 882.42857 55 56 57 58 59 60 1062.71429 812.00000 424.14286 2110.71429 1692.57143 137.28571 61 62 63 64 65 66 1654.71429 2639.14286 -1117.85714 3966.28571 2160.42857 1939.42857 67 68 69 70 71 72 849.71429 -87.00000 520.14286 -147.28571 -2549.42857 -1091.71429 73 74 75 76 77 78 -4464.28571 -3381.85714 -3350.85714 -1772.71429 -3149.57143 -2136.57143 79 80 81 82 83 84 -327.28571 -905.00000 36.14286 -180.28571 608.57143 1937.28571 > postscript(file="/var/www/html/rcomp/tmp/6xd9x1291913847.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 84 Frequency = 1 lag(myerror, k = 1) myerror 0 1602.71429 NA 1 -400.85714 1602.71429 2 -1674.85714 -400.85714 3 -1862.71429 -1674.85714 4 -1268.57143 -1862.71429 5 -1052.57143 -1268.57143 6 2349.71429 -1052.57143 7 213.00000 2349.71429 8 764.14286 213.00000 9 2650.71429 764.14286 10 -417.42857 2650.71429 11 2947.28571 -417.42857 12 -1882.28571 2947.28571 13 1911.14286 -1882.28571 14 5301.14286 1911.14286 15 4066.28571 5301.14286 16 -986.57143 4066.28571 17 -576.57143 -986.57143 18 -1351.28571 -576.57143 19 -339.00000 -1351.28571 20 366.14286 -339.00000 21 116.71429 366.14286 22 1047.57143 116.71429 23 1206.28571 1047.57143 24 -168.28571 1206.28571 25 -1880.85714 -168.28571 26 -2040.85714 -1880.85714 27 -1485.71429 -2040.85714 28 -1260.57143 -1485.71429 29 2148.42857 -1260.57143 30 -1385.28571 2148.42857 31 854.00000 -1385.28571 32 -315.85714 854.00000 33 -2880.28571 -315.85714 34 357.57143 -2880.28571 35 -1902.71429 357.57143 36 2044.71429 -1902.71429 37 2034.14286 2044.71429 38 3369.14286 2034.14286 39 -802.71429 3369.14286 40 3070.42857 -802.71429 41 -1204.57143 3070.42857 42 -1198.28571 -1204.57143 43 -548.00000 -1198.28571 44 -1794.85714 -548.00000 45 -1670.28571 -1794.85714 46 -739.42857 -1670.28571 47 -3233.71429 -739.42857 48 1212.71429 -3233.71429 49 -920.85714 1212.71429 50 -485.85714 -920.85714 51 -2108.71429 -485.85714 52 1434.42857 -2108.71429 53 882.42857 1434.42857 54 1062.71429 882.42857 55 812.00000 1062.71429 56 424.14286 812.00000 57 2110.71429 424.14286 58 1692.57143 2110.71429 59 137.28571 1692.57143 60 1654.71429 137.28571 61 2639.14286 1654.71429 62 -1117.85714 2639.14286 63 3966.28571 -1117.85714 64 2160.42857 3966.28571 65 1939.42857 2160.42857 66 849.71429 1939.42857 67 -87.00000 849.71429 68 520.14286 -87.00000 69 -147.28571 520.14286 70 -2549.42857 -147.28571 71 -1091.71429 -2549.42857 72 -4464.28571 -1091.71429 73 -3381.85714 -4464.28571 74 -3350.85714 -3381.85714 75 -1772.71429 -3350.85714 76 -3149.57143 -1772.71429 77 -2136.57143 -3149.57143 78 -327.28571 -2136.57143 79 -905.00000 -327.28571 80 36.14286 -905.00000 81 -180.28571 36.14286 82 608.57143 -180.28571 83 1937.28571 608.57143 84 NA 1937.28571 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -400.85714 1602.71429 [2,] -1674.85714 -400.85714 [3,] -1862.71429 -1674.85714 [4,] -1268.57143 -1862.71429 [5,] -1052.57143 -1268.57143 [6,] 2349.71429 -1052.57143 [7,] 213.00000 2349.71429 [8,] 764.14286 213.00000 [9,] 2650.71429 764.14286 [10,] -417.42857 2650.71429 [11,] 2947.28571 -417.42857 [12,] -1882.28571 2947.28571 [13,] 1911.14286 -1882.28571 [14,] 5301.14286 1911.14286 [15,] 4066.28571 5301.14286 [16,] -986.57143 4066.28571 [17,] -576.57143 -986.57143 [18,] -1351.28571 -576.57143 [19,] -339.00000 -1351.28571 [20,] 366.14286 -339.00000 [21,] 116.71429 366.14286 [22,] 1047.57143 116.71429 [23,] 1206.28571 1047.57143 [24,] -168.28571 1206.28571 [25,] -1880.85714 -168.28571 [26,] -2040.85714 -1880.85714 [27,] -1485.71429 -2040.85714 [28,] -1260.57143 -1485.71429 [29,] 2148.42857 -1260.57143 [30,] -1385.28571 2148.42857 [31,] 854.00000 -1385.28571 [32,] -315.85714 854.00000 [33,] -2880.28571 -315.85714 [34,] 357.57143 -2880.28571 [35,] -1902.71429 357.57143 [36,] 2044.71429 -1902.71429 [37,] 2034.14286 2044.71429 [38,] 3369.14286 2034.14286 [39,] -802.71429 3369.14286 [40,] 3070.42857 -802.71429 [41,] -1204.57143 3070.42857 [42,] -1198.28571 -1204.57143 [43,] -548.00000 -1198.28571 [44,] -1794.85714 -548.00000 [45,] -1670.28571 -1794.85714 [46,] -739.42857 -1670.28571 [47,] -3233.71429 -739.42857 [48,] 1212.71429 -3233.71429 [49,] -920.85714 1212.71429 [50,] -485.85714 -920.85714 [51,] -2108.71429 -485.85714 [52,] 1434.42857 -2108.71429 [53,] 882.42857 1434.42857 [54,] 1062.71429 882.42857 [55,] 812.00000 1062.71429 [56,] 424.14286 812.00000 [57,] 2110.71429 424.14286 [58,] 1692.57143 2110.71429 [59,] 137.28571 1692.57143 [60,] 1654.71429 137.28571 [61,] 2639.14286 1654.71429 [62,] -1117.85714 2639.14286 [63,] 3966.28571 -1117.85714 [64,] 2160.42857 3966.28571 [65,] 1939.42857 2160.42857 [66,] 849.71429 1939.42857 [67,] -87.00000 849.71429 [68,] 520.14286 -87.00000 [69,] -147.28571 520.14286 [70,] -2549.42857 -147.28571 [71,] -1091.71429 -2549.42857 [72,] -4464.28571 -1091.71429 [73,] -3381.85714 -4464.28571 [74,] -3350.85714 -3381.85714 [75,] -1772.71429 -3350.85714 [76,] -3149.57143 -1772.71429 [77,] -2136.57143 -3149.57143 [78,] -327.28571 -2136.57143 [79,] -905.00000 -327.28571 [80,] 36.14286 -905.00000 [81,] -180.28571 36.14286 [82,] 608.57143 -180.28571 [83,] 1937.28571 608.57143 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -400.85714 1602.71429 2 -1674.85714 -400.85714 3 -1862.71429 -1674.85714 4 -1268.57143 -1862.71429 5 -1052.57143 -1268.57143 6 2349.71429 -1052.57143 7 213.00000 2349.71429 8 764.14286 213.00000 9 2650.71429 764.14286 10 -417.42857 2650.71429 11 2947.28571 -417.42857 12 -1882.28571 2947.28571 13 1911.14286 -1882.28571 14 5301.14286 1911.14286 15 4066.28571 5301.14286 16 -986.57143 4066.28571 17 -576.57143 -986.57143 18 -1351.28571 -576.57143 19 -339.00000 -1351.28571 20 366.14286 -339.00000 21 116.71429 366.14286 22 1047.57143 116.71429 23 1206.28571 1047.57143 24 -168.28571 1206.28571 25 -1880.85714 -168.28571 26 -2040.85714 -1880.85714 27 -1485.71429 -2040.85714 28 -1260.57143 -1485.71429 29 2148.42857 -1260.57143 30 -1385.28571 2148.42857 31 854.00000 -1385.28571 32 -315.85714 854.00000 33 -2880.28571 -315.85714 34 357.57143 -2880.28571 35 -1902.71429 357.57143 36 2044.71429 -1902.71429 37 2034.14286 2044.71429 38 3369.14286 2034.14286 39 -802.71429 3369.14286 40 3070.42857 -802.71429 41 -1204.57143 3070.42857 42 -1198.28571 -1204.57143 43 -548.00000 -1198.28571 44 -1794.85714 -548.00000 45 -1670.28571 -1794.85714 46 -739.42857 -1670.28571 47 -3233.71429 -739.42857 48 1212.71429 -3233.71429 49 -920.85714 1212.71429 50 -485.85714 -920.85714 51 -2108.71429 -485.85714 52 1434.42857 -2108.71429 53 882.42857 1434.42857 54 1062.71429 882.42857 55 812.00000 1062.71429 56 424.14286 812.00000 57 2110.71429 424.14286 58 1692.57143 2110.71429 59 137.28571 1692.57143 60 1654.71429 137.28571 61 2639.14286 1654.71429 62 -1117.85714 2639.14286 63 3966.28571 -1117.85714 64 2160.42857 3966.28571 65 1939.42857 2160.42857 66 849.71429 1939.42857 67 -87.00000 849.71429 68 520.14286 -87.00000 69 -147.28571 520.14286 70 -2549.42857 -147.28571 71 -1091.71429 -2549.42857 72 -4464.28571 -1091.71429 73 -3381.85714 -4464.28571 74 -3350.85714 -3381.85714 75 -1772.71429 -3350.85714 76 -3149.57143 -1772.71429 77 -2136.57143 -3149.57143 78 -327.28571 -2136.57143 79 -905.00000 -327.28571 80 36.14286 -905.00000 81 -180.28571 36.14286 82 608.57143 -180.28571 83 1937.28571 608.57143 > 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/7748i1291913847.ps",horizontal=F,onefile=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/8748i1291913847.ps",horizontal=F,onefile=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/9748i1291913847.ps",horizontal=F,onefile=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') hat values (leverages) are all = 0.1428571 and there are no factor predictors; no plot no. 5 > 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/104wo91291913847.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/11e55u1291913847.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/12lokn1291913847.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/13op0t1291913847.tab") > > try(system("convert tmp/1bds91291913847.ps tmp/1bds91291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/2m4ru1291913847.ps tmp/2m4ru1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/3m4ru1291913847.ps tmp/3m4ru1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/4m4ru1291913847.ps tmp/4m4ru1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/5xd9x1291913847.ps tmp/5xd9x1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/6xd9x1291913847.ps tmp/6xd9x1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/7748i1291913847.ps tmp/7748i1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/8748i1291913847.ps tmp/8748i1291913847.png",intern=TRUE)) character(0) > try(system("convert tmp/9748i1291913847.ps tmp/9748i1291913847.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.030 1.475 6.276