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(21.1,21,20.4,19.5,18.6,18.8,23.7,24.8,25,23.6,22.3,21.8,20.8,19.7,18.3,17.4,17,18.1,23.9,25.6,25.3,23.6,21.9,21.4,20.6,20.5,20.2,20.6,19.7,19.3,22.8,23.5,23.8,22.6,22,21.7,20.7,20.2,19.1,19.5,18.7,18.6,22.2,23.2,23.5,21.3,20,18.7,18.9,18.3,18.4,19.9,19.2,18.5,20.9,20.5,19.4,18.1,17,17) > par5 = '12' > par4 = '1' > par3 = '0' > 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/rcomp/tmp/1ip341229858261.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/2s3xn1229858261.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.814620226 0.445943489 0.044810797 -0.194962633 [6] -0.195951133 -0.014775602 0.221508104 0.357861975 0.348492346 [11] 0.168732177 -0.046457895 -0.205020631 -0.221361660 -0.096575292 [16] 0.070605942 0.177194575 0.135568542 -0.023637906 -0.204730558 [21] -0.320377022 -0.313969272 -0.193128858 -0.012506920 0.122372851 [26] 0.155082669 0.046085749 -0.135154958 -0.301673973 -0.374886948 [31] -0.327848103 -0.200731498 -0.065825979 0.002551915 -0.005974451 [36] -0.066680104 -0.125763603 -0.161969581 -0.129871290 -0.055133522 [41] 0.031281180 0.095230336 0.113269960 0.088354688 0.046683596 [46] 0.016914737 -0.003964461 -0.004232003 > (mypacf <- c(rpacf$acf)) [1] 0.814620226 -0.647046907 -0.135112159 0.346906588 0.254934648 [6] -0.003018136 -0.009737983 -0.098956578 0.105524998 -0.231267091 [11] 0.130891141 0.003391207 0.042140053 0.045600486 -0.115740309 [16] -0.122078097 -0.107026436 -0.034666082 0.187557910 -0.205419755 [21] -0.045557522 0.090313327 0.104699592 -0.092507908 -0.068886790 [26] -0.160694928 0.110416400 -0.137295579 -0.024415154 -0.149858385 [31] 0.020316190 -0.020851780 0.019507089 -0.073239918 0.138742255 [36] -0.079754775 -0.042102092 0.069447699 -0.021927782 -0.010012915 [41] 0.145194337 0.030826938 0.012494187 -0.104364923 0.056179484 [46] -0.095880674 -0.098870543 > 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/3tjtx1229858262.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/4e6hy1229858262.tab") > > system("convert tmp/1ip341229858261.ps tmp/1ip341229858261.png") > system("convert tmp/2s3xn1229858261.ps tmp/2s3xn1229858261.png") > > > proc.time() user system elapsed 0.576 0.309 0.740