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(377.2,332.2,364.8,352.4,341.6,298.2,355.3,330.9,314.5,418.9,433.2,367,422.9,352.1,419.8,432.7,414.2,387.7,297.2,357.4,384.2,425.2,385.3,355.4,409.8,421.2,421.8,464.2,494,404.2,411.4,403.4,403.3,520.9,439.8,434.8,476.5,454.3,522,498.4,439.9,450.7,447.1,451.3,466.8,498,533.6,451.9,477.1,410.4,469.5,485.4,406.7,439.7,412.2,440.2,411.1,477.7,463.2,320.5) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1og4o1228248147.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/2ygcz1228248147.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.0000000000 -0.3182580678 -0.1147510097 0.0545678473 -0.2464315418 [6] 0.2484364629 -0.0401600643 0.1105974620 -0.0943988734 -0.1232044333 [11] 0.0285479666 -0.0325098200 0.2640366332 0.0059161322 -0.1117617495 [16] -0.0408611418 -0.1287444163 0.0618099548 0.1783724306 0.0497523596 [21] -0.1711205707 -0.0144341719 0.0267864186 -0.0971102859 0.2098915679 [26] -0.0502760604 -0.0973344578 0.0582363883 -0.2133753930 0.1624394073 [31] 0.0802930210 0.0007513103 -0.0755318171 -0.0710668704 0.0686521688 [36] -0.1547578372 0.2217000158 > (mypacf <- c(rpacf$acf)) [1] -0.318258068 -0.240387638 -0.079403223 -0.333120621 0.038432214 [6] -0.045682861 0.185642005 -0.055187361 -0.041723726 -0.134994617 [11] -0.070001487 0.163779153 0.202000178 0.090277731 0.018924587 [16] -0.095943426 -0.147587227 0.059418009 0.144821804 -0.033700038 [21] 0.040375042 0.084199183 -0.136033722 -0.031860441 -0.101957222 [26] -0.086119184 0.067268956 -0.085526264 0.014326635 -0.014221604 [31] -0.003527975 -0.139522892 0.000745361 0.020375308 -0.110401436 [36] 0.041864245 > 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/36tkj1228248147.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/4u4b81228248147.tab") > > system("convert tmp/1og4o1228248147.ps tmp/1og4o1228248147.png") > system("convert tmp/2ygcz1228248147.ps tmp/2ygcz1228248147.png") > > > proc.time() user system elapsed 0.774 0.427 0.878