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(6.3,6.2,6.1,5.9,5.8,5.7,5.7,5.7,5.5,5.5,5.5,5.4,5.3,5.3,5.3,5.4,5.4,5.4,5.4,5.4,5.5,5.7,5.8,5.9,6,6.1,6.1,6.1,6.2,6.3,6.6,6.6,6.5,6.5,6.6,6.6,6.6,6.6,6.6,6.8,6.8,6.7,6.7,6.7,6.7,6.8,6.8,6.9,7,7,7,6.8,6.8,6.9,7.1,7.2,7.2,7,7,7,7,7.1,7.1,7.1,7.1,7.1,7.1,7.1,7.1,7.1,7.1,7.1,7.2,7.2,7.2,7.1,7.1,7.1,6.9,6.8,6.8,6.8,6.7,6.7,6.6,6.6,6.5,6.5,6.4,6.3,6.2,6.2,6.1,6,6,6,6,5.9,5.8,5.8,5.7,5.7) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1c96y1228575496.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/2aie31228575496.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.98152085 0.95455237 0.92617910 0.89543697 0.86329005 [7] 0.82720973 0.78494834 0.73875354 0.68625647 0.62960564 0.57273445 [13] 0.51411691 0.46027565 0.40930457 0.35839409 0.30501559 0.25338343 [19] 0.20399893 0.15748461 0.11068933 0.06822962 0.03010546 -0.00571043 [25] -0.03775268 -0.06820834 -0.09916531 -0.12815559 -0.15287090 -0.17443508 [31] -0.19453387 -0.21479242 -0.23420809 -0.25452724 -0.27709405 -0.29791452 [37] -0.31733020 -0.33253151 -0.34604707 -0.36012455 -0.37239509 -0.38466563 [43] -0.39930503 -0.41225868 -0.42408850 -0.43282778 -0.43351846 -0.43392817 [49] -0.43574268 -0.44042736 -0.44657743 -0.44963696 -0.44707734 -0.44255101 [55] -0.43459260 -0.42573071 -0.41714978 -0.40716406 -0.39848397 -0.38615143 [61] -0.37100932 > (mypacf <- c(rpacf$acf)) [1] 0.9815208484 -0.2411680527 0.0006966286 -0.0778864450 -0.0277709601 [6] -0.1200720762 -0.1506268748 -0.0745149966 -0.1789829050 -0.0845464845 [11] -0.0102056722 -0.0738004786 0.1577654406 0.0221249440 0.0152202127 [16] -0.0900359451 0.0693924752 0.0027592077 -0.0159451696 -0.1082908312 [21] 0.0638874359 -0.0057710524 -0.0148624336 0.0329213341 -0.0261804327 [26] -0.0790709308 -0.0019932037 0.0168172894 -0.0073727140 -0.0708124051 [31] -0.0304817246 -0.0684714222 -0.0908492570 -0.0992305671 0.0402081474 [36] -0.0578979141 0.1050769416 -0.0354972425 -0.0112904112 0.0612574228 [41] -0.0139593277 -0.0994519083 -0.0269262656 -0.0495752818 0.0531392074 [46] 0.1167089897 -0.0823895982 -0.0540766844 -0.1012698537 -0.0502915077 [51] 0.0288572326 0.0537807296 -0.0085206360 -0.0061783948 -0.0229116432 [56] -0.0230953788 0.0300902336 -0.0398317166 0.0915045312 -0.0522961019 > 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/37pu41228575496.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/4xzj71228575496.tab") > > system("convert tmp/1c96y1228575496.ps tmp/1c96y1228575496.png") > system("convert tmp/2aie31228575496.ps tmp/2aie31228575496.png") > > > proc.time() user system elapsed 0.627 0.354 0.902