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(485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528) > 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/16dmf1229888669.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/2591y1229888669.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.247526122 -0.165967255 -0.268598476 -0.283857839 [6] 0.040196343 0.189883512 0.038158644 -0.305705592 -0.269562639 [11] -0.147215866 0.275780929 0.796031224 0.148915409 -0.134161407 [16] -0.237775183 -0.230497291 0.037340597 0.141761718 0.004765295 [21] -0.304694858 -0.238100987 -0.094211944 0.220025292 0.637662494 [26] 0.124960706 -0.139682448 -0.237564069 -0.195948065 0.035116836 [31] 0.099431995 -0.004179550 -0.268191039 -0.193275250 -0.079298520 [36] 0.174009793 0.534910581 0.107054310 -0.116472282 -0.212051289 [41] -0.158841901 0.008254943 0.077930014 -0.010225810 -0.232341195 [46] -0.145364807 -0.065702923 0.142649756 0.438055273 0.073300829 [51] -0.120775886 -0.175587626 -0.118568488 0.005936846 0.090297019 [56] -0.011120908 -0.189358824 -0.095328309 -0.055983049 0.121241473 [61] 0.345624172 > (mypacf <- c(rpacf$acf)) [1] 0.247526122 -0.242067728 -0.178398099 -0.233511643 0.098631357 [6] 0.032063761 -0.105963065 -0.367973870 -0.111825928 -0.198758762 [11] 0.211886823 0.672728487 -0.196529737 0.143966793 0.012206078 [16] 0.048370128 -0.074384846 -0.109033520 -0.015634182 -0.014995045 [21] -0.001901130 0.034608169 -0.226043112 0.147434984 0.025109891 [26] -0.153136667 -0.071657204 -0.061020752 0.032134424 -0.083020075 [31] -0.038733376 0.057771566 -0.016017296 -0.019589943 -0.042221684 [36] -0.037838861 0.051177097 0.024565761 -0.036702491 -0.005944455 [41] -0.061454536 0.089834925 -0.127579214 -0.013888716 0.039012856 [46] -0.043896538 -0.022426617 -0.067856809 -0.092027136 -0.055911315 [51] -0.018333649 -0.003489676 -0.060995949 0.056819282 0.019326737 [56] -0.008896051 0.027957255 -0.048190339 0.016852913 -0.080251035 > 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/3tszs1229888669.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/4oy881229888669.tab") > > system("convert tmp/16dmf1229888669.ps tmp/16dmf1229888669.png") > system("convert tmp/2591y1229888669.ps tmp/2591y1229888669.png") > > > proc.time() user system elapsed 0.600 0.318 0.708