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(88827,85874,85211,87130,88620,89563,89056,88542,89504,89428,86040,96240,94423,93028,92285,91685,94260,93858,92437,92980,92099,92803,88551,98334,98329,96455,97109,97687,98512,98673,96028,98014,95580,97838,97760,99913,97588,93942,93656,93365,92881,93120,91063,90930,91946,94624,95484,95862,95530,94574,94677,93845,91533,91214,90922,89563,89945,91850,92505,92437) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1nwl81229436474.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/20w6t1229436474.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.00000000 0.86658367 0.75674814 0.65689391 0.55672393 0.47143982 [7] 0.35913841 0.28010876 0.19242447 0.11181933 0.11322648 0.08754426 [13] 0.08636074 0.06288052 0.06805359 0.10535941 0.07533121 0.05548530 [19] 0.01733923 -0.03809535 -0.06154468 -0.13018689 -0.21875773 -0.32340277 [25] -0.38469239 -0.40959853 -0.39506461 -0.38106928 -0.36645234 -0.33841864 [31] -0.30525341 -0.27205931 -0.22054542 -0.18378652 -0.15529360 -0.12614878 [37] -0.09378775 > (mypacf <- c(rpacf$acf)) [1] 0.866583665 0.023213398 -0.015207032 -0.054961895 -0.002545568 [6] -0.158589566 0.044359541 -0.090314064 -0.035734090 0.259148460 [11] -0.075279165 0.061207031 -0.092521378 0.101311612 0.072128551 [16] -0.197544556 -0.048346787 -0.076676020 -0.063678100 0.044653680 [21] -0.148991706 -0.269803249 -0.078727490 0.118994965 -0.041790385 [26] 0.223126805 -0.116754571 0.032135974 0.060102315 -0.142278130 [31] -0.053787430 0.016998193 0.046839337 0.045004282 0.051927324 [36] -0.060722393 > 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/3tnhm1229436474.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/48yey1229436474.tab") > > system("convert tmp/1nwl81229436474.ps tmp/1nwl81229436474.png") > system("convert tmp/20w6t1229436474.ps tmp/20w6t1229436474.png") > > > proc.time() user system elapsed 0.562 0.312 0.767