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(102.9,102.9,102.9,102.9,104.2,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,104.7,106,107,107,107,107,107,107,107,107,107,107,107,107.6,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,109.9,110.6,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,114.3,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,119.01,121.27,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,123.54,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,125.24,128.35,128.35,128.35,128.35,128.35,128.35,128.35) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1p3n31228983860.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/2xyg71228983860.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.970234832 0.938798405 0.907361978 0.875925551 [6] 0.846916071 0.818840033 0.790763995 0.768852711 0.746941427 [11] 0.725030144 0.703118860 0.679165109 0.647427713 0.613626010 [16] 0.579824307 0.546022604 0.514647848 0.485139975 0.455632102 [21] 0.429494030 0.403355959 0.377217887 0.351079816 0.323525813 [26] 0.289556002 0.252675743 0.215795484 0.178915226 0.143155096 [31] 0.111688797 0.080222497 0.053255874 0.030769105 0.008282335 [36] -0.014204434 -0.037530296 -0.066147388 -0.096803983 -0.127460579 [41] -0.158117175 -0.187466952 -0.209909265 -0.232351578 -0.245457558 [46] -0.258563538 -0.271669517 -0.284775497 -0.298223285 > (mypacf <- c(rpacf$acf)) [1] 0.970234832 -0.043605615 -0.015438106 -0.016503848 0.024726540 [6] -0.002053999 -0.016297985 0.089677449 -0.017170925 -0.011693085 [11] -0.013054774 -0.040256183 -0.144359387 -0.048953780 -0.008489180 [16] -0.024718250 0.010628993 0.006597945 -0.026154326 0.012381557 [21] -0.024254289 -0.016030891 -0.020575339 -0.027599215 -0.109876039 [26] -0.067441277 -0.018571839 -0.034724413 -0.028083199 0.033719093 [31] -0.035084911 0.021653857 0.044009982 -0.018208060 -0.025605950 [36] -0.022555027 -0.074554879 -0.053443034 -0.017734255 -0.022845824 [41] -0.028748340 0.069192816 -0.036817935 0.105981777 -0.051667289 [46] -0.010399569 -0.024694208 -0.011556805 > 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/3v3go1228983860.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/4xazy1228983860.tab") > > system("convert tmp/1p3n31228983860.ps tmp/1p3n31228983860.png") > system("convert tmp/2xyg71228983860.ps tmp/2xyg71228983860.png") > > > proc.time() user system elapsed 0.579 0.321 0.719