R version 2.7.0 (2008-04-22) 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(132.7,128.6,127.8,128.9,124.6,129.2,130.5,124.3,125.8,123.5,120.7,123.1,122.0,121.0,121.2,117.4,113.0,113.1,116.1,121.3,108.6,114.3,113.5,111.2,109.3,108.2,102.7,110.4,108.1,112.8,108.1,102.6,109.2,108.2,107.1,108.4,103.6,104.0,111.5,105.4,105.5,101.3,103.8,100.3,108.2,105.6,103.0,100.5,104.3,99.1,91.5) > 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/rcomp/tmp/1jytb1228658220.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/2keok1228658220.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.0000000000 -0.4022804101 -0.0678506264 0.0248370497 -0.0348378382 [6] -0.0189126896 0.2214722553 -0.2632456019 0.1165230913 -0.1254513567 [11] 0.1623889852 0.1532027465 -0.3584381269 0.1648526781 -0.0814467278 [16] -0.0060781559 0.1928631449 -0.0431337154 -0.2796583835 0.2624920238 [21] -0.1516971321 0.1330639659 -0.1571564957 0.0274025899 0.0268570688 [26] -0.0412548598 0.0410255853 0.1515715620 -0.2541599665 0.0672305552 [31] 0.1285603155 -0.1498114084 0.0193584660 0.0365757582 -0.0116660680 [36] 0.0234358054 -0.0005264237 -0.0321109859 -0.0111793285 0.0457339288 [41] 0.0020430761 -0.0287066300 0.0221646515 0.0284709955 -0.0565583777 [46] -0.0075201881 0.0227061429 -0.0309788929 0.0155201250 > (mypacf <- c(rpacf$acf)) [1] -0.402280410 -0.274025586 -0.155014937 -0.141945226 -0.137522324 [6] 0.181285780 -0.110773190 0.020591247 -0.170745827 0.078562449 [11] 0.305982159 -0.234137001 0.090816122 -0.211239858 -0.019918365 [16] 0.094846049 0.050001381 -0.085508299 -0.053749158 -0.031852104 [21] -0.075431899 -0.179219785 -0.003060837 -0.030484172 -0.110087485 [26] -0.078579048 0.063276716 0.055041377 -0.056778256 0.074772591 [31] -0.024658731 -0.200545722 0.019148297 -0.008776751 0.068734669 [36] -0.079553677 -0.071560063 -0.058796147 0.093936636 -0.092081303 [41] 0.017774586 0.069780369 -0.075279906 -0.078699731 -0.101596705 [46] -0.065076874 -0.044185405 0.059626587 > 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/3anis1228658220.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/4njtu1228658220.tab") > > system("convert tmp/1jytb1228658220.ps tmp/1jytb1228658220.png") > system("convert tmp/2keok1228658220.ps tmp/2keok1228658220.png") > > > proc.time() user system elapsed 1.530 0.563 1.622