R version 2.7.0 (2008-04-22) 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(137.0,135.9,138.1,137.1,135.1,139.6,131.8,136.7,128.9,131.3,129.5,129.0,129.8,125.4,128.6,130.2,124.6,123.7,124.4,119.2,124.4,123.1,120.9,120.9,117.8,113.6,113.2,115.9,121.1,107.6,114.7,112.8,112.1,109.8,108.5,102.7,110.6,108.2,112.7,107.9,102.7,108.4,108.4,106.9,108.9,103.7,103.6,111.6,105.5,105.5,101.3,103.8,100.3,108.2,105.6,103.0,100.5,104.3,99.1,91.5) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1pyba1228831728.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/2941e1228831728.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.502855782 0.075894650 -0.056424041 0.004253113 [6] -0.010017528 0.160498039 -0.197660247 0.079072592 -0.134516424 [11] 0.201469225 0.086119903 -0.279350581 0.166461730 -0.141353869 [16] 0.003574511 0.175534637 -0.042372735 -0.153066474 0.147819406 [21] -0.178628195 0.255143148 -0.305079678 0.201147814 -0.131602831 [26] 0.025968676 0.044755993 0.146087127 -0.270662604 0.163742435 [31] -0.066067415 0.006120991 -0.030788813 0.050154416 0.008339716 [36] -0.017851997 0.003548350 0.043838044 -0.068456447 0.026707159 [41] 0.041298397 -0.113212894 0.146007026 -0.065818202 0.043609068 [46] -0.087440892 0.086724824 -0.082636970 0.061177681 -0.039427052 [51] 0.025442462 0.009624026 0.009439436 0.012813213 -0.031714033 [56] 0.020673157 -0.011496719 -0.016529232 0.001970690 > (mypacf <- c(rpacf$acf)) [1] -0.5028557821 -0.2368635335 -0.1819698450 -0.1440323645 -0.1213380209 [6] 0.1415315118 -0.0405210709 -0.0389397498 -0.1917261470 0.0416566937 [11] 0.3089121383 -0.1112813807 0.0129285145 -0.1225438251 -0.1901614085 [16] 0.0065923071 0.1131134865 -0.0057558685 0.0384561777 -0.1675264391 [21] -0.0096385622 -0.2905106891 -0.0035104255 -0.0443939291 -0.0319183593 [26] -0.0568291289 0.0341521479 -0.0306233571 -0.0743852284 0.0409670033 [31] 0.0107294769 -0.1882591645 -0.0347974425 -0.0241584066 0.0797364403 [36] -0.0438187039 -0.0546951764 -0.0182503459 0.0061696782 -0.0570794098 [41] -0.0190400227 0.0636043975 0.0196427081 -0.1003764563 -0.0826918387 [46] -0.0772065234 -0.0009322574 0.0037926527 0.0633595924 -0.1469689358 [51] 0.0511287169 -0.0112145136 0.0196192540 -0.0329748911 0.1246668065 [56] 0.0270917037 -0.0551247055 -0.0605236078 > 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/3j8y01228831728.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/4qz0t1228831728.tab") > > system("convert tmp/1pyba1228831728.ps tmp/1pyba1228831728.png") > system("convert tmp/2941e1228831728.ps tmp/2941e1228831728.png") > > > proc.time() user system elapsed 2.823 0.980 2.980