R version 2.7.0 (2008-04-22) 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(101,88,108,116,104,110,105,107,124,109,102,125,102,101,116,114,115,119,108,110,120,113,111,121,99,104,117,108,122,122,111,111,131,108,118,119,104,105,118,124,123,114,119,116,129,112,123,124,117,110,118,135,127,117,137,130,132,142,122,126) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1mbf11227868172.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/2vyal1227868172.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.116992316 -0.029948256 0.362526089 0.002754898 [6] -0.081066832 0.201814133 -0.086267595 0.061918428 0.176561161 [11] -0.098960469 -0.036104848 0.051665983 -0.183566428 -0.018180152 [16] 0.129595897 -0.168064304 0.030790721 0.175324252 -0.163761911 [21] -0.044329942 -0.005644124 -0.117325420 0.124092312 -0.254500391 [26] 0.039114426 0.092242493 -0.144667083 -0.199007988 0.082326258 [31] -0.168652864 -0.132799591 0.033853875 -0.082672562 -0.118266495 [36] 0.100789044 -0.057964668 > (mypacf <- c(rpacf$acf)) [1] -0.1169923161 -0.0442409938 0.3593029875 0.0971733455 -0.0684481095 [6] 0.0608820058 -0.1011463046 0.1052151787 0.1373766465 -0.0351066985 [11] -0.1050548956 -0.1209985419 -0.1615788667 -0.0042939849 0.1784449879 [16] -0.0036786221 0.0008902554 0.0682737932 -0.0629055658 -0.0577883294 [21] -0.1278011392 -0.0259271469 0.1895766744 -0.3123758094 0.0662524913 [26] -0.0278193686 -0.0203775592 -0.1585797872 -0.0436464224 -0.0161907228 [31] -0.0646765947 -0.0107495930 -0.0325060933 -0.0668278182 0.0356498387 [36] 0.0500999654 > 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/33n4h1227868172.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/4gw2d1227868172.tab") > > system("convert tmp/1mbf11227868172.ps tmp/1mbf11227868172.png") > system("convert tmp/2vyal1227868172.ps tmp/2vyal1227868172.png") > > > proc.time() user system elapsed 1.465 0.554 1.563