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(206010,198112,194519,185705,180173,176142,203401,221902,197378,185001,176356,180449,180144,173666,165688,161570,156145,153730,182698,200765,176512,166618,158644,159585,163095,159044,155511,153745,150569,150605,179612,194690,189917,184128,175335,179566,181140,177876,175041,169292,166070,166972,206348,215706,202108,195411,193111,195198,198770,194163,190420,189733,186029,191531,232571,243477,227247,217859,208679,213188,216234,213586,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580,208795,197922,194596,194581,185686,178106,172608,167302,168053,202300,202388,182516,173476,166444,171297,169701,164182,161914,159612,151001,158114,186530,187069,174330,169362) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1x3w11228324328.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/2r03k1228324328.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.237743213 -0.310840704 -0.288981177 -0.142412041 [6] 0.058180603 0.084565055 0.069200151 -0.146586777 -0.244454636 [11] -0.292560604 0.264565431 0.834951527 0.196644463 -0.277771638 [16] -0.260829552 -0.146932245 0.028411603 0.070870537 0.049943067 [21] -0.140831328 -0.221641954 -0.260628523 0.255693189 0.706987412 [26] 0.141686271 -0.258609699 -0.235034283 -0.137625032 0.022464116 [31] 0.039906689 0.032287475 -0.132773816 -0.200924137 -0.245905795 [36] 0.261488883 0.647102625 0.087544151 -0.254276539 -0.228369822 [41] -0.119049113 0.019923022 0.053177020 0.029962257 -0.116088062 [46] -0.181118206 -0.209538575 0.221121606 0.545212590 0.054189800 [51] -0.208721330 -0.204005849 -0.104282790 0.007418615 0.055464066 [56] 0.034584841 -0.086117520 -0.156526497 -0.181308105 0.180348368 [61] 0.439414129 > (mypacf <- c(rpacf$acf)) [1] 0.237743213 -0.389370473 -0.117106053 -0.178985063 -0.002286293 [6] -0.083689112 0.034276189 -0.239979585 -0.167063371 -0.450691570 [11] 0.344012965 0.669772041 -0.021480126 0.116140858 0.175005176 [16] -0.079780785 0.032569672 -0.092567329 -0.057460154 -0.083307930 [21] -0.043647572 -0.076744154 -0.058025545 -0.032429793 -0.079878225 [26] -0.095544486 0.008471334 -0.058820210 0.059885806 -0.121311698 [31] 0.052434264 -0.060291809 -0.003112428 -0.126019514 0.093302983 [36] 0.071162228 -0.026214306 -0.046525791 0.032107541 -0.098955527 [41] 0.039300730 0.001408048 0.053958320 -0.008585038 0.090852078 [46] 0.027418647 -0.179866440 -0.144204248 -0.045800513 -0.061140390 [51] -0.045079458 -0.009999154 -0.041605957 -0.055324873 -0.016009114 [56] 0.018223537 -0.056955728 0.032654623 -0.034574030 -0.044102729 > 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/3vu701228324328.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/4rxbc1228324328.tab") > > system("convert tmp/1x3w11228324328.ps tmp/1x3w11228324328.png") > system("convert tmp/2r03k1228324328.ps tmp/2r03k1228324328.png") > > > proc.time() user system elapsed 0.600 0.321 0.774