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(3999,4864,5134,5410,4669,3546,5040,4850,4808,4441,4227,3620,3153,3936,4159,4209,4282,3174,4686,4131,4486,4625,3971,3397,3228,3441,3832,5267,3580,2617,3874,3431,4023,4151,3180,2916,2640,2700,3603,4348,3322,2312,3472,3592,3481,3451,2725,2574,2429,3160,3371,3448,3229,1986,2955,3000,8255,4191,3520,2497) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '2.0' > 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/rcomp/tmp/1r6ve1229935130.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/271m51229935130.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.207590061 0.035410368 -0.100439272 0.065919096 [6] 0.161375885 0.181981971 0.101556517 -0.033524684 -0.051962127 [11] -0.053203992 0.078042347 0.177832378 0.086464308 0.005902809 [16] -0.092287377 -0.033434165 0.131605215 0.088762767 -0.022473545 [21] -0.100009325 -0.105315064 -0.103033855 0.031503338 0.093135183 [26] -0.020125626 -0.057260783 -0.180451343 -0.119788252 0.105591586 [31] -0.012842844 -0.081189982 -0.149628142 -0.143246044 -0.100076554 [36] -0.002230113 0.036972360 -0.032671856 -0.011860140 -0.152323426 [41] -0.061757927 -0.038054365 -0.023875274 -0.068180398 -0.151421722 [46] -0.135211497 -0.069780199 -0.025574093 0.036099638 0.032170581 [51] 0.045537453 -0.102990488 -0.004047994 0.109122043 0.114733978 [56] 0.074254848 -0.019598409 -0.024598828 -0.015703648 -0.001391378 > (mypacf <- c(rpacf$acf)) [1] 0.207590061 -0.008029276 -0.110971341 0.115702308 0.138252649 [6] 0.110740163 0.058090895 -0.049548113 -0.033373521 -0.064075149 [11] 0.047448716 0.131040785 0.014092896 0.015861554 -0.053057094 [16] -0.021763417 0.108437063 -0.029816256 -0.078327253 -0.044288386 [21] -0.058138651 -0.089651249 0.027025588 0.065107822 -0.049588857 [26] 0.009646090 -0.099794399 -0.082407607 0.122185527 -0.126861141 [31] -0.078481576 -0.007744682 -0.063163892 -0.042469226 0.005835313 [36] 0.042523859 -0.008999305 0.067580541 -0.058483670 -0.025278710 [41] -0.070719111 -0.067927383 -0.064402502 -0.069225883 -0.013516647 [46] -0.024835212 -0.034193961 0.097834675 0.044661727 0.073214062 [51] -0.037966136 -0.007911460 0.085765055 0.027267154 -0.003136580 [56] 0.045738452 0.035523245 -0.046577451 -0.055127782 > 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/30jdw1229935130.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/4m7y41229935130.tab") > > system("convert tmp/1r6ve1229935130.ps tmp/1r6ve1229935130.png") > system("convert tmp/271m51229935130.ps tmp/271m51229935130.png") > > > proc.time() user system elapsed 0.585 0.302 0.729