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(92.66,94.2,94.37,94.45,94.62,94.37,93.43,94.79,94.88,94.79,94.62,94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.5,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.2,98.71,98.54,98.2,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.1,101.1,100.93,100.85,100.93,99.6,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.9,103.03,101.29) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-2.0' > 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/1614x1228782902.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/2wq5y1228782902.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.0000000000 -0.1557101144 -0.3369117784 -0.0185234251 -0.1478494627 [6] 0.3845613688 0.0577099760 -0.2741179062 0.0136842765 -0.0760223678 [11] 0.3064491904 0.2688461579 -0.5722480733 -0.0157268125 0.2289205154 [16] 0.0065405846 0.1823810170 -0.3013063739 -0.1081777123 0.1266746088 [21] 0.0843970314 0.1512119768 -0.2151287287 -0.1980442458 0.2103460498 [26] 0.0853712376 -0.0907824355 -0.0269738124 -0.1196881824 0.0527203176 [31] 0.0849083312 0.0098092525 -0.0400754842 -0.1045279271 0.0904921260 [36] 0.0386006478 -0.0429328443 -0.0359208121 0.0094997574 0.0004584549 [41] 0.0103575729 0.0439696954 -0.0242444306 -0.0759311365 0.0233361305 [46] 0.0307118770 -0.0019255053 -0.0191885826 > (mypacf <- c(rpacf$acf)) [1] -0.155710114 -0.370131493 -0.175796557 -0.389333522 0.240364418 [6] 0.020046169 -0.017142923 -0.012607954 -0.084843510 0.251334229 [11] 0.371207766 -0.280511831 0.034605870 0.112691182 -0.035703084 [16] -0.039368949 -0.083342941 -0.018808485 -0.223156115 0.034652581 [21] -0.095909310 0.005599253 0.084979619 -0.116349312 -0.001948232 [26] -0.035866961 0.024399378 0.027553435 -0.104334771 -0.082539268 [31] -0.034706724 0.019139086 0.061914328 0.023556357 -0.034325492 [36] -0.008944402 0.048713873 0.030095063 -0.030268999 0.058672030 [41] -0.044182646 -0.021721541 -0.105627680 -0.036462909 -0.062843630 [46] 0.015592054 -0.162001536 > 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/3w8e31228782902.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/4z51f1228782902.tab") > > system("convert tmp/1614x1228782902.ps tmp/1614x1228782902.png") > system("convert tmp/2wq5y1228782902.ps tmp/2wq5y1228782902.png") > > > proc.time() user system elapsed 0.817 0.416 0.907