R version 2.7.2 (2008-08-25) 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(565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518) > 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/1k2ri1226486653.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/26csh1226486653.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.884137818 0.724597758 0.604773666 0.518539741 [6] 0.477566368 0.440575812 0.369903098 0.295028738 0.281652838 [11] 0.319535062 0.385022424 0.403808730 0.274558986 0.129501327 [16] 0.017872151 -0.068260723 -0.109439683 -0.149841593 -0.212610698 [21] -0.274381833 -0.274112316 -0.235986175 -0.178894438 -0.150510344 [26] -0.209422771 -0.286247074 -0.331433940 -0.353432656 -0.349667460 [31] -0.349489935 -0.363717454 -0.376374844 -0.344077624 -0.285648524 [36] -0.215056326 -0.162261710 -0.172106389 -0.194921879 -0.190121777 [41] -0.186203958 -0.173576907 -0.161341516 -0.156521204 -0.151568480 [46] -0.116617442 -0.068473976 -0.018802195 0.022404270 0.030360658 [51] 0.033471460 0.042533141 0.035293497 0.027269834 0.022517447 [56] 0.013626136 0.005037979 0.006718730 0.006138719 -0.001322542 > (mypacf <- c(rpacf$acf)) [1] 0.884137818 -0.261575084 0.136805161 0.007419348 0.151716544 [6] -0.068087833 -0.118890977 0.012038309 0.248200828 0.117121377 [11] 0.139123138 -0.183272658 -0.570406692 0.100899143 -0.116273067 [16] -0.046380370 0.036970893 -0.056718506 0.089762120 -0.063633263 [21] -0.017315406 -0.113123320 0.027927559 0.042021648 0.045431992 [26] -0.126982815 0.104192791 -0.030961316 -0.044529509 -0.008779169 [31] -0.032011247 0.028918018 -0.017436636 -0.021504382 0.007129616 [36] 0.016774184 -0.042161892 0.034088812 -0.009706903 -0.132244171 [41] 0.050376867 -0.059738314 0.088851401 -0.031207416 -0.003735654 [46] -0.047551844 0.005548519 -0.004343824 0.062893401 -0.016091254 [51] -0.059255232 0.017286415 -0.082646738 0.038356987 -0.063105634 [56] -0.026721882 -0.063008542 -0.067694327 -0.068352359 > 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 1:par1) { + 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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/30jiq1226486653.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-1,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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4wpkq1226486653.tab") > > system("convert tmp/1k2ri1226486653.ps tmp/1k2ri1226486653.png") > system("convert tmp/26csh1226486653.ps tmp/26csh1226486653.png") > > > proc.time() user system elapsed 0.863 0.343 0.980