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(105.6,110.2,104.9,102.9,102.6,103.6,107.8,106.6,106,105.2,107.9,107.5,107.5,113.3,107.8,104.5,105.1,104.2,106.6,103.8,107.7,106.4,110,113.2,113.9,112,113.9,113.1,111.7,110.7,113.5,114,112.7,112.2,115.8,118.4,118.8,123.9,118,120.2,118.7,119.8,124.8,121.3,120.2,118.3,129.6,130.2,127.19,133.1,129.12,123.28,123.36,124.13,126.96,127.14,123.7,123.67,130.19,134.01,124.96,129.96,128.32,132.38,126.25,128.91,131.42,129.44,126.86,126.71,131.63,132.78,126.61,132.84,123.14,128.13,125.49,126.48,130.86,127.32,126.56,126.64,129.26,126.47,135.38,135.5,132.22,122.62,125.16,128.5,133.86,128.87,125.07,125.25,132.16,130.24) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/102a51228575448.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/2ivnr1228575448.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.00000000 0.90341852 0.85885792 0.82979727 0.82525088 0.80100179 [7] 0.75589301 0.73793145 0.71262667 0.69775385 0.67391791 0.65691085 [13] 0.65482163 0.60620005 0.56667837 0.53631182 0.50130860 0.47177317 [19] 0.41853016 0.40238014 0.35220437 0.32382178 0.29660937 0.28309885 [25] 0.26574305 0.20880678 0.17221728 0.14041794 0.10242808 0.07834312 [31] 0.02975665 0.01519407 -0.02200063 -0.05866198 -0.08334428 -0.08424989 [37] -0.08245003 -0.14506254 -0.17227235 -0.19312154 -0.20915621 -0.22637845 [43] -0.25025107 -0.25913038 -0.28274435 -0.29235145 -0.31695039 -0.31236364 [49] -0.30353632 > (mypacf <- c(rpacf$acf)) [1] 0.903418516 0.232234928 0.139585647 0.200455821 0.008861530 [6] -0.119694126 0.074580515 -0.034075446 0.031888428 0.015535039 [11] 0.025804873 0.097343105 -0.214815979 -0.103811741 -0.011713665 [16] -0.138872369 0.007997894 -0.094344194 0.080894168 -0.144051154 [21] -0.004464014 0.043685846 0.063143064 -0.006834632 -0.135674156 [26] -0.044242495 -0.033382364 -0.120670007 0.105623000 -0.064892937 [31] 0.062394385 -0.025184102 -0.102807708 0.009913894 0.134437025 [36] 0.042008001 -0.183476515 -0.018076922 0.008843305 -0.061286095 [41] 0.058966329 0.079488487 0.001212997 -0.053115501 0.028803534 [46] -0.156857226 0.088468876 0.031891104 > 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/3mlet1228575448.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/4yo681228575448.tab") > > system("convert tmp/102a51228575448.ps tmp/102a51228575448.png") > system("convert tmp/2ivnr1228575448.ps tmp/2ivnr1228575448.png") > > > proc.time() user system elapsed 0.578 0.303 0.865