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 <- c(44.9,48.1,52.3,48.9,52.6,60.3,50.5,41.6,56,51.4,52.9,54.9,43.9,51,51.9,54.3,50.3,57.2,48.8,41.1,58,63,53.8,54.7,55.5,56.1,69.6,69.4,57.2,68,53.3,47.9,60.8,61.7,57.8,51.4,50.5,48.1,58.7,54,56.1,60.4,51.2,50.7,56.4,53.3,52.6,47.7,49.5,48.5,55.3,49.8,57.4,64.6,53,41.5,55.9,58.4,53.5,50.6,58.5) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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!) > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1jy5p1229090794.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2rvfa1229090794.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.243776417 -0.085120896 0.189325588 0.076090940 [6] 0.077845440 0.306865760 0.109291188 -0.086939103 -0.012229393 [11] -0.208121017 -0.025585130 0.372895266 -0.048226814 -0.269508127 [16] -0.092585727 -0.052654913 -0.125055837 0.058346790 -0.041655871 [21] -0.221444775 -0.140836298 -0.285188498 -0.098464802 0.155006068 [26] -0.110167354 -0.256748494 -0.034349031 -0.047700337 -0.107191779 [31] 0.076456786 0.030674799 -0.031484000 0.022247975 -0.118186925 [36] 0.035286373 0.196167410 0.020217484 -0.102195902 0.045797812 [41] 0.016105454 -0.057496710 0.051221980 0.048780334 -0.022631064 [46] 0.015555005 -0.024298303 0.030581379 0.112542183 0.020281467 [51] -0.082849857 0.001701224 0.021179890 -0.060346313 0.007953375 [56] 0.057243411 -0.014761293 -0.025006753 0.006793062 0.001288058 [61] -0.018487604 > (mypacf <- c(rpacf$acf)) [1] 0.243776417 -0.153680606 0.273018227 -0.083858035 0.171568834 [6] 0.223148032 -0.027160851 -0.058869828 -0.087661886 -0.310889729 [11] 0.135279083 0.282139317 -0.195927798 -0.062953713 -0.167025224 [16] 0.118302846 -0.127471822 -0.009620607 -0.103359394 -0.046052895 [21] -0.021709080 -0.194918680 0.066750162 -0.042680628 -0.019829580 [26] -0.016103730 0.071256075 -0.081232171 0.030636566 -0.107696058 [31] 0.072268869 0.044534237 0.022733536 -0.070713385 0.005766051 [36] -0.010656378 -0.003317008 -0.034764138 -0.112886804 0.023135726 [41] -0.072555231 -0.031182590 -0.038941074 -0.068228622 0.054048667 [46] 0.059828877 -0.002578642 -0.037744619 -0.014777546 -0.045835155 [51] -0.065710270 0.010442417 -0.046504375 0.015092267 0.069705280 [56] -0.027931856 0.038977702 0.022746942 -0.095107084 -0.095530516 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3z8j61229090794.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4ajqv1229090794.tab") > > system("convert tmp/1jy5p1229090794.ps tmp/1jy5p1229090794.png") > system("convert tmp/2rvfa1229090794.ps tmp/2rvfa1229090794.png") > > > proc.time() user system elapsed 0.593 0.311 0.695