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(111078,150739,159129,157928,147768,137507,136919,136151,133001,125554,119647,114158,116193,152803,161761,160942,149470,139208,134588,130322,126611,122401,117352,112135,112879,148729,157230,157221,146681,136524,132111,125326,122716,116615,113719,110737,112093,143565,149946,149147,134339,122683,115614,116566,111272,104609,101802,94542,93051,124129,130374,123946,114971,105531,104919,104782,101281,94545,93248,84031,87486) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1s7ew1229271906.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/29efg1229271906.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.796303299 0.504403202 0.257119106 0.113477616 [6] 0.065546943 0.037088734 0.008891238 0.007034256 0.107693688 [11] 0.307818754 0.544950022 0.672193541 0.487675092 0.239189913 [16] 0.024646518 -0.102472935 -0.151729234 -0.179994464 -0.203335818 [21] -0.200574330 -0.116105382 0.050212318 0.239262501 0.346086814 [26] 0.207598401 0.026045216 -0.129080835 -0.212618391 -0.241606679 [31] -0.259839114 -0.270359170 -0.267236777 -0.200468879 -0.080245131 [36] 0.061835372 0.142055149 0.038585525 -0.087483822 -0.186189031 [41] -0.231389095 -0.244361684 -0.252630771 -0.269619689 -0.272165912 [46] -0.230609892 -0.149725127 -0.046091667 0.017750180 -0.040604580 [51] -0.099222893 -0.135585013 -0.150869928 -0.148690732 -0.149724101 [56] -0.153131222 -0.150225102 -0.121361393 -0.075423700 -0.014771652 [61] 0.022080747 > (mypacf <- c(rpacf$acf)) [1] 0.7963032990 -0.3544557748 -0.0145485075 0.0623538417 0.0525846127 [6] -0.0809782495 -0.0104727190 0.0774955945 0.2814820738 0.2889556490 [11] 0.3153433179 0.0730600443 -0.6207596187 0.0589754465 -0.0735990780 [16] -0.0699805538 -0.0356551448 0.0418370494 0.0210811087 -0.0311128416 [21] -0.1168360929 -0.0644676787 -0.0664994498 0.1634271143 -0.0872398010 [26] 0.0730598828 0.0396567361 0.0343336637 -0.0703152483 -0.0573635584 [31] -0.0008240977 -0.0456339198 -0.0254301125 -0.0894257455 -0.0097647836 [36] -0.0102657922 -0.0110441773 -0.0216825482 0.0312284583 -0.0263353125 [41] -0.0178729472 -0.0403948221 -0.1113430582 0.0294800155 -0.0392173948 [46] -0.0160515267 -0.0014996375 0.0216322113 0.0811372435 0.0270898252 [51] -0.0154017044 -0.0928738918 0.0183974605 0.0215582856 0.0631982661 [56] -0.0019644413 0.0412967670 -0.0258884472 -0.0588716219 -0.0948388539 > 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/30k9x1229271906.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/4rmk01229271906.tab") > > system("convert tmp/1s7ew1229271906.ps tmp/1s7ew1229271906.png") > system("convert tmp/29efg1229271906.ps tmp/29efg1229271906.png") > > > proc.time() user system elapsed 0.608 0.313 0.717