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(6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.1,8.2,8.1,8.1,7.9,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.6,6.2,6.2,6.8,6.9) > 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/1bc681229502713.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/2yrq31229502713.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.363995971 -0.134596405 -0.424546013 -0.377077992 [6] -0.038334924 0.257508096 0.130506951 -0.114331111 -0.182114947 [11] -0.086800893 0.174793811 0.524833444 0.158318231 -0.082306033 [16] -0.245781933 -0.193218503 -0.026135402 0.154455760 0.058908675 [21] -0.077909723 -0.113283176 -0.017894410 0.091600119 0.301284419 [26] 0.065307286 -0.058884660 -0.163217963 -0.106739586 -0.022497960 [31] 0.026299948 0.027177111 -0.034779131 0.010253255 0.025460319 [36] 0.002354696 0.122040042 -0.054869206 -0.054873654 -0.057836725 [41] 0.041317563 0.095136166 0.075123650 -0.040282080 -0.188546467 [46] -0.118261179 -0.071017296 0.031902513 0.192635033 0.071326998 [51] -0.018302840 -0.036985469 -0.034628994 -0.022529979 0.026043790 [56] -0.038123949 -0.090696273 -0.027942027 -0.054454551 -0.030535982 [61] 0.088701087 > (mypacf <- c(rpacf$acf)) [1] 0.363995971 -0.307881658 -0.316324700 -0.173119913 0.050661481 [6] 0.086328949 -0.214844102 -0.185325589 0.008574191 0.020444198 [11] 0.103744948 0.427030196 -0.209202668 0.194990612 0.133073873 [16] 0.132031071 -0.030181488 0.019377311 0.008771133 -0.005952238 [21] -0.084087618 0.052798620 -0.118445533 0.040489891 -0.060889097 [26] 0.007298445 -0.046141085 0.006846334 -0.017622943 -0.157703634 [31] 0.088892997 -0.042243165 0.090436602 -0.129745807 -0.011769252 [36] 0.044305406 -0.113301479 -0.012393073 0.035621753 0.048368835 [41] 0.158482132 0.077214822 -0.024749471 -0.096826567 0.001503796 [46] -0.111426417 -0.048194512 -0.019381253 0.010607793 -0.104903615 [51] 0.080834144 -0.086663431 -0.094028962 0.006608647 -0.040858307 [56] 0.095679745 -0.042266032 0.006025728 -0.030255549 -0.041904001 > 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/3p8ro1229502713.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/4ml491229502714.tab") > > system("convert tmp/1bc681229502713.ps tmp/1bc681229502713.png") > system("convert tmp/2yrq31229502713.ps tmp/2yrq31229502713.png") > > > proc.time() user system elapsed 0.623 0.334 0.820