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(40.04,40.04,40.03,40.03,41.63,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.03,42.38,42.06,42.06,42.05,42.05,42.05,42.05,44.36,44.48,44.49,44.49,44.49,44.49,44.49,44.48,44.48,44.48,44.48,44.48,44.48,44.49,44.49,44.49,44.49,44.49,44.49,44.49,44.49,45.5,45.94,45.95,45.96,45.96,45.96,45.96,45.96,45.96,45.96,45.96,45.97,46.06,47.9,47.93,47.94,47.94,47.94,47.94,47.94,47.94,47.94,47.94) > par5 = '12' > par4 = '0' > par3 = '0' > 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/freestat/rcomp/tmp/1g6551243888628.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/2lgto1243888628.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.939080694 0.874086134 0.808800556 0.743504494 [6] 0.696454614 0.653954003 0.613496398 0.570978132 0.528428982 [11] 0.486168138 0.463030243 0.440641408 0.415868341 0.385859486 [16] 0.355792425 0.325709640 0.295240929 0.263581062 0.233333590 [21] 0.203087497 0.172622383 0.139606295 0.104733726 0.077777793 [26] 0.040316365 0.002342391 -0.035597375 -0.072591225 -0.083919123 [31] -0.094299036 -0.104555375 -0.114678739 -0.124946377 -0.136397723 [36] -0.159584352 -0.183079103 -0.206648336 -0.230363509 -0.254019097 [41] -0.277603790 -0.299650849 -0.323334310 -0.346933623 -0.369291160 [46] -0.368673123 -0.372998465 -0.379276883 -0.385582612 > (mypacf <- c(rpacf$acf)) [1] 0.9390806936 -0.0659153735 -0.0360739367 -0.0360675504 0.1180904540 [6] 0.0003144485 -0.0127704684 -0.0473225094 -0.0054036798 -0.0170796857 [11] 0.1424076098 -0.0292795937 -0.0399793906 -0.0692412862 0.0304775217 [16] -0.0134544760 -0.0232428525 -0.0593519020 -0.0054894495 -0.0247532762 [21] 0.0043143527 -0.0603150439 -0.0474677531 0.0244733582 -0.1087017532 [26] -0.0380295121 -0.0438307589 -0.0197512646 0.1772603407 -0.0338101683 [31] -0.0337752490 -0.0372703264 0.0358965403 0.0068994954 -0.1505114449 [36] -0.0500977518 -0.0228198008 -0.0070474565 0.0094039950 -0.0603289967 [41] -0.0444450305 -0.0546821285 -0.0101702051 -0.0244073945 0.1284599408 [46] -0.1124961399 -0.0217828036 -0.0363145841 > 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/3em4a1243888628.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/4vjid1243888628.tab") > > system("convert tmp/1g6551243888628.ps tmp/1g6551243888628.png") > system("convert tmp/2lgto1243888628.ps tmp/2lgto1243888628.png") > > > proc.time() user system elapsed 0.802 0.428 0.935