R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(580,579,572,560,551,537,541,588,607,599,578,563,566,561,554,540,526,512,505,554,584,569,540,522,526,527,516,503,489,479,475,524,552,532,511,492,492,493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,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,506,502,516) > par5 = '12' > par4 = '0' > 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/1uuxo1242309340.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/2rrg71242309340.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.916634934 0.783950355 0.689654560 0.653139021 [6] 0.661248246 0.660495476 0.626493703 0.577931965 0.567429655 [11] 0.608333796 0.686853501 0.719236417 0.613503244 0.466633622 [16] 0.353469036 0.295620341 0.282262119 0.261399724 0.214029274 [21] 0.155293876 0.131804603 0.156800028 0.214712922 0.230259697 [26] 0.127507985 -0.009360179 -0.113779389 -0.165879953 -0.175775495 [31] -0.190626203 -0.227162985 -0.274020876 -0.288650390 -0.259502414 [36] -0.200606660 -0.177733188 -0.258847058 -0.369828506 -0.452344839 [41] -0.483743768 -0.476652541 -0.471214732 -0.486343260 -0.511866928 [46] -0.507327664 -0.462258718 -0.391894184 -0.353530717 > (mypacf <- c(rpacf$acf)) [1] 0.9166349345 -0.3521661562 0.2915086018 0.1536157112 0.1812777064 [6] -0.0909772297 -0.0116874026 0.0353961986 0.2722229213 0.1537772003 [11] 0.2869383910 -0.2704247143 -0.7117981172 0.1247576194 -0.1375071903 [16] -0.1097841985 -0.0793622247 -0.1151859557 0.0983856088 0.0099807977 [21] 0.0198174189 0.0444738660 -0.0540673589 0.0539084915 -0.1005541869 [26] 0.0049266093 0.0164801136 -0.0925276258 -0.0007749286 -0.0073277807 [31] -0.0240144721 -0.0111146985 -0.0347886132 -0.0248010693 0.0221992221 [36] 0.0284038245 -0.0774363886 -0.0045503182 -0.0473512771 0.0592794260 [41] -0.0807734181 0.0375075840 -0.0818212974 0.0062060109 0.0280434618 [46] 0.0064115989 -0.0551464204 0.0361255106 > 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/3wrlc1242309340.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/46l201242309340.tab") > > system("convert tmp/1uuxo1242309340.ps tmp/1uuxo1242309340.png") > system("convert tmp/2rrg71242309340.ps tmp/2rrg71242309340.png") > > > proc.time() user system elapsed 0.577 0.312 0.679