R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(158,157,156,154,152,151,152,154,155,155,156,158,155,151,152,156,147,159,152,148,146,148,142,141,139,143,146,150,141,153,142,139,134,152,142,139,137,132,137,134,127,140,127,120,112,128,119,117,115,104,108,104,98,111,104,98,91,94,82,81,70,64,71,73,71,80,72,68,60,71,62,69,55,58,67,69,71,85,76,79,69,95,94,99) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1jjir1282090396.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2jjir1282090396.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.0000000000 -0.4038967362 0.1610448784 -0.1406587705 0.1722943320 [6] -0.1416713923 0.1791635842 -0.0914132579 0.1883523522 -0.1018582453 [11] 0.0640942998 -0.3304596657 0.6374231546 -0.3598042271 0.1025286788 [16] -0.1561270467 0.1327722789 -0.1413808981 0.1501166834 -0.0841418175 [21] 0.0425531717 -0.0089538659 -0.0618794914 -0.2291009996 0.3878579963 [26] -0.3034446651 0.1080131960 -0.1982174907 0.1496129663 -0.1044161714 [31] 0.1092332836 -0.0796951094 -0.0153881264 -0.0216795386 -0.0595308003 [36] -0.2023824602 0.3535573425 -0.2092386689 0.1316655944 -0.1915582831 [41] 0.1292717159 -0.1264099523 0.0902732900 -0.0895985387 0.0670112357 [46] -0.0364260770 0.0004125629 -0.1436735174 0.2375111784 > (mypacf <- c(rpacf$acf)) [1] -0.4038967362 -0.0024946545 -0.0913634107 0.1021439705 -0.0355074906 [6] 0.1149536636 0.0458437327 0.1689476064 0.0689833797 0.0092259564 [11] -0.3537366166 0.4963415829 0.0097554410 -0.1906363776 -0.1237981966 [16] -0.0615815831 0.0293644976 0.0457900326 0.0287699268 -0.2216740129 [21] 0.0617960622 -0.0273521261 -0.0325973353 -0.0649118616 -0.1577792307 [26] 0.0170176016 -0.1052362172 0.0648948173 0.0809874714 -0.0165261402 [31] -0.0159846420 0.0033110913 -0.1191560199 -0.0166737337 -0.1244996803 [36] 0.0596681707 0.0788216401 0.0211276789 0.0050179916 -0.0648938508 [41] -0.0398886719 -0.0597012982 -0.0275525041 0.0383832333 -0.0475536733 [46] 0.0005421156 0.0248787817 -0.0709952841 > 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/383jd1282090397.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/40cig1282090397.tab") > > try(system("convert tmp/1jjir1282090396.ps tmp/1jjir1282090396.png",intern=TRUE)) character(0) > try(system("convert tmp/2jjir1282090396.ps tmp/2jjir1282090396.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.316 0.761