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(94.7,101.8,102.5,105.3,110.3,109.8,117.3,118.8,131.3,125.9,133.1,147,145.8,164.4,149.8,137.7,151.7,156.8,180,180.4,170.4,191.6,199.5,218.2,217.5,205,194,199.3,219.3,211.1,215.2,240.2,242.2,240.7,255.4,253,218.2,203.7,205.6,215.6,188.5,202.9,214,230.3,230,241,259.6,247.8,270.3,289.7,322.7,315,320.2,329.5,360.6,382.2,435.4,464,468.8,403,351.6) > 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/freestat/rcomp/tmp/1vcem1229543493.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/freestat/rcomp/tmp/2rqwc1229543493.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.94359807 0.85960024 0.75689630 0.66119543 0.57581691 [7] 0.50663848 0.44686986 0.38918841 0.33338936 0.28248048 0.23241949 [13] 0.19052719 0.15231162 0.12633995 0.09734938 0.06591594 0.04482883 [19] 0.02971725 0.02823981 0.03190671 0.03730717 0.04136147 0.04399400 [25] 0.04324314 0.03427595 0.01028682 -0.01990368 -0.04795930 -0.07003209 [31] -0.09079545 -0.10438251 -0.10932912 -0.11587092 -0.12319837 -0.12974725 [37] -0.14450900 -0.17058286 -0.20096316 -0.22681318 -0.24955606 -0.27677029 [43] -0.30016051 -0.31822147 -0.32563309 -0.33464412 -0.34259878 -0.35055236 [49] -0.36485678 -0.36865371 -0.36706295 -0.35449486 -0.34177847 -0.32852940 [55] -0.30946848 -0.28185649 -0.24689360 -0.19784005 -0.13975278 -0.07865657 [61] -0.03363056 > (mypacf <- c(rpacf$acf)) [1] 0.9435980706 -0.2807546685 -0.1686063367 0.0772609349 0.0241692642 [6] 0.0392724965 -0.0242830320 -0.0714699922 -0.0147923130 0.0236396417 [11] -0.0474347013 0.0313996520 -0.0267660180 0.0600961939 -0.0934066591 [16] -0.0613769134 0.1300049888 0.0016608188 0.0656233113 -0.0169544469 [21] -0.0370982629 0.0183612305 0.0213576710 -0.0352263198 -0.0650431091 [26] -0.1356325523 -0.0030770049 0.0525290766 -0.0094914832 -0.0358228945 [31] 0.0051997035 0.0600160317 -0.0666851706 -0.0364879791 0.0379298332 [36] -0.0958593222 -0.1162119403 -0.0231604494 0.0208938390 -0.0044601360 [41] -0.1238710716 -0.0337042086 0.0126644519 0.0449608769 -0.0952926215 [46] -0.0693995728 0.0021961018 -0.0772743784 0.0883437802 0.0001932563 [51] 0.0514873194 -0.0706715425 -0.0626452504 0.0507359701 0.1048014116 [56] 0.0238922725 0.0938777034 0.0469884685 -0.0017897087 -0.0959613288 > 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/33p0z1229543493.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/4ggnq1229543493.tab") > > system("convert tmp/1vcem1229543493.ps tmp/1vcem1229543493.png") > system("convert tmp/2rqwc1229543493.ps tmp/2rqwc1229543493.png") > > > proc.time() user system elapsed 0.804 0.426 0.954