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(12.5,14.8,15.9,14.8,12.9,14.3,14.2,15.9,15.3,15.5,15.1,15,12.1,15.8,16.9,15.1,13.7,14.8,14.7,16,15.4,15,15.5,15.1,11.7,16.3,16.7,15,14.9,14.6,15.3,17.9,16.4,15.4,17.9,15.9,13.9,17.8,17.9,17.4,16.7,16,16.6,19.1,17.8,17.2,18.6,16.3,15.1,19.2,17.7,19.1,18,17.5,17.8,21.1,17.2,19.4,19.8,17.6,16.2,19.5,19.9,20,17.3,18.9,18.6,21.4,18.6,19.8,20.8,19.6,17.7,19.8,22.2,20.7,17.9,21.2,21.4,21.7,23.2,21.5,22.9,23.2,18.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/rcomp/tmp/18ikf1228918370.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/2wjp71228918370.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.710908207 0.600958508 0.656807701 0.651025853 [6] 0.579723522 0.610664057 0.493806658 0.543130368 0.480587306 [11] 0.374417639 0.435636056 0.600863630 0.389718939 0.309812353 [16] 0.334171779 0.350084009 0.314914070 0.315630915 0.236785290 [21] 0.278962851 0.208411455 0.118534739 0.190605512 0.275067934 [26] 0.135076349 0.076600645 0.058116917 0.080135603 0.052765610 [31] 0.019712889 -0.024250470 0.002607778 -0.076993076 -0.135575735 [36] -0.079648626 -0.012539298 -0.110872209 -0.161260028 -0.172616830 [41] -0.133679822 -0.173610793 -0.192945867 -0.214500411 -0.179184128 [46] -0.246336481 -0.279259750 -0.258319408 -0.194780701 -0.263562942 [51] -0.312587748 -0.322854141 -0.267301681 -0.311737238 -0.318549371 [56] -0.328964028 -0.285289302 -0.316014166 -0.335592394 -0.314252248 [61] -0.243556757 > (mypacf <- c(rpacf$acf)) [1] 0.710908207 0.193219145 0.367049918 0.170768370 0.030826778 [6] 0.180848971 -0.244359976 0.251061361 -0.254909038 -0.100918930 [11] 0.227214270 0.347772095 -0.314045359 -0.149064055 -0.055322603 [16] 0.049156047 0.013476354 -0.011858555 0.072607962 -0.095144053 [21] -0.050591277 -0.042976082 0.115082673 -0.105576002 0.033081633 [26] -0.035056871 -0.113037063 0.001981885 -0.119519156 0.051574877 [31] -0.057336876 0.009377885 -0.029251763 -0.009737862 -0.013407675 [36] 0.072732615 -0.068881721 -0.021725647 0.007759459 -0.010900228 [41] -0.107695526 0.012175124 -0.018519320 0.036814558 -0.002418107 [46] -0.001695751 -0.071496116 -0.052359774 -0.001511530 -0.024716987 [51] -0.027809518 0.015384076 0.002985946 -0.032645643 -0.019183265 [56] 0.032450717 0.066598873 -0.042125380 0.063346464 -0.043740584 > 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/34p6y1228918370.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/427wo1228918370.tab") > > system("convert tmp/18ikf1228918370.ps tmp/18ikf1228918370.png") > system("convert tmp/2wjp71228918370.ps tmp/2wjp71228918370.png") > > > proc.time() user system elapsed 0.591 0.314 0.714