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(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 = '2' > par3 = '2' > 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/1pg2m1227719947.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/2s2hb1227719947.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.693391316 0.352332773 -0.256013350 0.090668103 [6] 0.019115978 -0.001902213 -0.013914452 -0.056367822 0.154494164 [11] -0.140136525 0.232328244 -0.433541034 0.351955481 -0.193484983 [16] 0.180383164 -0.114455698 0.012250456 0.004986367 0.066994305 [21] -0.126358343 0.130825109 -0.167790039 0.138264127 0.046047015 [26] -0.155206384 0.136722502 -0.116561044 0.047226784 0.041355072 [31] -0.025504237 -0.082165890 0.153753222 -0.151388466 0.147032792 [36] -0.116142234 0.016819117 0.051110011 -0.051469596 0.054851412 [41] -0.011386711 -0.090074228 0.136280081 -0.113326515 0.068322045 [46] 0.014106136 -0.122673554 0.163316477 -0.142522567 0.103809375 [51] -0.031537937 -0.037494484 0.035035121 0.050182075 -0.133214425 [56] 0.140527385 -0.103250860 0.023095616 0.112025740 -0.149600737 [61] 0.092924084 > (mypacf <- c(rpacf$acf)) [1] -0.693391316 -0.247412646 -0.251973806 -0.345001284 -0.216071761 [6] -0.117969374 -0.148761822 -0.296022454 -0.044447649 -0.008078690 [11] 0.365978829 -0.081622359 -0.177595917 -0.091894431 -0.043252258 [16] -0.104268389 -0.131232778 -0.092907370 0.123121486 -0.150195432 [21] 0.101190542 0.027919436 0.088215464 0.121921920 -0.055363497 [26] -0.015145699 0.100262172 -0.157384164 -0.078078697 0.076416299 [31] -0.016502559 -0.075550865 0.011846277 -0.009867903 0.091245852 [36] 0.014333159 -0.019480432 0.036566745 0.024641083 0.054503415 [41] -0.069447863 0.044271828 -0.019822786 -0.104628310 0.080538098 [46] -0.034358631 -0.046132644 -0.127660962 -0.076473765 0.056845545 [51] -0.025596135 0.017485043 0.075094806 0.031724902 -0.006262041 [56] -0.043924896 -0.008047438 0.084043956 0.061764662 -0.032658680 > 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/37r0w1227719948.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/4p84z1227719948.tab") > > system("convert tmp/1pg2m1227719947.ps tmp/1pg2m1227719947.png") > system("convert tmp/2s2hb1227719947.ps tmp/2s2hb1227719947.png") > > > proc.time() user system elapsed 1.537 0.538 1.642