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(101,104,99,105,107,111,117,119,127,128,135,132,136,143,142,153,145,138,148,152,169,169,161,174,179,191,190,182,175,181,197,194,197,216,221,218,230,227,204,197,199,208,191,202,211,224,224,231,244,235,250,266,288,283,295,312,334,348,383,407) > par5 = '12' > par4 = '0' > 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/freestat/rcomp/tmp/1fbef1228758670.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/2zeh91228758670.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.892180403 0.793505712 0.712926530 0.636963815 [6] 0.568850404 0.509813583 0.458999579 0.396586095 0.350208937 [11] 0.315857530 0.290256635 0.247841971 0.214094236 0.187796905 [16] 0.159180520 0.138475555 0.122354243 0.113572089 0.093967195 [21] 0.084093508 0.082295771 0.073471270 0.039892511 0.005801618 [26] -0.019128811 -0.047992373 -0.078266353 -0.100009216 -0.124251340 [31] -0.150450466 -0.160102888 -0.167198203 -0.180848446 -0.197632386 [36] -0.214707956 -0.226962520 > (mypacf <- c(rpacf$acf)) [1] 0.8921804027 -0.0121568022 0.0353750066 -0.0181638553 0.0004796288 [6] 0.0074801005 0.0104675969 -0.0813490961 0.0415057813 0.0256853910 [11] 0.0321003932 -0.0930424525 0.0173815529 0.0064124961 -0.0146986357 [16] 0.0128933106 0.0049635347 0.0260378012 -0.0397099728 0.0275532779 [21] 0.0249963658 -0.0281931547 -0.1226694184 -0.0363843703 0.0014346854 [26] -0.0277602025 -0.0509858402 0.0012964935 -0.0403470804 -0.0130627828 [31] 0.0312135238 -0.0253212456 -0.0403535681 -0.0246807208 -0.0377184646 [36] -0.0094084047 > 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/3186k1228758670.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/4iqr01228758670.tab") > > system("convert tmp/1fbef1228758670.ps tmp/1fbef1228758670.png") > system("convert tmp/2zeh91228758670.ps tmp/2zeh91228758670.png") > > > proc.time() user system elapsed 0.766 0.423 0.908