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 = '1' > par3 = '0' > 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/1v5771229087416.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/265321229087416.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.0778132778 -0.2281451102 0.1252008518 -0.1790803022 [6] -0.0906326868 -0.0018913590 -0.1975436679 0.0366382031 0.1551256594 [11] 0.0148825911 -0.1991235838 -0.2326565217 0.0087557161 -0.0143098989 [16] -0.1245132499 -0.0037226842 0.2451242619 0.1651890739 -0.0398408196 [21] 0.0532850294 0.1163873950 -0.0565127262 0.0260265809 -0.1254064308 [26] -0.1456702367 0.1639298629 0.0001236696 -0.1004632585 -0.0060790121 [31] -0.0102110344 0.1330783324 0.0070027284 -0.1803226541 0.0545071951 [36] 0.0557128998 -0.0318651184 0.0371218344 0.0542975158 0.0080269611 [41] 0.0558898287 -0.0119032379 -0.1318694041 -0.0475093829 0.0545903455 [46] -0.0108439108 -0.0007388608 0.0221453375 > (mypacf <- c(rpacf$acf)) [1] 0.077813278 -0.235626714 0.176265756 -0.294260300 0.068117408 [6] -0.180645191 -0.122696648 0.005536904 0.054152562 0.038388264 [11] -0.312390362 -0.218312526 -0.081892837 -0.122274529 -0.195897028 [16] -0.198875377 0.168339689 -0.090468968 -0.153591495 0.016103264 [21] 0.198624551 -0.109737347 -0.080374442 -0.202301150 0.001817244 [26] -0.112131238 -0.236960985 0.006563582 -0.070427173 -0.082137545 [31] 0.014714609 0.135846339 0.006601586 -0.092345665 -0.051871352 [36] -0.007832594 -0.058995468 -0.074075960 -0.088137166 0.024114234 [41] -0.066449850 -0.063356445 0.022342602 0.090279457 0.089053518 [46] 0.045046614 -0.020246148 > 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/3buqh1229087416.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/4r2r91229087416.tab") > > system("convert tmp/1v5771229087416.ps tmp/1v5771229087416.png") > system("convert tmp/265321229087416.ps tmp/265321229087416.png") > > > proc.time() user system elapsed 0.577 0.321 0.684