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(3389,3497,4404,3849,3734,3060,3507,3287,3215,3764,2734,2837,2766,3851,3289,3848,3348,3682,4058,3655,3811,3341,3032,3475,3353,3186,3902,4164,3499,4145,3796,3711,3949,3740,3243,4407,4814,3908,5250,3937,4004,5560,3922,3759,4138,4634,3996,4308,4142,4429,5219,4929,5754,5592,4163,4962,5208,4755,4491,5732,5730,5024,6056,4901,5353,5578,4618,4724,5011,5298,4143,4617,4727,4207,5112,4190,4098,5071,4177,4598,3757,5591,4218,3780) > 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/1n72c1228331922.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/2g1w71228331922.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.414868709 0.314367920 0.379413123 0.349376931 [6] 0.263934919 0.217385190 0.226702811 0.129784890 0.207512792 [11] 0.100192601 0.022550897 -0.169079372 -0.081561523 0.030033246 [16] -0.039364101 -0.071836934 -0.045328960 0.009357077 -0.050705436 [21] -0.145300111 -0.168180622 -0.117314337 -0.006004504 -0.127090906 [26] -0.061431441 -0.079148788 -0.123890356 -0.072060257 -0.081461602 [31] -0.135445609 -0.190055443 -0.015972663 -0.032108173 -0.108219559 [36] -0.172496822 -0.094239914 -0.154890941 -0.188332491 -0.157630861 [41] -0.135474304 -0.093819308 -0.108967519 -0.047922467 -0.125106998 [46] -0.128719965 -0.061704450 -0.101139982 -0.099032904 -0.003603260 [51] -0.012378918 -0.004117952 -0.015467892 -0.017557405 -0.061854231 [56] 0.019103858 -0.012816118 -0.001586624 0.056097609 0.056434360 [61] 0.038488414 > (mypacf <- c(rpacf$acf)) [1] 0.4148687093 0.1718258614 0.2490739302 0.1390769575 0.0269659399 [6] -0.0086431976 0.0311304101 -0.0817043284 0.1140030486 -0.0893539092 [11] -0.0863122295 -0.3226634317 -0.0266393278 0.1408001783 0.1025027652 [16] 0.0267917870 0.0245722741 0.0250347943 -0.0020005772 -0.1718612840 [21] -0.0818358324 -0.0251268721 0.1331870192 -0.1842508536 0.0464308504 [26] 0.0007697255 -0.0110066810 0.0199701612 0.0505358143 -0.0205553984 [31] -0.1121219712 -0.0350406154 0.0077067254 -0.0562777266 -0.0662919703 [36] -0.0429168614 -0.1132587493 -0.0172443908 -0.0389021135 0.0748415675 [41] 0.0754560325 -0.0065709663 0.0216096975 -0.0469947144 -0.0223460973 [46] -0.0099131530 -0.1347146394 -0.0569061585 0.0860917989 -0.0393051421 [51] -0.0208313739 -0.0106108991 0.0987171438 -0.0389541522 0.0449617196 [56] -0.0468993828 -0.0009532819 -0.0109613176 -0.0522400340 -0.0487249238 > 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/3e5vl1228331922.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/4okpj1228331922.tab") > > system("convert tmp/1n72c1228331922.ps tmp/1n72c1228331922.png") > system("convert tmp/2g1w71228331922.ps tmp/2g1w71228331922.png") > > > proc.time() user system elapsed 0.810 0.411 0.892