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(75,38,20,6,11,38,54,44,37,39,4,49,45,29,20,9,16,3,56,53,35,49,11,54,47,31,21,14,9,16,61,57,40,42,7,43,56,29,34,14,25,39,53,39,32,40,1,47,39,39,20,7,43,43,21,39,35,38,12,37,34) > 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/freestat/rcomp/tmp/1ktn11228829614.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/25reb1228829614.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.122722357 -0.159202454 -0.315882465 -0.332105277 [6] 0.121298800 0.137029731 0.141723497 -0.229554891 -0.243614437 [11] -0.128993519 0.174454537 0.614121596 0.073147156 -0.095977739 [16] -0.265697486 -0.313456798 0.075661081 0.148660283 0.081252092 [21] -0.167935240 -0.150318264 -0.054436563 0.112247445 0.384480389 [26] 0.062175249 -0.073216989 -0.235003509 -0.269727785 0.098224487 [31] 0.137682737 0.092803706 -0.064071769 -0.079672477 -0.035003407 [36] 0.037205479 0.240195134 0.005767250 -0.048630338 -0.156469603 [41] -0.095440720 0.109108891 0.072191278 0.033559592 0.003720049 [46] -0.054917614 -0.075333514 0.068507463 0.087289707 -0.004840041 [51] -0.044743186 -0.061390757 0.003415853 0.006438773 -0.007598219 [56] 0.038884536 0.014144923 0.001449869 -0.049912380 0.010607167 [61] 0.002976335 > (mypacf <- c(rpacf$acf)) [1] 0.1227223567 -0.1769279029 -0.2842185789 -0.3296531945 0.0825463319 [6] -0.0737626992 -0.0140989609 -0.3577014059 -0.1828918866 -0.2771109127 [11] -0.0140006147 0.3937570753 -0.0637473560 0.0454586834 0.0757741541 [16] -0.0663155752 -0.0417375894 0.0142608679 -0.1327704195 -0.1187293226 [21] -0.0010852410 -0.0093254226 -0.1743796400 -0.0452113241 -0.0388586278 [26] -0.0912280398 -0.1220362711 -0.1191982358 -0.0565014416 -0.0778042354 [31] -0.0234287036 -0.0220635848 0.0032124704 0.0135528803 -0.0645232402 [36] -0.0646934595 -0.1151868135 -0.0568942396 -0.0802699109 0.1113906498 [41] 0.0146273661 -0.0150422814 -0.0874573538 0.1141175839 -0.0539849380 [46] -0.1189570620 0.0505224509 -0.0785435123 0.0074599647 -0.0124295596 [51] 0.0493254057 0.0027087284 -0.0987082973 -0.1259321617 0.0006255765 [56] -0.1023814305 0.0520796589 -0.0572694165 -0.0381075239 0.0442752485 > 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/3a9qh1228829614.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/4t1xh1228829614.tab") > > system("convert tmp/1ktn11228829614.ps tmp/1ktn11228829614.png") > system("convert tmp/25reb1228829614.ps tmp/25reb1228829614.png") > > > proc.time() user system elapsed 0.813 0.420 0.906