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(1,-1,3,4,3,2,1,4,3,5,6,6,6,6,6,5,6,5,6,5,7,4,5,6,6,5,3,2,3,3,2,0,4,4,5,6,6,5,5,3,5,5,5,3,6,6,4,6,5,4,5,5,4,3,2,3,2,-1,0,-2,1,-2,-2,-2,-6,-4,-2,0,-5,-4,-5,-1) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/freestat/rcomp/tmp/1zo421244135499.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/freestat/rcomp/tmp/2na2g1244135499.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.339706991 0.012182245 -0.166370759 0.117038751 [6] 0.077772774 -0.026726573 0.059635283 -0.096315736 0.038251437 [11] -0.074945693 0.095025131 0.020723015 0.003569007 -0.144419253 [16] 0.030022965 0.147439581 -0.213521851 0.103943765 -0.156748158 [21] 0.056221563 -0.052136659 0.130268318 -0.087179700 -0.113153994 [26] 0.108513509 0.030720030 0.056932431 -0.065329993 -0.095530675 [31] 0.039404010 0.126623393 -0.074164083 0.091335345 -0.052304024 [36] 0.052065917 -0.143637644 0.086850147 0.138910888 -0.069594339 [41] 0.007947230 -0.117929062 0.121379015 0.030293854 -0.052828548 [46] -0.026616147 -0.100060734 0.065071182 -0.034834266 > (mypacf <- c(rpacf$acf)) [1] -0.339706991 -0.116684030 -0.230802432 -0.032044178 0.100826987 [6] 0.029494293 0.121961092 -0.002093836 -0.004716964 -0.081371318 [11] 0.004422413 0.052464624 0.045038090 -0.114397754 -0.049380037 [16] 0.122733960 -0.203760168 -0.018560515 -0.115980874 -0.141663818 [21] -0.070489924 0.094251817 -0.030114448 -0.129708475 0.074089924 [26] 0.112256313 0.048165914 0.043373497 -0.102508933 -0.007258441 [31] 0.087972545 -0.048722246 0.131633046 -0.005886968 0.089238287 [36] -0.112282455 -0.090252029 0.043910845 0.033312892 0.057541246 [41] -0.074304484 0.058185292 0.053255760 -0.063611259 0.046652064 [46] -0.204804507 -0.084739201 -0.023891927 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'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/freestat/rcomp/tmp/3clku1244135499.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/freestat/rcomp/tmp/4p1jp1244135499.tab") > > system("convert tmp/1zo421244135499.ps tmp/1zo421244135499.png") > system("convert tmp/2na2g1244135499.ps tmp/2na2g1244135499.png") > > > proc.time() user system elapsed 0.797 0.422 0.937