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(21.1,21.0,20.4,19.5,18.6,18.8,23.7,24.8,25.0,23.6,22.3,21.8,20.8,19.7,18.3,17.4,17.0,18.1,23.9,25.6,25.3,23.6,21.9,21.4,20.6,20.5,20.2,20.6,19.7,19.3,22.8,23.5,23.8,22.6,22.0,21.7,20.7,20.2,19.1,19.5,18.7,18.6,22.2,23.2,23.5,21.3,20.0,18.7,18.9,18.3,18.4,19.9,19.2,18.5,20.9,20.5,19.4,18.1,17.0,17.0,17.3,16.7,15.5,15.3,13.7,14.1,17.3,18.1) > par5 = '12' > par4 = '1' > par3 = '2' > par2 = '-2.0' > 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/1jc7e1229093290.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/2855q1229093290.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.049937161 -0.103110683 -0.281180019 -0.153505166 [6] -0.150587642 0.096717496 0.103405065 0.063535876 0.239993145 [11] -0.090748189 0.039252881 -0.209369837 -0.148128286 -0.096704585 [16] 0.198147350 0.005788993 0.161199404 0.090093381 -0.103180025 [21] -0.074323458 -0.112851433 -0.052145266 0.032669821 0.083045643 [26] 0.067715030 0.078074568 0.022718252 -0.102711410 -0.069642872 [31] -0.123927562 -0.006525112 0.070151753 0.099071085 0.206343258 [36] 0.021722652 -0.171449872 -0.223002739 0.007265631 0.053390844 [41] 0.058530666 0.019471088 0.047872883 0.006196191 0.008924119 [46] -0.060616797 -0.077350420 -0.057906694 0.068321697 0.071926004 [51] 0.035189394 -0.016741727 -0.026461775 0.005374560 > (mypacf <- c(rpacf$acf)) [1] -0.049937161 -0.105868409 -0.296211325 -0.228105085 -0.305319507 [6] -0.155384246 -0.144506255 -0.182923896 0.154906930 -0.063406790 [11] 0.175116992 -0.011128467 -0.102545528 -0.081212643 0.010800304 [16] -0.171303827 -0.010284084 0.017802316 -0.046476312 0.004645104 [21] -0.016898131 -0.025519250 0.040809700 -0.082750303 0.044330472 [26] -0.047991273 0.055515517 -0.008743500 -0.020769108 -0.081506213 [31] -0.032651207 -0.084135422 -0.053574021 0.184368541 0.087149643 [36] -0.044189041 -0.069961918 0.009741084 0.106176917 -0.099816534 [41] -0.112374753 -0.077661838 -0.131740231 -0.051776356 -0.093095004 [46] -0.055376674 -0.029886052 0.070043343 -0.054569081 -0.027974529 [51] -0.052303022 -0.074216712 -0.036397824 > 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/3dyug1229093291.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/4p07u1229093291.tab") > > system("convert tmp/1jc7e1229093290.ps tmp/1jc7e1229093290.png") > system("convert tmp/2855q1229093290.ps tmp/2855q1229093290.png") > > > proc.time() user system elapsed 0.569 0.313 0.803