R version 2.6.0 (2007-10-03) 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(100.6 + ,115.9 + ,59.7 + ,125 + ,96.1 + ,112.9 + ,58.2 + ,121.7 + ,110 + ,126.3 + ,75.3 + ,134.3 + ,108.2 + ,116.8 + ,69 + ,124.3 + ,106.9 + ,112 + ,66.1 + ,119.1 + ,117.2 + ,129.7 + ,77.5 + ,137.8 + ,105.2 + ,113.6 + ,69.3 + ,120.5 + ,106.3 + ,115.7 + ,70.2 + ,122.7 + ,95.9 + ,119.5 + ,70.2 + ,127.2 + ,107.5 + ,125.8 + ,78.2 + ,133.2 + ,113 + ,129.6 + ,85.4 + ,136.3 + ,111.4 + ,128 + ,82.4 + ,134.9 + ,95.5 + ,112.8 + ,61.2 + ,120.9 + ,90.3 + ,101.6 + ,52.2 + ,109.4 + ,110.8 + ,123.9 + ,85.3 + ,129.6 + ,107.1 + ,118.8 + ,79.9 + ,124.7 + ,101.4 + ,109.1 + ,72.2 + ,114.6 + ,112.9 + ,130.6 + ,85.7 + ,137.4 + ,98.5 + ,112.4 + ,75.5 + ,117.9 + ,100.1 + ,111 + ,69.2 + ,117.4 + ,93.4 + ,116.2 + ,77.6 + ,122 + ,104.4 + ,119.8 + ,85.3 + ,124.8 + ,101.8 + ,117.2 + ,77 + ,123.3 + ,107.9 + ,127.3 + ,89.9 + ,132.8 + ,91.3 + ,107.7 + ,60 + ,115.1 + ,86.6 + ,97.5 + ,54.3 + ,104.2 + ,111.4 + ,120.1 + ,84 + ,125.5 + ,98.4 + ,110.6 + ,69.9 + ,116.8 + ,102.2 + ,111.3 + ,75.1 + ,116.8 + ,103 + ,119.8 + ,81.7 + ,125.5 + ,95.8 + ,105.5 + ,69.9 + ,110.9 + ,96 + ,108.7 + ,68.3 + ,114.9 + ,95.7 + ,128.7 + ,77.3 + ,136.4 + ,106.4 + ,119.5 + ,77.4 + ,125.8 + ,112 + ,121.1 + ,85.3 + ,126.5 + ,116.2 + ,128.4 + ,91 + ,134 + ,93.9 + ,108.8 + ,60.6 + ,116.1 + ,100.5 + ,107.5 + ,57.6 + ,115 + ,112.5 + ,125.6 + ,93.8 + ,130.3 + ,101.2 + ,102.9 + ,78.7 + ,106.5 + ,107.8 + ,107.5 + ,80.3 + ,111.6 + ,114.3 + ,120.4 + ,89.8 + ,125 + ,99.6 + ,104.3 + ,77.5 + ,108.3 + ,98.6 + ,100.6 + ,71.7 + ,105 + ,93.6 + ,121.9 + ,83.2 + ,127.4 + ,99.6 + ,112.7 + ,86.2 + ,116.6 + ,113.1 + ,124.9 + ,100.7 + ,128.6 + ,110.7 + ,123.9 + ,100.8 + ,127.5 + ,88.1 + ,102.2 + ,57.1 + ,108.4 + ,93.1 + ,104.9 + ,62.5 + ,110.8 + ,107.4 + ,109.8 + ,79.7 + ,114.2 + ,99.5 + ,98.9 + ,80.3 + ,101.8 + ,105.6 + ,107.3 + ,92.4 + ,109.8 + ,108.3 + ,112.6 + ,91.8 + ,115.9 + ,99.2 + ,104 + ,85.8 + ,106.9 + ,99.3 + ,110.6 + ,84.2 + ,114.6 + ,107.1 + ,100.8 + ,93.1 + ,105.4 + ,106.9 + ,103.8 + ,101.2 + ,108.1 + ,115.4 + ,117 + ,100.6 + ,118.4 + ,99 + ,108.4 + ,106.7 + ,112.7 + ,100.1 + ,95.5 + ,64 + ,98.4 + ,96.2 + ,96.9 + ,67.5 + ,99.6 + ,96.9 + ,103.9 + ,101 + ,103.9 + ,96.2 + ,101.1 + ,95.5 + ,101.5 + ,91 + ,100.6 + ,97 + ,100.8 + ,99 + ,104.3 + ,103.8 + ,104.5 + ,99 + ,98 + ,95.2 + ,98.2 + ,107.2 + ,99.5 + ,86.7 + ,99.9 + ,110.8 + ,97.4 + ,93.5 + ,97.5 + ,111.1 + ,105.6 + ,102.5 + ,105.7 + ,104.6 + ,117.5 + ,112.3 + ,117.7 + ,94.3 + ,107.4 + ,105.5 + ,107.4 + ,90.7 + ,97.8 + ,75.4 + ,98.4 + ,88.8 + ,91.5 + ,70.4 + ,92 + ,90.9 + ,107.7 + ,108 + ,107.7 + ,90.5 + ,100.1 + ,100 + ,100.2 + ,95.5 + ,96.6 + ,93.3 + ,96.7 + ,103.1 + ,106.8 + ,111.1 + ,106.8 + ,100.6 + ,98 + ,101.1 + ,98 + ,103.1 + ,98.6 + ,98.1 + ,98.6) + ,dim=c(4 + ,80) + ,dimnames=list(c('1' + ,'2' + ,'3' + ,'4 ') + ,1:80)) > y <- array(NA,dim=c(4,80),dimnames=list(c('1','2','3','4 '),1:80)) > 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 = '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 1 2 3 4\r t 1 100.6 115.9 59.7 125.0 1 2 96.1 112.9 58.2 121.7 2 3 110.0 126.3 75.3 134.3 3 4 108.2 116.8 69.0 124.3 4 5 106.9 112.0 66.1 119.1 5 6 117.2 129.7 77.5 137.8 6 7 105.2 113.6 69.3 120.5 7 8 106.3 115.7 70.2 122.7 8 9 95.9 119.5 70.2 127.2 9 10 107.5 125.8 78.2 133.2 10 11 113.0 129.6 85.4 136.3 11 12 111.4 128.0 82.4 134.9 12 13 95.5 112.8 61.2 120.9 13 14 90.3 101.6 52.2 109.4 14 15 110.8 123.9 85.3 129.6 15 16 107.1 118.8 79.9 124.7 16 17 101.4 109.1 72.2 114.6 17 18 112.9 130.6 85.7 137.4 18 19 98.5 112.4 75.5 117.9 19 20 100.1 111.0 69.2 117.4 20 21 93.4 116.2 77.6 122.0 21 22 104.4 119.8 85.3 124.8 22 23 101.8 117.2 77.0 123.3 23 24 107.9 127.3 89.9 132.8 24 25 91.3 107.7 60.0 115.1 25 26 86.6 97.5 54.3 104.2 26 27 111.4 120.1 84.0 125.5 27 28 98.4 110.6 69.9 116.8 28 29 102.2 111.3 75.1 116.8 29 30 103.0 119.8 81.7 125.5 30 31 95.8 105.5 69.9 110.9 31 32 96.0 108.7 68.3 114.9 32 33 95.7 128.7 77.3 136.4 33 34 106.4 119.5 77.4 125.8 34 35 112.0 121.1 85.3 126.5 35 36 116.2 128.4 91.0 134.0 36 37 93.9 108.8 60.6 116.1 37 38 100.5 107.5 57.6 115.0 38 39 112.5 125.6 93.8 130.3 39 40 101.2 102.9 78.7 106.5 40 41 107.8 107.5 80.3 111.6 41 42 114.3 120.4 89.8 125.0 42 43 99.6 104.3 77.5 108.3 43 44 98.6 100.6 71.7 105.0 44 45 93.6 121.9 83.2 127.4 45 46 99.6 112.7 86.2 116.6 46 47 113.1 124.9 100.7 128.6 47 48 110.7 123.9 100.8 127.5 48 49 88.1 102.2 57.1 108.4 49 50 93.1 104.9 62.5 110.8 50 51 107.4 109.8 79.7 114.2 51 52 99.5 98.9 80.3 101.8 52 53 105.6 107.3 92.4 109.8 53 54 108.3 112.6 91.8 115.9 54 55 99.2 104.0 85.8 106.9 55 56 99.3 110.6 84.2 114.6 56 57 107.1 100.8 93.1 105.4 57 58 106.9 103.8 101.2 108.1 58 59 115.4 117.0 100.6 118.4 59 60 99.0 108.4 106.7 112.7 60 61 100.1 95.5 64.0 98.4 61 62 96.2 96.9 67.5 99.6 62 63 96.9 103.9 101.0 103.9 63 64 96.2 101.1 95.5 101.5 64 65 91.0 100.6 97.0 100.8 65 66 99.0 104.3 103.8 104.5 66 67 99.0 98.0 95.2 98.2 67 68 107.2 99.5 86.7 99.9 68 69 110.8 97.4 93.5 97.5 69 70 111.1 105.6 102.5 105.7 70 71 104.6 117.5 112.3 117.7 71 72 94.3 107.4 105.5 107.4 72 73 90.7 97.8 75.4 98.4 73 74 88.8 91.5 70.4 92.0 74 75 90.9 107.7 108.0 107.7 75 76 90.5 100.1 100.0 100.2 76 77 95.5 96.6 93.3 96.7 77 78 103.1 106.8 111.1 106.8 78 79 100.6 98.0 101.1 98.0 79 80 103.1 98.6 98.1 98.6 80 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `2` `3` `4\r` t 53.2369 0.7611 0.2174 -0.4238 -0.1159 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -13.45761 -3.46544 -0.08957 3.44238 12.41665 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 53.23685 11.31065 4.707 1.13e-05 *** `2` 0.76106 0.84948 0.896 0.3732 `3` 0.21744 0.10491 2.073 0.0416 * `4\r` -0.42377 0.76957 -0.551 0.5835 t -0.11586 0.07277 -1.592 0.1156 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.582 on 75 degrees of freedom Multiple R-Squared: 0.479, Adjusted R-squared: 0.4512 F-statistic: 17.24 on 4 and 75 DF, p-value: 4.567e-10 > postscript(file="/var/www/html/rcomp/tmp/1fhg21196595445.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/2vczu1196595445.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/3x7qc1196595445.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/4gexn1196595445.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/5xeqi1196595445.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 = 80 Frequency = 1 1 2 3 4 5 6 -0.73812599 -3.91135819 1.52749046 4.20562741 5.10156397 7.49227966 7 8 9 10 11 12 2.31304141 2.66726748 -8.60193978 -0.87769831 1.59421832 1.38683022 13 14 15 16 17 18 -4.15214639 -3.62876145 1.37818894 0.77318458 -0.03442089 1.94508728 19 20 21 22 23 24 -4.53332815 -0.59396974 -11.01281679 -3.12454119 -2.46079137 -2.71086291 25 26 27 28 29 30 -5.27735513 -5.47833518 4.80575379 -1.46914278 0.78326351 -2.51822761 31 32 33 34 35 36 -2.34039704 -2.41694163 -10.66824259 2.63567015 5.71266064 6.41161827 37 38 39 40 41 42 -1.83090467 6.06052016 3.01337398 2.30299812 7.33129353 7.74226478 43 44 45 46 47 48 1.00881046 2.80333094 -11.29956613 -3.41099696 2.85221647 0.84124506 49 50 51 52 53 54 -3.71956104 -0.81571782 7.57171717 2.69792424 3.27995528 4.77765623 55 56 57 58 59 60 -0.17062492 -1.36682653 8.17347676 5.18903153 8.25420534 -5.22673196 61 62 63 64 65 66 9.03179883 3.92964138 -6.04410514 -4.31837936 -9.64479544 -4.25553559 67 68 69 70 71 72 -0.14472101 9.59823841 12.41665185 8.10972671 -4.37675169 -9.76038832 73 74 75 76 77 78 -3.20718976 -1.82155362 -13.45760946 -9.39640793 -1.64315144 -1.28054928 79 80 1.47791384 4.54373401 > postscript(file="/var/www/html/rcomp/tmp/6ucl81196595445.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 = 80 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.73812599 NA 1 -3.91135819 -0.73812599 2 1.52749046 -3.91135819 3 4.20562741 1.52749046 4 5.10156397 4.20562741 5 7.49227966 5.10156397 6 2.31304141 7.49227966 7 2.66726748 2.31304141 8 -8.60193978 2.66726748 9 -0.87769831 -8.60193978 10 1.59421832 -0.87769831 11 1.38683022 1.59421832 12 -4.15214639 1.38683022 13 -3.62876145 -4.15214639 14 1.37818894 -3.62876145 15 0.77318458 1.37818894 16 -0.03442089 0.77318458 17 1.94508728 -0.03442089 18 -4.53332815 1.94508728 19 -0.59396974 -4.53332815 20 -11.01281679 -0.59396974 21 -3.12454119 -11.01281679 22 -2.46079137 -3.12454119 23 -2.71086291 -2.46079137 24 -5.27735513 -2.71086291 25 -5.47833518 -5.27735513 26 4.80575379 -5.47833518 27 -1.46914278 4.80575379 28 0.78326351 -1.46914278 29 -2.51822761 0.78326351 30 -2.34039704 -2.51822761 31 -2.41694163 -2.34039704 32 -10.66824259 -2.41694163 33 2.63567015 -10.66824259 34 5.71266064 2.63567015 35 6.41161827 5.71266064 36 -1.83090467 6.41161827 37 6.06052016 -1.83090467 38 3.01337398 6.06052016 39 2.30299812 3.01337398 40 7.33129353 2.30299812 41 7.74226478 7.33129353 42 1.00881046 7.74226478 43 2.80333094 1.00881046 44 -11.29956613 2.80333094 45 -3.41099696 -11.29956613 46 2.85221647 -3.41099696 47 0.84124506 2.85221647 48 -3.71956104 0.84124506 49 -0.81571782 -3.71956104 50 7.57171717 -0.81571782 51 2.69792424 7.57171717 52 3.27995528 2.69792424 53 4.77765623 3.27995528 54 -0.17062492 4.77765623 55 -1.36682653 -0.17062492 56 8.17347676 -1.36682653 57 5.18903153 8.17347676 58 8.25420534 5.18903153 59 -5.22673196 8.25420534 60 9.03179883 -5.22673196 61 3.92964138 9.03179883 62 -6.04410514 3.92964138 63 -4.31837936 -6.04410514 64 -9.64479544 -4.31837936 65 -4.25553559 -9.64479544 66 -0.14472101 -4.25553559 67 9.59823841 -0.14472101 68 12.41665185 9.59823841 69 8.10972671 12.41665185 70 -4.37675169 8.10972671 71 -9.76038832 -4.37675169 72 -3.20718976 -9.76038832 73 -1.82155362 -3.20718976 74 -13.45760946 -1.82155362 75 -9.39640793 -13.45760946 76 -1.64315144 -9.39640793 77 -1.28054928 -1.64315144 78 1.47791384 -1.28054928 79 4.54373401 1.47791384 80 NA 4.54373401 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.91135819 -0.73812599 [2,] 1.52749046 -3.91135819 [3,] 4.20562741 1.52749046 [4,] 5.10156397 4.20562741 [5,] 7.49227966 5.10156397 [6,] 2.31304141 7.49227966 [7,] 2.66726748 2.31304141 [8,] -8.60193978 2.66726748 [9,] -0.87769831 -8.60193978 [10,] 1.59421832 -0.87769831 [11,] 1.38683022 1.59421832 [12,] -4.15214639 1.38683022 [13,] -3.62876145 -4.15214639 [14,] 1.37818894 -3.62876145 [15,] 0.77318458 1.37818894 [16,] -0.03442089 0.77318458 [17,] 1.94508728 -0.03442089 [18,] -4.53332815 1.94508728 [19,] -0.59396974 -4.53332815 [20,] -11.01281679 -0.59396974 [21,] -3.12454119 -11.01281679 [22,] -2.46079137 -3.12454119 [23,] -2.71086291 -2.46079137 [24,] -5.27735513 -2.71086291 [25,] -5.47833518 -5.27735513 [26,] 4.80575379 -5.47833518 [27,] -1.46914278 4.80575379 [28,] 0.78326351 -1.46914278 [29,] -2.51822761 0.78326351 [30,] -2.34039704 -2.51822761 [31,] -2.41694163 -2.34039704 [32,] -10.66824259 -2.41694163 [33,] 2.63567015 -10.66824259 [34,] 5.71266064 2.63567015 [35,] 6.41161827 5.71266064 [36,] -1.83090467 6.41161827 [37,] 6.06052016 -1.83090467 [38,] 3.01337398 6.06052016 [39,] 2.30299812 3.01337398 [40,] 7.33129353 2.30299812 [41,] 7.74226478 7.33129353 [42,] 1.00881046 7.74226478 [43,] 2.80333094 1.00881046 [44,] -11.29956613 2.80333094 [45,] -3.41099696 -11.29956613 [46,] 2.85221647 -3.41099696 [47,] 0.84124506 2.85221647 [48,] -3.71956104 0.84124506 [49,] -0.81571782 -3.71956104 [50,] 7.57171717 -0.81571782 [51,] 2.69792424 7.57171717 [52,] 3.27995528 2.69792424 [53,] 4.77765623 3.27995528 [54,] -0.17062492 4.77765623 [55,] -1.36682653 -0.17062492 [56,] 8.17347676 -1.36682653 [57,] 5.18903153 8.17347676 [58,] 8.25420534 5.18903153 [59,] -5.22673196 8.25420534 [60,] 9.03179883 -5.22673196 [61,] 3.92964138 9.03179883 [62,] -6.04410514 3.92964138 [63,] -4.31837936 -6.04410514 [64,] -9.64479544 -4.31837936 [65,] -4.25553559 -9.64479544 [66,] -0.14472101 -4.25553559 [67,] 9.59823841 -0.14472101 [68,] 12.41665185 9.59823841 [69,] 8.10972671 12.41665185 [70,] -4.37675169 8.10972671 [71,] -9.76038832 -4.37675169 [72,] -3.20718976 -9.76038832 [73,] -1.82155362 -3.20718976 [74,] -13.45760946 -1.82155362 [75,] -9.39640793 -13.45760946 [76,] -1.64315144 -9.39640793 [77,] -1.28054928 -1.64315144 [78,] 1.47791384 -1.28054928 [79,] 4.54373401 1.47791384 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.91135819 -0.73812599 2 1.52749046 -3.91135819 3 4.20562741 1.52749046 4 5.10156397 4.20562741 5 7.49227966 5.10156397 6 2.31304141 7.49227966 7 2.66726748 2.31304141 8 -8.60193978 2.66726748 9 -0.87769831 -8.60193978 10 1.59421832 -0.87769831 11 1.38683022 1.59421832 12 -4.15214639 1.38683022 13 -3.62876145 -4.15214639 14 1.37818894 -3.62876145 15 0.77318458 1.37818894 16 -0.03442089 0.77318458 17 1.94508728 -0.03442089 18 -4.53332815 1.94508728 19 -0.59396974 -4.53332815 20 -11.01281679 -0.59396974 21 -3.12454119 -11.01281679 22 -2.46079137 -3.12454119 23 -2.71086291 -2.46079137 24 -5.27735513 -2.71086291 25 -5.47833518 -5.27735513 26 4.80575379 -5.47833518 27 -1.46914278 4.80575379 28 0.78326351 -1.46914278 29 -2.51822761 0.78326351 30 -2.34039704 -2.51822761 31 -2.41694163 -2.34039704 32 -10.66824259 -2.41694163 33 2.63567015 -10.66824259 34 5.71266064 2.63567015 35 6.41161827 5.71266064 36 -1.83090467 6.41161827 37 6.06052016 -1.83090467 38 3.01337398 6.06052016 39 2.30299812 3.01337398 40 7.33129353 2.30299812 41 7.74226478 7.33129353 42 1.00881046 7.74226478 43 2.80333094 1.00881046 44 -11.29956613 2.80333094 45 -3.41099696 -11.29956613 46 2.85221647 -3.41099696 47 0.84124506 2.85221647 48 -3.71956104 0.84124506 49 -0.81571782 -3.71956104 50 7.57171717 -0.81571782 51 2.69792424 7.57171717 52 3.27995528 2.69792424 53 4.77765623 3.27995528 54 -0.17062492 4.77765623 55 -1.36682653 -0.17062492 56 8.17347676 -1.36682653 57 5.18903153 8.17347676 58 8.25420534 5.18903153 59 -5.22673196 8.25420534 60 9.03179883 -5.22673196 61 3.92964138 9.03179883 62 -6.04410514 3.92964138 63 -4.31837936 -6.04410514 64 -9.64479544 -4.31837936 65 -4.25553559 -9.64479544 66 -0.14472101 -4.25553559 67 9.59823841 -0.14472101 68 12.41665185 9.59823841 69 8.10972671 12.41665185 70 -4.37675169 8.10972671 71 -9.76038832 -4.37675169 72 -3.20718976 -9.76038832 73 -1.82155362 -3.20718976 74 -13.45760946 -1.82155362 75 -9.39640793 -13.45760946 76 -1.64315144 -9.39640793 77 -1.28054928 -1.64315144 78 1.47791384 -1.28054928 79 4.54373401 1.47791384 > 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/7uogl1196595445.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/80e2x1196595445.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/9o1sg1196595445.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/10mxcd1196595445.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/11mrsp1196595445.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/1294ir1196595446.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/13c7s51196595446.tab") > > system("convert tmp/1fhg21196595445.ps tmp/1fhg21196595445.png") > system("convert tmp/2vczu1196595445.ps tmp/2vczu1196595445.png") > system("convert tmp/3x7qc1196595445.ps tmp/3x7qc1196595445.png") > system("convert tmp/4gexn1196595445.ps tmp/4gexn1196595445.png") > system("convert tmp/5xeqi1196595445.ps tmp/5xeqi1196595445.png") > system("convert tmp/6ucl81196595445.ps tmp/6ucl81196595445.png") > system("convert tmp/7uogl1196595445.ps tmp/7uogl1196595445.png") > system("convert tmp/80e2x1196595445.ps tmp/80e2x1196595445.png") > system("convert tmp/9o1sg1196595445.ps tmp/9o1sg1196595445.png") > > > proc.time() user system elapsed 2.382 1.454 2.875