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(95.1,95.9,95.9,96.9,95.7,97.8,95.9,98.2,101.2,106.8,108.2,108.2,113.2,115.2,122,119.8,119.8,112.7,113.8,118.6,119.2,118.1,121.6,125.3,126.5,133.6,136.5,131.9,131.9,139.3,139.9,140.1,142.1,141.8,143.5,143.6,140.6,137.4,133.9,134.6,134.6,132.1,132.5,134.1,135.1,136.4,136.6,138.1,138.4,141,144.9,153.4,156.5,160.7,163.9,166.7,169.7,174.3,181.8,187.8,182.4) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.8' > 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/1ryhp1229883736.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/2fwu61229883736.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.933379519 0.858948577 0.784499799 0.714905818 [6] 0.639766147 0.568315030 0.490136979 0.416184195 0.356712995 [11] 0.310298915 0.271129874 0.230692377 0.204100640 0.180752778 [16] 0.169577813 0.154282496 0.138914521 0.110885455 0.086722165 [21] 0.071158275 0.049746672 0.023214961 0.001235426 -0.019735000 [26] -0.044197898 -0.063982623 -0.081592456 -0.104325618 -0.128177149 [31] -0.141628544 -0.155408855 -0.169524332 -0.174296766 -0.181471458 [36] -0.192592399 -0.201561424 -0.206235490 -0.215470096 -0.225725434 [41] -0.232998372 -0.243978879 -0.258378936 -0.267566617 -0.276466683 [46] -0.298522243 -0.321817079 -0.350182154 -0.367921708 > (mypacf <- c(rpacf$acf)) [1] 0.933379519 -0.095097012 -0.036864141 -0.003823020 -0.088325526 [6] -0.011604564 -0.100942241 -0.015929071 0.063513664 0.039579879 [11] 0.017696593 -0.049839907 0.076288172 -0.017335002 0.055906701 [16] -0.058278584 -0.021657788 -0.094971912 0.004299942 0.053209003 [21] -0.078671314 -0.025625808 0.032186833 -0.015499491 -0.043374006 [26] -0.012918141 0.001655683 -0.067168492 -0.020731877 0.023759633 [31] -0.035275260 -0.020766614 0.056478098 -0.048307251 -0.046414920 [36] -0.010025265 -0.008888029 -0.043913527 -0.023798388 -0.008277852 [41] -0.053744821 -0.029008074 0.008487688 -0.037020187 -0.114983632 [46] -0.036118528 -0.101634198 0.039325809 > 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/32oec1229883736.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/4pil81229883736.tab") > > system("convert tmp/1ryhp1229883736.ps tmp/1ryhp1229883736.png") > system("convert tmp/2fwu61229883736.ps tmp/2fwu61229883736.png") > > > proc.time() user system elapsed 0.577 0.333 0.713