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(93.4,101.5,110.4,105.9,108.4,113.9,86.1,69.4,101.2,100.5,98.0,106.6,90.1,96.9,125.9,112.0,100.0,123.9,79.8,83.4,113.6,112.9,104.0,109.9,99.0,106.3,128.9,111.1,102.9,130.0,87.0,87.5,117.6,103.4,110.8,112.6,102.5,112.4,135.6,105.1,127.7,137.0,91.0,90.5,122.4,123.3,124.3,120.0,118.1,119.0,142.7,123.6,129.6,151.6,110.4,99.2,130.5,136.2,129.7,128.0,121.6,135.8,143.8,147.5,136.2,156.6,123.3,104.5,143.6) > 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/freestat/rcomp/tmp/1pp621228844890.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/2n7bt1228844890.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.106834486 0.094578652 0.155102287 0.004258120 [6] 0.223633049 0.208122623 -0.085613106 0.048779803 0.038840861 [11] 0.150841165 0.080546159 -0.110445545 -0.020289750 -0.040849341 [16] 0.112543564 0.037708909 0.099300209 -0.097021517 -0.049532202 [21] 0.014485864 0.142093381 -0.229587579 0.201702428 -0.190159762 [26] -0.041478585 0.157103306 -0.100801018 -0.125948363 -0.035896143 [31] -0.149963286 0.040153043 -0.048297870 -0.137500228 0.055671155 [36] -0.160055399 -0.071698255 > (mypacf <- c(rpacf$acf)) [1] -0.106834486 0.084125216 0.176595095 0.032613121 0.205645884 [6] 0.250172149 -0.072673211 -0.086441624 -0.033118468 0.135256066 [11] 0.035057845 -0.161174799 -0.079457602 -0.066175600 0.084083134 [16] 0.017552369 0.203294450 0.012836889 -0.117135590 -0.130146237 [21] 0.123047879 -0.213827108 0.180168978 -0.091048708 -0.064482426 [26] 0.011411778 -0.012091455 -0.097929795 -0.046545282 -0.047849239 [31] -0.008919954 -0.074631534 -0.062362361 0.133490606 0.019846780 [36] -0.176778903 > 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/33mg41228844890.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/4cjt01228844890.tab") > > system("convert tmp/1pp621228844890.ps tmp/1pp621228844890.png") > system("convert tmp/2n7bt1228844890.ps tmp/2n7bt1228844890.png") > > > proc.time() user system elapsed 0.772 0.419 0.887