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(6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.1,8.2,8.1,8.1,7.9,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.6,6.2,6.2,6.8) > par5 = '12' > par4 = '2' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/12cr81229165262.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/2vmq21229165262.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.4672507136 -0.1171630715 -0.5970061375 -0.6374274911 [6] -0.2476513518 0.0844142861 0.3738918209 0.4223570567 0.2810605848 [11] -0.0004321974 -0.2790867582 -0.4705990531 -0.2476866792 0.0640975017 [16] 0.3236998000 0.3130058588 0.0930670029 -0.0410304387 -0.2158238358 [21] -0.1374685811 -0.0642871675 0.0117915972 0.1030518897 0.0371900205 [26] 0.0610277729 0.0052179377 -0.0283591633 -0.0780786484 -0.1098522962 [31] -0.0579723253 0.1012574563 0.1727684585 0.1008162392 -0.0352324796 [36] -0.1483241265 -0.0842338907 -0.0313487164 0.0735113870 0.0341839312 [41] 0.0279394934 0.0380443933 0.0033733945 -0.0299228409 -0.1042845918 [46] -0.0417908556 0.0379982923 0.0664185895 0.0667818859 > (mypacf <- c(rpacf$acf)) [1] 0.4672507136 -0.4291880140 -0.4990316167 -0.3021331174 -0.0699401160 [6] -0.3767522961 -0.1551938139 -0.0117119941 0.0412786809 -0.0459220000 [11] 0.0179701557 -0.2436028731 0.1494797173 0.0038117233 -0.0404294292 [16] -0.1471229018 0.0028372732 0.0764273223 -0.1425975994 0.1283628473 [21] 0.1012888135 -0.0165457707 0.0606949208 -0.1618275798 0.0848712314 [26] -0.0004161907 -0.0283830171 -0.2541332923 -0.1717731903 -0.0833826844 [31] 0.0153944579 -0.0168120931 -0.1033511924 -0.0271370360 0.0829778165 [36] -0.0288723004 0.0186604983 0.0936079188 -0.0297659310 -0.0294427453 [41] -0.0626783887 -0.0063136523 -0.0383127613 0.0387233966 -0.0002413170 [46] -0.0711546969 -0.0880455660 0.0578936483 > 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/340c81229165262.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/4hr2h1229165263.tab") > > system("convert tmp/12cr81229165262.ps tmp/12cr81229165262.png") > system("convert tmp/2vmq21229165262.ps tmp/2vmq21229165262.png") > > > proc.time() user system elapsed 0.605 0.315 0.723