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(147768,137507,136919,136151,133001,125554,119647,114158,116193,152803,161761,160942,149470,139208,134588,130322,126611,122401,117352,112135,112879,148729,157230,157221,146681,136524,132111,125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486,115867,120327,117008,108811) > 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/1pmo91229428427.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/203gn1229428427.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.808853665 0.524314893 0.283462697 0.148625081 [6] 0.092699235 0.069836111 0.060076383 0.078487242 0.195106583 [11] 0.358587745 0.539891672 0.618954196 0.447252937 0.209652735 [16] 0.014877312 -0.091081544 -0.140890880 -0.166585041 -0.180371951 [21] -0.166486990 -0.069497670 0.053823371 0.179233946 0.231078050 [26] 0.105171175 -0.056092833 -0.183592831 -0.235414086 -0.257591702 [31] -0.264211496 -0.270081214 -0.259620802 -0.191254716 -0.118471909 [36] -0.032256058 0.002865591 -0.070487167 -0.158214225 -0.208470502 [41] -0.223582788 -0.233604650 -0.236342531 -0.239939912 -0.228357857 [46] -0.176728780 -0.135680346 -0.090800030 -0.065463115 -0.087176059 [51] -0.103218887 -0.105224629 -0.092341841 -0.092420384 -0.084501689 [56] -0.077386038 -0.056834498 -0.022985906 -0.016699769 -0.016604859 [61] -0.016282434 > (mypacf <- c(rpacf$acf)) [1] 0.808853665 -0.375783651 0.013319810 0.086882819 0.005091381 [6] -0.014056913 0.021284319 0.091989969 0.317452306 0.155104801 [11] 0.294730168 0.010886684 -0.518357459 0.087503054 -0.072214633 [16] -0.121676641 0.008255642 -0.124739304 -0.005247911 -0.070923867 [21] -0.083570798 0.018872933 -0.057224809 0.093322897 -0.096000330 [26] 0.074773775 0.014485228 -0.004770184 0.030343892 -0.022445050 [31] -0.018997206 -0.027153423 -0.117495122 -0.042710237 -0.005243463 [36] -0.049781585 0.011941922 0.020747972 0.045438322 -0.110777079 [41] 0.006315739 0.001093763 -0.011779062 0.035385545 -0.018776720 [46] -0.038800222 -0.038573404 -0.003196930 0.078379146 -0.010168116 [51] -0.036955985 0.067005123 -0.026637921 0.039189468 0.035015571 [56] 0.029740011 -0.003025220 -0.035105042 -0.062448581 -0.014428432 > 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/3a7g51229428427.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/4wut21229428427.tab") > > system("convert tmp/1pmo91229428427.ps tmp/1pmo91229428427.png") > system("convert tmp/203gn1229428427.ps tmp/203gn1229428427.png") > > > proc.time() user system elapsed 0.591 0.298 0.720