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(19,23,22,23,25,25,23,22,21,16,21,21,26,23,22,22,22,12,20,18,23,25,28,28,29,31,33,32,33,35,33,36,30,34,34,35,33,28,27,23,23,24,24,20,16,6,2,12,19,21,22,20,21,20,19,17,17,17,16,12,11,7,2,9,11,10,7,9,15,5,14,14,17,19,17,16,14,20,16,18,18,14,13,14,14,17,18,15,9,9,9,10,6,12,11,15,19,18,15,16,14,18,18,18,18,22,21,12,19,21,19,22,22,21,19,18,18,19,12,16) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1.3' > par1 = '36' > #'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/1el461229334915.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/2zlmh1229334915.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.179890952 0.069612353 -0.086234605 -0.055653099 [6] -0.085561383 0.027064998 0.089086526 0.030503013 0.003627718 [11] -0.035916351 -0.078572216 -0.128894152 0.007337906 -0.059764990 [16] 0.073564730 0.012038721 -0.063581558 -0.058240314 0.045312094 [21] -0.030713553 0.012627017 -0.007217118 0.146725535 -0.045676979 [26] -0.045353305 0.078202984 -0.103076927 0.060640668 0.110167472 [31] 0.045671414 -0.073146563 0.021737709 -0.115055298 -0.101642657 [36] -0.036950186 -0.020807287 > (mypacf <- c(rpacf$acf)) [1] -0.179890952 0.038497403 -0.069621577 -0.088093161 -0.107806300 [6] -0.007120805 0.093621835 0.044027446 -0.004082051 -0.033517096 [11] -0.072478882 -0.140664788 -0.042288245 -0.089212533 0.002652918 [16] -0.003376025 -0.100906465 -0.086824770 0.049907969 -0.000416328 [21] -0.017400497 -0.052553895 0.113597535 0.003013703 -0.084900199 [26] 0.057482115 -0.064967737 0.016615762 0.121118931 0.045851895 [31] -0.074870778 0.011176892 -0.072542298 -0.138574496 -0.077951240 [36] -0.094342531 > 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/3xwsr1229334915.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/4oz4y1229334915.tab") > > system("convert tmp/1el461229334915.ps tmp/1el461229334915.png") > system("convert tmp/2zlmh1229334915.ps tmp/2zlmh1229334915.png") > > > proc.time() user system elapsed 0.545 0.304 0.641