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(75,38,20,6,11,38,54,44,37,39,4,49,45,29,20,9,16,3,56,53,35,49,11,54,47,31,21,14,9,16,61,57,40,42,7,43,56,29,34,14,25,39,53,39,32,40,1,47,39,39,20,7,43,43,21,39,35,38,12,37,34) > par5 = '12' > par4 = '1' > 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/freestat/rcomp/tmp/1w6341228829858.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/freestat/rcomp/tmp/2p8m11228829858.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.009966162 -0.130082235 0.027550312 -0.057121004 [6] 0.101675842 0.027872320 -0.110932861 0.015969435 0.033222530 [11] -0.141446675 0.261720212 -0.055207612 -0.138645255 -0.122782683 [16] 0.012287804 0.025767484 0.045493959 -0.005515246 -0.088289298 [21] 0.074169358 -0.093444679 0.046934528 -0.079220214 -0.213045453 [26] -0.031870542 0.084233335 -0.047242193 -0.111565426 -0.104184741 [31] 0.001666670 0.171334327 -0.080386729 0.054475632 0.064555921 [36] -0.142677456 0.032069681 0.150821885 0.015539764 -0.021144945 [41] -0.089841840 -0.052931400 0.186298590 0.010395710 -0.022910723 [46] -0.013391468 -0.041159941 0.043607406 0.017344076 > (mypacf <- c(rpacf$acf)) [1] -0.009966162 -0.130194491 0.025217480 -0.074872097 0.110185421 [6] 0.010223779 -0.080702948 0.010732946 0.020275620 -0.145746469 [11] 0.269593356 -0.098641664 -0.057636989 -0.204408301 0.079458853 [16] -0.089733963 0.071344618 0.019270953 -0.039895329 0.001331516 [21] -0.053433692 -0.014575993 -0.112136733 -0.208130745 0.028746620 [26] -0.027301017 -0.058629627 -0.189856848 -0.121375866 0.012831754 [31] 0.076251529 -0.043497523 0.069931377 0.035422291 -0.127074232 [36] -0.014281757 0.066542855 -0.045487449 0.006655541 -0.068001584 [41] -0.052307756 -0.026850411 0.018816030 0.030176919 -0.064621900 [46] 0.022517798 0.008598736 -0.141126794 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3li3y1228829858.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/freestat/rcomp/tmp/42pjr1228829858.tab") > > system("convert tmp/1w6341228829858.ps tmp/1w6341228829858.png") > system("convert tmp/2p8m11228829858.ps tmp/2p8m11228829858.png") > > > proc.time() user system elapsed 0.814 0.406 0.920