R version 2.7.0 (2008-04-22) 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(101.02,100.67,100.47,100.38,100.33,100.34,100.37,100.39,100.21,100.21,100.22,100.28,100.25,100.25,100.21,100.16,100.18,100.1,99.96,99.88,99.88,99.86,99.84,99.8,99.82,99.81,99.92,100.03,99.99,100.02,100.01,100.13,100.33,100.13,99.96,100.05,99.83,99.8,100.01,100.1,100.13,100.16,100.41,101.34,101.65,101.85,102.07,102.12,102.14,102.21,102.28,102.19,102.33,102.54,102.44,102.78,102.9,103.08,102.77,102.65,102.71,103.29,102.86,103.45,103.72,103.65,103.83,104.45,105.14,105.07,105.31,105.19,105.3,105.02,105.17,105.28,105.45,105.38,105.8,105.96,105.08,105.11,105.61,105.5) > 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/1fgfg1228839220.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/2ydcd1228839220.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.072545276 -0.044992411 0.136505702 0.161182043 [6] -0.100938341 0.015012332 0.121831770 0.021390997 -0.071301571 [11] -0.087295702 0.222776033 -0.021897342 -0.069338966 0.069831606 [16] 0.159630899 -0.134931174 -0.021040429 0.227114828 -0.097751758 [21] -0.038243194 0.162785625 0.094569067 0.045337037 0.045811408 [26] 0.081294356 0.052708204 -0.103778475 -0.089396551 0.068648030 [31] -0.111233000 -0.076020525 0.051186912 0.002033791 -0.101495807 [36] -0.006880505 -0.003804782 -0.156183010 -0.077492647 0.039338613 [41] -0.033249264 -0.083513041 -0.172644762 -0.029958502 0.018183017 [46] -0.093681130 -0.013156153 0.032189595 -0.079723513 -0.085183412 [51] 0.015205253 -0.035506304 -0.015653339 -0.061183580 -0.040085674 [56] -0.019005831 -0.004781723 0.028308313 -0.004795328 -0.054000500 [61] -0.078283546 > (mypacf <- c(rpacf$acf)) [1] 0.0725452758 -0.0505211117 0.1447287972 0.1405290613 -0.1135356412 [6] 0.0283430158 0.0733556178 0.0128579984 -0.0418149084 -0.1268035667 [11] 0.2251825842 -0.0424046500 -0.0157635168 0.0383910672 0.0822056585 [16] -0.0839200391 -0.0005508326 0.1639748514 -0.1621521160 0.0692775145 [21] 0.1540120749 -0.0391430898 0.1582208402 -0.0150238851 0.0302543211 [26] -0.0178202399 -0.1011684133 -0.0477073531 -0.0854681511 -0.0435018262 [31] 0.0393573534 -0.0270719262 -0.0130287117 -0.0138032374 -0.0146670931 [36] -0.1220536531 -0.1066587776 -0.0605339489 0.0224203770 -0.0028695439 [41] -0.0428633846 -0.1856188822 -0.0230046293 0.0110044399 -0.0281979294 [46] -0.0245195723 -0.0713328538 0.0399647124 -0.0238153760 -0.0046343052 [51] 0.0405572844 0.0227041898 0.0165582395 -0.0425162605 0.0314348305 [56] 0.0245831807 0.0857128203 0.0414963050 -0.0540871509 0.0465665481 > 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/350c61228839220.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/440bg1228839220.tab") > > system("convert tmp/1fgfg1228839220.ps tmp/1fgfg1228839220.png") > system("convert tmp/2ydcd1228839220.ps tmp/2ydcd1228839220.png") > > > proc.time() user system elapsed 2.496 0.901 2.618