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(132.8,132.5,131.4,131.4,130.7,131.5,131.2,130.1,130.5,129,128.2,128.4,127.3,127.7,127,123.9,125.4,124.6,124.5,124.8,124.1,124.2,122.8,122.3,121.1,121.7,122.2,122.2,122.7,121.7,121,119.8,120.2,116.6,116,118,117.1,116.2,113.3,114.3,113.6,113,112.9,112.7,112.5,113,111.9,110.9,109.8,108.3,109.2,109.2,108.7,109.8,110.8,110,109.6,109.5,110.8,111.6,113.1,114.3,114.1,113.8,112.6,112.7,111.5,110.7,110.4,109.7,110,111.3,109,108.2,107.2,108.7,110.3,110.3,109.5,109.5,109.4,109.6,111.3,110,109.5,110.693,109.195,108.095,108.199,106.87,105.278,108.711,111.192,109.641,109.42,109.935,111.126,110.733,110.34,111.766,111.294,111.54,112.008,111.007,114.963,112.045,110.703,108.894,107.51,111.35,112.964,115.203,115.182,115.191,112.346,110.774,113.07,111.138,109.092,107.971,107.051) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/freestat/rcomp/tmp/1hcrf1272907500.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/freestat/rcomp/tmp/2rlqi1272907500.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.953933627 0.909594111 0.871889956 0.836268583 [6] 0.809444089 0.773831568 0.742297218 0.712900667 0.682572837 [11] 0.655586790 0.627131752 0.597000627 0.562938799 0.529868982 [16] 0.501541085 0.482333615 0.461362834 0.434861449 0.406735067 [21] 0.375379115 0.345870709 0.315353076 0.287570699 0.264255444 [26] 0.242606501 0.216628282 0.189228893 0.163941963 0.138411578 [31] 0.111690193 0.084955360 0.058696872 0.033612044 0.017184794 [36] -0.002721378 -0.026914732 -0.050574049 -0.069228547 -0.076620152 [41] -0.089168259 -0.102660555 -0.117953831 -0.133116569 -0.144740147 [46] -0.152748741 -0.164494981 -0.175605786 -0.180567130 > (mypacf <- c(rpacf$acf)) [1] 0.9539336274 -0.0043911965 0.0508421757 0.0055665550 0.0845029844 [6] -0.1066922716 0.0387534568 -0.0026053414 -0.0136906113 0.0062478830 [11] -0.0138673506 -0.0376856083 -0.0653123442 -0.0053252141 0.0182527693 [16] 0.0863175668 -0.0306180621 -0.0534397950 -0.0353877244 -0.0543029653 [21] -0.0230143742 -0.0358477994 0.0190337634 0.0221886265 0.0173169890 [26] -0.0747482795 -0.0351069231 -0.0115018658 -0.0225116853 -0.0275452687 [31] -0.0038240857 -0.0202804335 -0.0292720026 0.0731863838 -0.0667379052 [36] -0.0605352102 -0.0174526694 0.0628076106 0.0999948859 -0.0602164096 [41] -0.0202668887 -0.0497963088 0.0003545913 -0.0138741518 0.0492654804 [46] -0.0618604646 0.0160342301 0.0694042418 > 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/36esj1272907501.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/4rwq61272907501.tab") > > try(system("convert tmp/1hcrf1272907500.ps tmp/1hcrf1272907500.png",intern=TRUE)) character(0) > try(system("convert tmp/2rlqi1272907500.ps tmp/2rlqi1272907500.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.793 0.413 0.929