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(29.59,30.7,30.52,32.67,33.19,37.13,35.54,37.75,41.84,42.94,49.14,44.61,40.22,44.23,45.85,53.38,53.26,51.8,55.3,57.81,63.96,63.77,59.15,56.12,57.42,63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.5,55.04,58.34,61.92,67.65,67.68,70.3,75.26,71.44,76.36,81.71,92.6,90.6,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.2' > 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/1369v1229700097.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/2v6vs1229700097.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.931721850 0.849665970 0.759601791 0.675185362 [6] 0.595163819 0.525410283 0.457039615 0.393724653 0.344983070 [11] 0.303475300 0.269930117 0.219552968 0.161990208 0.119386786 [16] 0.081937502 0.054094973 0.031658774 0.011920382 0.003900811 [21] 0.007820280 0.024203481 0.033902805 0.026511092 0.011708732 [26] -0.006375551 -0.023748703 -0.052731152 -0.077274344 -0.092111032 [31] -0.098101088 -0.102315111 -0.098289138 -0.096706007 -0.112506327 [36] -0.132474285 -0.160244585 -0.188265522 -0.234441643 -0.274986970 [41] -0.307073904 -0.330787582 -0.350981298 -0.369390999 -0.376124401 [46] -0.384800228 -0.390018523 -0.391964454 -0.390203041 -0.388352767 [51] -0.376184644 -0.360711556 -0.330730444 -0.294097153 -0.244147470 [56] -0.181746385 -0.114947768 -0.058048041 -0.012413965 0.008805455 > (mypacf <- c(rpacf$acf)) [1] 0.931721850 -0.139806063 -0.096414612 0.002833025 -0.021930256 [6] 0.019056793 -0.050172589 -0.014691914 0.067136512 -0.003845744 [11] 0.011883293 -0.170855565 -0.072292824 0.115236524 -0.021873111 [16] 0.017484222 -0.008356373 -0.012280377 0.093696129 0.032549708 [21] 0.054699956 -0.073920136 -0.116731429 0.021338411 -0.041776432 [26] -0.013887722 -0.114290560 0.014333257 0.112818516 0.005548457 [31] -0.064252365 0.009112163 -0.019542710 -0.074207502 -0.038138013 [36] -0.093567455 -0.016560123 -0.157877343 0.043116736 0.002181411 [41] -0.055823531 -0.049597345 -0.086904892 0.082934482 -0.030168726 [46] -0.062975354 -0.003111612 0.008603276 0.046922695 0.049917329 [51] -0.107222169 0.102861994 0.019795945 0.096716904 0.110476771 [56] -0.019476536 0.009729976 -0.050395940 -0.106083513 > 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/3o7rq1229700097.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/4e9af1229700097.tab") > > system("convert tmp/1369v1229700097.ps tmp/1369v1229700097.png") > system("convert tmp/2v6vs1229700097.ps tmp/2v6vs1229700097.png") > > > proc.time() user system elapsed 0.597 0.314 0.806