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(112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140,145,150,178,163,172,178,199,199,184,162,146,166,171,180,193,181,183,218,230,242,209,191,172,194,196,196,236,235,229,243,264,272,237,211,180,201,204,188,235,227,234,264,302,293,259,229,203,229,242,233,267,269,270,315,364,347,312,274,237,278,284,277,317,313,318,374,413,405,355,306,271,306,315,301,356,348,355,422,465,467,404,347,305,336,340,318,362,348,363,435,491,505,404,359,310,337,360,342,406,396,420,472,548,559,463,407,362,405,417,391,419,461,472,535,622,606,508,461,390,432) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.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/freestat/rcomp/tmp/13z1z1228229433.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/242j11228229433.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.953703369 0.898915946 0.850802488 0.808425169 [6] 0.778899391 0.756442223 0.737601713 0.727131350 0.733648701 [11] 0.744255249 0.758026650 0.761942918 0.716504481 0.663042789 [16] 0.618362857 0.576208728 0.543801319 0.519456114 0.500702924 [21] 0.490402805 0.498181902 0.506166639 0.516743387 0.520489725 [26] 0.483523671 0.437398308 0.400406687 0.364130924 0.336982290 [31] 0.314722718 0.296775217 0.288616437 0.295354682 0.304547264 [36] 0.315096128 0.319293153 0.286211387 0.245016054 0.210895845 [41] 0.175094639 0.145849676 0.124827682 0.106455644 0.099003343 [46] 0.103784572 0.111262700 0.120422864 0.124792402 0.095753613 [51] 0.057950091 0.031063672 0.003806467 -0.019879721 -0.040853907 [56] -0.058054375 -0.066081954 -0.061276729 -0.054916439 -0.050484054 [61] -0.049552685 > (mypacf <- c(rpacf$acf)) [1] 0.953703369 -0.117569756 0.054232738 0.023756139 0.115822195 [6] 0.044367631 0.038034142 0.099622097 0.204095742 0.063909253 [11] 0.106035483 -0.042466275 -0.485430132 -0.034350194 0.042224535 [16] -0.044197224 0.027607922 0.037147942 0.041638426 0.014399904 [21] 0.073312465 -0.033395258 0.060996727 0.031077819 -0.194374014 [26] -0.035075894 0.036454575 -0.035175307 0.044254783 -0.044544574 [31] -0.003337424 0.034140566 -0.019607062 0.027721916 0.029354141 [36] -0.003733930 -0.131797029 -0.002813323 -0.024863618 -0.058589119 [41] 0.005633398 0.037962111 -0.032236980 0.031401614 -0.048811504 [46] 0.010917862 0.028875340 -0.005720886 -0.080610462 -0.016264139 [51] 0.068466267 0.010499020 -0.037366839 -0.072252955 0.018123185 [56] -0.020253592 -0.023257484 -0.021534077 -0.041996229 0.010646579 > 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/36fe41228229433.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/4e15l1228229433.tab") > > system("convert tmp/13z1z1228229433.ps tmp/13z1z1228229433.png") > system("convert tmp/242j11228229433.ps tmp/242j11228229433.png") > > > proc.time() user system elapsed 0.822 0.421 0.902