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(22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.4' > 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/freestat/rcomp/tmp/1yoox1228763871.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/freestat/rcomp/tmp/204xp1228763871.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.0000000000 0.2830861044 0.3113590805 0.0096988213 0.0083312980 [6] -0.0328844761 0.0778137494 0.0117211759 0.1227666406 0.0560695151 [11] -0.2024941582 -0.2864492645 -0.3628705773 -0.2408230767 -0.0228118307 [16] 0.0201342699 0.0406876905 0.0751612836 0.0225911909 -0.0554745244 [21] -0.0455987271 0.0780625860 -0.0158762921 0.2694376208 0.0302039824 [26] 0.1781040756 0.0435312782 0.0457161499 -0.1305546823 0.0316765913 [31] -0.1447983746 -0.0776942878 -0.1391711270 -0.1659262178 -0.0990304068 [36] -0.1255918292 -0.2218914482 -0.1236321413 -0.1446420928 -0.0253834456 [41] -0.0428461411 -0.0085972649 0.0405444731 0.0657594027 0.1041069284 [46] 0.0198863085 0.0756322229 0.0091999548 0.1074154510 0.0353176062 [51] 0.0685120564 -0.0538870839 0.0597739160 -0.0215796214 0.0180286380 [56] -0.0198027429 0.0087706968 -0.0163403505 -0.0003365625 -0.0021120114 > (mypacf <- c(rpacf$acf)) [1] 0.283086104 0.251365176 -0.147892315 -0.047742782 0.021506233 [6] 0.113127942 -0.030410771 0.076917025 0.026864595 -0.332510317 [11] -0.236956798 -0.128185057 -0.001980382 0.172742270 0.042077882 [16] -0.026131655 0.049350241 0.075857722 -0.010785349 -0.022185614 [21] 0.144421074 -0.272991146 0.065328918 -0.075903997 0.114576876 [26] 0.121274852 0.013387857 -0.142003996 0.034496872 -0.089739422 [31] -0.161650300 -0.135939100 -0.024853657 -0.030465400 -0.056141828 [36] -0.093628765 0.079093790 0.018637519 0.106500468 -0.091242019 [41] -0.100948786 0.020359284 -0.142667442 -0.036740077 0.066258681 [46] -0.041172599 -0.049812272 -0.009551657 0.093354526 -0.014185882 [51] -0.037208980 -0.041240911 0.022165721 0.047756622 -0.027669495 [56] 0.037101430 0.053610721 -0.030971305 0.092221620 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/382xh1228763871.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/freestat/rcomp/tmp/4ne7o1228763871.tab") > > system("convert tmp/1yoox1228763871.ps tmp/1yoox1228763871.png") > system("convert tmp/204xp1228763871.ps tmp/204xp1228763871.png") > > > proc.time() user system elapsed 0.843 0.432 1.549