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(528,478,469,490,493,508,517,514,510,527,542,565,555,499,511,526,532,549,561,557,566,588,620,626,620,573,573,574,580,590,593,597,595,612,628,629,621,569,567,573,584,589,591,595,594,611,613,611,594,543,537,544,555,561,562,555,547,565,578,580) > 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/1ukvr1229692236.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/2c8ye1229692236.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.884036615 0.695678707 0.542637082 0.457337517 [6] 0.425860132 0.391604773 0.325027598 0.247238852 0.229216208 [11] 0.279935566 0.371519655 0.409029702 0.285180386 0.111306098 [16] -0.029172481 -0.107884002 -0.142286191 -0.176713031 -0.231781762 [21] -0.293485693 -0.292950997 -0.233197864 -0.142100350 -0.092402369 [26] -0.152357205 -0.252665548 -0.323022783 -0.344759039 -0.338927758 [31] -0.334088917 -0.344897616 -0.355603427 -0.320579838 -0.247386968 [36] -0.150707783 -0.086253957 -0.102586453 -0.154117339 -0.179589713 [41] -0.175507527 -0.157398286 -0.142878333 -0.138979416 -0.135430961 [46] -0.103034230 -0.041873889 0.029853899 0.071204025 0.066958718 [51] 0.040189528 0.019798318 0.011560746 0.007926337 0.004882461 [56] -0.005537193 -0.021602823 -0.029779305 -0.020247274 -0.006194604 > (mypacf <- c(rpacf$acf)) [1] 0.884036615 -0.392906994 0.180436373 0.106688988 0.079574120 [6] -0.103382260 -0.070370611 0.019729159 0.263747745 0.112376641 [11] 0.156567013 -0.219739724 -0.588417016 0.150840068 -0.075507102 [16] -0.054109526 -0.050067477 -0.036149804 0.085178072 -0.022876271 [21] 0.032991857 -0.073916436 -0.039220130 0.035575442 0.014677697 [26] -0.080275000 0.051996275 -0.065481528 0.004926854 0.015549373 [31] -0.014114443 0.054993753 -0.116535468 -0.027480526 0.077849241 [36] -0.042280585 -0.022974599 -0.030097876 0.044025193 -0.048272784 [41] 0.016862272 -0.031669520 0.022783115 -0.054382215 0.015952009 [46] 0.021214737 -0.082815428 -0.019650865 0.153814352 -0.044007144 [51] -0.145545648 0.038525788 -0.028578913 0.044021563 -0.091218170 [56] -0.096851868 -0.081808249 -0.038580547 0.015665350 > 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/3oiap1229692236.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/4wvs41229692237.tab") > > system("convert tmp/1ukvr1229692236.ps tmp/1ukvr1229692236.png") > system("convert tmp/2c8ye1229692236.ps tmp/2c8ye1229692236.png") > > > proc.time() user system elapsed 0.594 0.331 0.722