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(156.3,151.5,159.1,166.9,160.5,162.8,178.9,148.5,184.1,197,186.8,139.2,162.7,187.5,235.8,219.4,212.4,220.2,197.5,185.6,232.4,223.8,219.4,191.4,210.4,212.6,274.4,256,227.6,261.7,237,234.9,310.6,274.2,288.1,242.5,271.7,282.2,317.4,280.3,322.6,328.2,280.7,288.8,347.9,360.1,348,275.7,332.6,340.8,390.5,351.2,377.4,413.5,366.9,364.8,388,429.8,423.6,326.4) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '0.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/1v4v51229088193.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/20wt41229088193.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.2552906060 -0.1811185169 -0.2273665705 0.1469772670 [6] 0.0284408697 0.0742902745 -0.0520026334 0.1783674290 -0.1958775006 [11] -0.1627655489 -0.1256858807 0.5876898471 -0.2062355179 0.0321822266 [16] -0.2724915736 0.0760951488 0.0571220028 0.0807813871 -0.0377698732 [21] 0.1289762601 -0.1526239451 -0.1717941093 0.0112781664 0.3794774055 [26] -0.2216372146 0.1054387662 -0.1986248177 0.1077369822 -0.0462711240 [31] -0.0218211601 0.0956766873 0.1261804677 -0.2108212634 -0.1050675850 [36] 0.0253851432 0.2218325983 -0.0661030018 0.0001898869 -0.1277200246 [41] 0.1105439040 -0.0280949319 -0.0137316572 0.0353639823 0.0832249572 [46] -0.0808123640 -0.1010093452 -0.0011500767 0.0921078054 > (mypacf <- c(rpacf$acf)) [1] -0.2552906060 -0.2634625312 -0.4058287613 -0.1729837300 -0.1906802092 [6] -0.0818505403 -0.0580277733 0.2475833376 0.0344297449 -0.1665151512 [11] -0.3848003001 0.2939540290 -0.1280815706 0.1904256610 -0.0228762795 [16] -0.0585084891 0.0012414053 -0.0016328345 0.0220239802 -0.0038678874 [21] 0.0671517688 -0.1763554334 0.0680908698 0.0672889793 -0.1474956404 [26] 0.0053674032 0.0734714117 0.0956115028 -0.0280719747 -0.0914986653 [31] 0.0189815420 -0.0235363649 -0.0830118211 0.0071151290 -0.1136735587 [36] -0.0879623356 0.1162250764 -0.1409776371 0.0632109872 -0.0636408339 [41] 0.0831771017 0.1008100910 -0.0234560045 -0.0341309669 0.0149033650 [46] 0.0004336939 -0.0295486151 -0.0854422514 > 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/3kuxi1229088193.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/4rwet1229088193.tab") > > system("convert tmp/1v4v51229088193.ps tmp/1v4v51229088193.png") > system("convert tmp/20wt41229088193.ps tmp/20wt41229088193.png") > > > proc.time() user system elapsed 0.567 0.288 0.696