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(2196.72,2350.44,2440.25,2408.64,2472.81,2407.6,2454.62,2448.05,2497.84,2645.64,2756.76,2849.27,2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45) > par5 = '12' > par4 = '0' > 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/rcomp/tmp/1hfee1229937225.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/23glg1229937225.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.915125976 0.828072253 0.775194683 0.711849302 [6] 0.639653921 0.573463817 0.517829528 0.461518303 0.389535261 [11] 0.318530304 0.254158771 0.190902609 0.127596475 0.083122487 [16] 0.025616693 -0.037915709 -0.086808057 -0.131327842 -0.162026414 [21] -0.196007815 -0.234715098 -0.260058326 -0.280792842 -0.299884935 [26] -0.312512169 -0.322828274 -0.333039941 -0.341510042 -0.359651670 [31] -0.385331882 -0.407013743 -0.414958637 -0.411584576 -0.402052331 [36] -0.386411739 -0.368771833 -0.351141250 -0.328609362 -0.300146149 [41] -0.276143373 -0.243102383 -0.206443609 -0.172484568 -0.133268783 [46] -0.105270438 -0.068805668 -0.025261962 0.007361965 0.042237485 [51] 0.067766989 0.084787071 0.093585525 0.108837882 0.123825228 [56] 0.128431699 0.117312509 0.106262640 0.097520201 0.055781841 > (mypacf <- c(rpacf$acf)) [1] 0.9151259758 -0.0577275863 0.1634963097 -0.1052113863 -0.0484813734 [6] -0.0299673548 0.0154849583 -0.0326482990 -0.1191505885 -0.0464999177 [11] -0.0472822139 -0.0313323599 -0.0396218690 0.0656558254 -0.1478624320 [16] -0.0459547482 -0.0066107874 -0.0306903329 0.0721876007 -0.0745607892 [21] -0.0546577391 -0.0088798922 -0.0098888879 0.0049589045 -0.0010256683 [26] -0.0396579649 -0.0386672191 -0.0415620073 -0.0986150996 -0.0793019245 [31] -0.0734587608 0.0321423871 0.0057690573 0.0199860115 0.0400523621 [36] -0.0277909250 -0.0007905293 0.0205126554 0.0186176310 -0.0350655897 [41] 0.0556669698 -0.0264876159 0.0084250755 0.0452569162 -0.0753135229 [46] 0.0720189972 -0.0077110581 -0.0213073721 0.0310255274 -0.0715273658 [51] -0.0260665287 -0.0821912472 0.0432489819 -0.0077496596 -0.0362736233 [56] -0.1070390454 0.0032521714 -0.0467493677 -0.1861113448 > 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/3oj5i1229937225.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/49sch1229937225.tab") > system("convert tmp/1hfee1229937225.ps tmp/1hfee1229937225.png") > system("convert tmp/23glg1229937225.ps tmp/23glg1229937225.png") > > > proc.time() user system elapsed 0.590 0.329 0.716