R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(49.1,52.7,55.1,60.4,57.5,55.9,62.6,61.3,67.1,68.6,74.8,76.9,85.7,86.5,90.8,89.7,96.3,107.5,109.2,100.2,116.8,120.1,123.3,130.2,131.4,125.6,124.5,134.3,135.2,151.8,146.4,140.0,127.8,148.0,165.9,165.5,179.9,190.0,189.8,190.9,203.6,183.5,169.3,144.2,141.5,154.3,169.5,194.0,203.2,192.9,209.4,227.2,263.7,297.8,337.1,361.3,355.2,312.6,309.9,323.7,324.1,355.3,383.4,395.1,412.8,407.0,438.0,446.1,452.5,447.3,475.9,487.7) > par5 = '1' > 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/rcomp/tmp/1fbk21242320363.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/2xhzl1242320363.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.945122992 0.887017709 0.833182842 0.777742916 [6] 0.723494338 0.671395253 0.626206892 0.575638168 0.526319939 [11] 0.478484127 0.438683310 0.405855672 0.372845055 0.342029477 [16] 0.307678162 0.259029071 0.205131472 0.155586933 0.113851681 [21] 0.077389664 0.052247009 0.032466670 0.017441464 0.001139731 [26] -0.013275170 -0.024053298 -0.033045505 -0.038132528 -0.044320572 [31] -0.054255727 -0.069926240 -0.092495645 -0.114945805 -0.136124957 [36] -0.156402287 -0.175011752 -0.188421312 -0.202039460 -0.212363471 [41] -0.218277225 -0.225587707 -0.238391676 -0.255638640 -0.272821403 [46] -0.291538572 -0.306543032 -0.320854929 -0.333945513 > (mypacf <- c(rpacf$acf)) [1] 0.945122992 -0.058456186 0.010190938 -0.046844847 -0.017445133 [6] -0.013235152 0.033929644 -0.081966401 -0.012390392 -0.025155570 [11] 0.047966043 0.033320412 -0.022883736 -0.009245882 -0.056083275 [16] -0.157803436 -0.074163299 -0.006939369 0.030788315 0.018044785 [21] 0.074858736 0.016773045 0.038142728 -0.031499783 -0.003343251 [26] -0.015555090 -0.016019311 0.012091398 -0.014266966 -0.034919392 [31] -0.030316965 -0.060783465 -0.023076586 -0.030944128 -0.041849910 [36] -0.037687766 0.007899245 -0.031693531 0.033560355 0.023257823 [41] -0.027604819 -0.081886872 -0.075162239 -0.038364826 -0.027169306 [46] 0.028936282 0.002534635 -0.001722462 > 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/3yfv51242320363.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/4q1si1242320363.tab") > > system("convert tmp/1fbk21242320363.ps tmp/1fbk21242320363.png") > system("convert tmp/2xhzl1242320363.ps tmp/2xhzl1242320363.png") > > > proc.time() user system elapsed 0.575 0.305 0.688