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(104.9,110.9,104.8,94.1,95.8,99.3,101.1,104,99,105.4,107.1,110.7,117.1,118.7,126.5,127.5,134.6,131.8,135.9,142.7,141.7,153.4,145,137.7,148.3,152.2,169.4,168.6,161.1,174.1,179,190.6,190,181.6,174.8,180.5,196.8,193.8,197,216.3,221.4,217.9,229.7,227.4,204.2,196.6,198.8,207.5,190.7,201.6,210.5,223.5,223.8,231.2,244,234.7,250.2,265.7,287.6,283.3,295.4,312.3,333.8,347.7,383.2,407.1,413.6,362.7,321.9,239.4) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.5' > 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/17rwz1228817880.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/222b11228817880.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.0000000000 0.1381996609 0.0089081763 -0.0258623574 -0.0582365812 [6] 0.0742601744 -0.1196038113 -0.0205257196 -0.1063751857 -0.1452354104 [11] 0.0868577827 -0.0052767619 -0.0250756945 -0.1316660389 0.0377834730 [16] 0.0874681789 -0.1402988850 -0.0342517185 -0.1343170022 -0.0747313378 [21] 0.0891190999 0.0770574901 -0.0159260869 -0.0170559759 0.0586565063 [26] 0.2461576890 0.0468333414 -0.0577035975 -0.0453872047 -0.0758916392 [31] -0.0172925773 0.0080855955 -0.0193677935 -0.0837600877 -0.0353269531 [36] 0.1220391168 0.0003026528 -0.0017473439 -0.0178819895 -0.0583261394 [41] 0.0134506043 0.0831607500 0.0574575028 -0.1524811315 0.0019641212 [46] 0.0613774033 0.1025853334 0.0368774529 -0.0925725428 0.0225943024 [51] -0.0283864667 -0.0167509353 0.0637828945 -0.0527739151 -0.0706342936 [56] -0.1047762541 -0.0323952838 -0.0603933281 -0.0813484544 -0.0223707896 [61] -0.0578339742 > (mypacf <- c(rpacf$acf)) [1] 0.138199661 -0.010389399 -0.026173098 -0.051988576 0.091528954 [6] -0.147596777 0.016613121 -0.111269559 -0.114046707 0.106510546 [11] -0.019735590 -0.061230642 -0.120805489 0.091826673 0.013384715 [16] -0.167529723 -0.024590438 -0.117579246 -0.065980590 0.087005524 [21] 0.050766473 -0.133216271 0.069778259 0.037085383 0.159267269 [26] -0.034849663 -0.066111263 -0.015977718 -0.054688737 -0.015674808 [31] 0.011952433 -0.030000731 -0.023256095 0.023581739 0.031394196 [36] -0.055703439 0.033383550 0.013674176 -0.070837234 -0.033501003 [41] 0.180599262 0.006010129 -0.157732560 0.141047997 -0.035434093 [46] 0.016741868 0.073125514 -0.097517391 -0.037723692 0.012660354 [51] -0.018379410 0.027440655 0.036599728 -0.032411564 -0.125623183 [56] -0.101634719 0.005542959 -0.040598853 -0.067646286 -0.050659529 > 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/3fpdc1228817880.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/4rsvl1228817881.tab") > > system("convert tmp/17rwz1228817880.ps tmp/17rwz1228817880.png") > system("convert tmp/222b11228817880.ps tmp/222b11228817880.png") > > > proc.time() user system elapsed 0.599 0.323 0.832