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(88900,87280,85519,83647,81616,80100,94027,102327,104296,101593,94816,93535,93618,92330,90751,88576,86102,85494,103432,108870,109713,106960,103195,102348,102158,100431,97649,95611,93035,93579,111777,116065,116609,112934,107660,107965,107772,106201,102288,99217,96511,96456,113021,117836,118492,113922,109317,107496,105524,103824,101833,99436,96915,96072,111941,116008,117557,113445,108762,106661,102824,101912,99005,97894,96256,95606,108948,111223,113142,106078,100992,97413) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-2.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/rcomp/tmp/1e0gv1229287253.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/2uqcd1229287253.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.125300055 -0.160038391 -0.267789986 -0.021048038 [6] 0.053495514 0.056441390 0.072021291 -0.197673359 -0.074259506 [11] -0.088211961 0.273442685 0.128036751 -0.063625577 -0.012245768 [16] 0.026118497 -0.149321575 -0.031318728 0.059697517 -0.098259564 [21] -0.195352252 -0.026459151 0.098444076 0.134909390 0.024738633 [26] -0.150133950 -0.105413465 0.024194815 0.189017257 0.152025223 [31] 0.027364280 -0.185728734 -0.024741574 -0.063689109 -0.001286338 [36] 0.043435789 0.101921214 -0.011696141 -0.073566654 0.133536791 [41] 0.026854177 0.154110342 -0.036002240 0.006117256 -0.121873231 [46] -0.080237245 0.013647454 -0.021790812 -0.031291033 -0.099507951 [51] 0.099709952 0.057846267 0.000872480 -0.048834962 -0.045413893 [56] -0.020046358 -0.036423345 -0.023587859 -0.016430346 > (mypacf <- c(rpacf$acf)) [1] 0.1253000548 -0.1785416164 -0.2327423819 0.0149323663 -0.0239722654 [6] -0.0115437296 0.0785322953 -0.2232616685 0.0028309626 -0.1166830794 [11] 0.2197734814 0.0295282073 -0.0728385059 0.1655227954 0.0506359136 [16] -0.2587705886 0.1215122701 -0.0777312204 -0.1560108222 -0.1427854596 [21] 0.0172137927 -0.0347884956 0.0481159052 -0.0218108224 -0.1424730169 [26] -0.1602578656 0.1630318824 0.0960413308 0.0000288319 0.1705496178 [31] 0.0612792497 0.0173399903 -0.1551634741 -0.0403714556 -0.0379716125 [36] 0.0486722997 0.0656424598 -0.0417381013 0.1296386651 0.0139840048 [41] 0.0623646910 -0.0575823386 0.0333221212 -0.0019876047 -0.0448942074 [46] 0.0331116990 -0.0309662771 -0.0144054569 0.0364830352 -0.0963558649 [51] -0.0654313712 -0.0509736697 -0.0542517038 -0.0481646680 0.0621577949 [56] -0.0078664459 -0.0657063124 -0.0159156071 > 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/30eb01229287253.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/47gyj1229287253.tab") > > system("convert tmp/1e0gv1229287253.ps tmp/1e0gv1229287253.png") > system("convert tmp/2uqcd1229287253.ps tmp/2uqcd1229287253.png") > > > proc.time() user system elapsed 0.599 0.328 0.736