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(54156,53661,52441,50648,48141,46127,45623,56527,60205,61321,58088,54623,53495,51824,50518,49050,47111,45264,44357,54862,57871,59070,56273,52837,51702,49447,48965,46922,46256,45200,44471,53119,55016,56641,51847,47990,45744,46390,44461,41582,40813,38096,35461,44375,46255,45610,43375,40167,40628,40590,39473,36735,36634,32806,32907,41076,42254,43215,41116,40373) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > 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/1mzrn1230065462.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/23g1r1230065462.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.160094994 0.159126665 -0.025674441 0.092619968 [6] -0.122456345 -0.021383578 0.098665567 -0.032403752 0.072253771 [11] -0.088186620 0.432228791 -0.279690744 0.048273429 -0.078069288 [16] -0.066309024 -0.250069365 -0.003946551 -0.043824928 -0.071257691 [21] 0.028633981 0.002584757 0.167715875 -0.165419831 0.008964098 [26] -0.040344533 0.021231814 -0.107553452 -0.025890973 0.017096458 [31] 0.003845530 0.081472287 0.026548505 -0.005173210 -0.057889691 [36] -0.031263301 0.011223318 -0.005662473 0.007278637 -0.037251902 [41] -0.005412277 -0.047769988 0.025749655 0.028097467 -0.015685531 [46] -0.005360788 -0.039565301 > (mypacf <- c(rpacf$acf)) [1] -0.160094994 0.137007824 0.019083016 0.073074505 -0.104078573 [6] -0.079726991 0.123500110 0.009782657 0.058385322 -0.084508277 [11] 0.399573160 -0.179934301 -0.133452764 -0.031686865 -0.144849589 [16] -0.191127543 -0.039146647 -0.093687417 -0.035879940 0.017516597 [21] 0.063638770 0.016523833 0.067738884 -0.049699755 -0.002705433 [26] 0.130582696 0.049682972 -0.201768873 0.005131674 0.022940052 [31] -0.008539721 -0.051993642 -0.183001256 -0.050515275 -0.003984399 [36] 0.034972955 -0.022065699 0.086847522 0.039771420 -0.103037217 [41] -0.038334806 0.020426228 0.009867198 0.016533398 -0.017103939 [46] -0.039994536 > 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/3o4px1230065462.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/4jchx1230065462.tab") > > system("convert tmp/1mzrn1230065462.ps tmp/1mzrn1230065462.png") > system("convert tmp/23g1r1230065462.ps tmp/23g1r1230065462.png") > > > proc.time() user system elapsed 1.545 0.539 1.640