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(113.9000,112.0000,113.8500,113.0800,111.7200,110.6900,113.5300,113.9900,112.7400,112.1500,115.8200,118.3800,118.8100,123.8500,117.9600,120.1600,118.7400,119.8400,124.8100,121.3300,120.2000,118.3200,129.5800,130.2000,127.1900,133.1000,129.1200,123.2800,123.3600,124.1300,126.9700,127.1400,123.7000,123.6700,130.1900,134.0100,124.9600,129.9600,128.3200,132.3800,126.2500,128.9100,131.4200,129.4400,126.8600,126.7100,131.6300,132.7800,126.6100,132.8400,123.1400,128.1300,125.4900,126.4800,130.8600,127.3200,126.5600,126.6400,129.2600,126.4700,135.4000,135.5000,132.2200,122.6200,125.1600,128.5000,133.8600,128.8700,125.0700,125.2500,132.1600,130.2400) > 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/1vkqx1228579165.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/2jr0a1228579165.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.772690149 0.658546958 0.609056800 0.635983523 [6] 0.599795556 0.506470301 0.467401035 0.421670180 0.387058982 [11] 0.332649301 0.313148069 0.344060365 0.251625848 0.185262040 [16] 0.155926681 0.129393387 0.100146789 0.040934183 0.074608786 [21] 0.020657278 -0.010290073 -0.044769143 0.002332098 0.015630963 [26] -0.056071121 -0.054570595 -0.046184910 -0.092731809 -0.107708645 [31] -0.154904910 -0.115126494 -0.148592618 -0.210445842 -0.224984429 [36] -0.160219876 -0.107683578 -0.201037609 -0.218329529 -0.219860298 [41] -0.206849291 -0.215577238 -0.201693171 -0.181780215 -0.185033142 [46] -0.204741822 -0.221554123 -0.173521425 -0.149813785 > (mypacf <- c(rpacf$acf)) [1] 0.772690149 0.152616706 0.152295395 0.257096377 0.019770008 [6] -0.114715922 0.042249680 -0.074289048 -0.036713674 -0.027406742 [11] 0.043149618 0.158264441 -0.207969242 -0.055387073 0.022297204 [16] -0.139690721 -0.003411494 -0.013160567 0.159785496 -0.122360161 [21] -0.018925370 0.026941470 0.114295718 -0.064943698 -0.088562073 [26] 0.136980956 -0.034437244 -0.254173795 0.121363823 -0.079068462 [31] -0.027342892 -0.036196679 -0.099869460 0.093634283 0.085129679 [36] 0.025378451 -0.088268208 -0.059916027 -0.061038487 -0.006720559 [41] 0.014982927 0.119142354 -0.019232158 0.029530012 -0.016639223 [46] -0.149712866 0.064893610 -0.080771032 > 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/3dzxa1228579165.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/4f5kq1228579165.tab") > > system("convert tmp/1vkqx1228579165.ps tmp/1vkqx1228579165.png") > system("convert tmp/2jr0a1228579165.ps tmp/2jr0a1228579165.png") > > > proc.time() user system elapsed 0.585 0.301 0.730