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(61.5,88.5,93.3,89.2,101.3,97,102.2,100.3,78.2,105.9,119.9,108,77,93.1,109.5,100.4,99,113.9,102.1,101.6,84,110.7,111.6,110.7,73.1,87.5,109.6,99.3,92.1,109.3,94.5,91.4,82.9,103.3,96,104.8,65.8,78.7,100.3,85,94.5,97.9,91.9,87.2,84.4,99.2,105.4,110.9,69.8,86.8,106.7,88.8,96.9,108.1,93.7,94.8,79.8,95.6,107.9,104.9,61.9,85.7,92.4,86.4,99.3,95.5,97,102.1,77.8,105.5,113.2,108.8,66.9,89.3,93.6,92,99.5,98.6,94.6,96.7,75.3,102.5,115.1,104.7,71.4) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/162wz1228248704.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/28v3p1228248704.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.045407677 -0.314479631 -0.090629476 0.182842988 [6] 0.083079781 0.037531822 0.030859794 0.177091725 -0.165380092 [11] -0.392689290 -0.010037711 0.719444347 -0.044465779 -0.322174584 [16] -0.177762596 0.086349560 0.021096340 -0.039387884 -0.022912312 [21] 0.118381072 -0.177247981 -0.357583732 -0.006933207 0.551259011 [26] -0.034246990 -0.237720539 -0.185406397 0.067177632 0.048529265 [31] -0.045899320 0.005382536 0.125806275 -0.142348742 -0.270734530 [36] 0.002735880 0.466849192 > (mypacf <- c(rpacf$acf)) [1] 0.045407677 -0.317195500 -0.063972151 0.101560878 0.026178065 [6] 0.124384711 0.087868015 0.237703588 -0.174586510 -0.362861097 [11] -0.141371212 0.630927069 -0.181247269 -0.025602615 -0.183270108 [16] -0.085355793 -0.126532802 -0.072077595 -0.038131779 -0.117831931 [21] 0.082118644 0.069259202 0.038835331 -0.024163389 -0.002701515 [26] 0.014641298 -0.123051853 -0.064444292 -0.037309884 -0.080612383 [31] 0.037920879 0.025006214 0.023482792 0.020467376 -0.039439016 [36] 0.059221563 > 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/3ic8b1228248704.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/46xmp1228248704.tab") > > system("convert tmp/162wz1228248704.ps tmp/162wz1228248704.png") > system("convert tmp/28v3p1228248704.ps tmp/28v3p1228248704.png") > > > proc.time() user system elapsed 0.549 0.314 0.677