R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(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,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1d7cq1261910149.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/28rmb1261910149.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.4034783188 0.1874123339 -0.1644731111 -0.0779621286 [6] -0.0736684239 0.1049313429 -0.1062632692 0.2143697814 -0.0101776258 [11] -0.0628717150 0.0157445289 -0.1970929620 -0.0461908703 -0.0133128638 [16] 0.0626815957 0.0193882586 0.0803729618 -0.0464855013 -0.0032641812 [21] -0.0923095177 0.1653914573 -0.2542937700 0.2761668115 -0.1396072450 [26] 0.1544982890 -0.0064144288 0.0229090427 -0.1270476875 0.1336607021 [31] -0.1242755539 0.0343794096 -0.0009091875 -0.0959102641 0.1272887419 [36] -0.0282337256 -0.0482963131 0.0019804388 -0.0594139990 -0.0071079698 [41] 0.0803130172 -0.0555610972 0.0438567679 0.0196006905 -0.0204700828 [46] 0.0142840157 0.0084358740 0.0321666888 -0.0476182418 0.0126898460 [51] 0.0731404159 0.0004574960 -0.0266343190 -0.0287863757 -0.0051520017 [56] -0.0074883510 -0.0053494060 > (mypacf <- c(rpacf$acf)) [1] -0.4034783188 0.0294044743 -0.0947010949 -0.2155473096 -0.2032005721 [6] 0.0162597532 -0.1077779040 0.0837501837 0.1408550226 -0.0552480654 [11] -0.0150729699 -0.1678162660 -0.2150720337 -0.1934967901 -0.0779029813 [16] -0.1189812577 -0.1009759233 -0.0482076962 -0.0684636253 -0.1153066143 [21] 0.1984777566 -0.1813135887 0.0076844873 -0.0507801150 -0.0409489272 [26] 0.0003301834 0.0327343335 -0.0708709526 0.0139598927 0.0736302412 [31] -0.0731588105 -0.0912368989 -0.1006233816 -0.0425285748 -0.0042251204 [36] -0.0650395829 -0.0660234669 -0.0964725435 0.0005026817 0.0379872982 [41] -0.0274934743 -0.0657027849 0.0231355323 -0.1214857612 -0.0197967764 [46] -0.0670688652 0.0725456682 -0.0908206493 -0.0745002981 0.0211206580 [51] 0.0737334666 -0.0429968789 -0.0490257056 0.0223287271 -0.0947668031 [56] -0.0287634174 > 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/3ccu21261910149.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/4fqcp1261910150.tab") > > try(system("convert tmp/1d7cq1261910149.ps tmp/1d7cq1261910149.png",intern=TRUE)) character(0) > try(system("convert tmp/28rmb1261910149.ps tmp/28rmb1261910149.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.597 0.316 0.789