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(8.6,8.5,8.3,7.8,7.8,8,8.6,8.9,8.9,8.6,8.3,8.3,8.3,8.4,8.5,8.4,8.6,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.6,8.4,8.1,8,8,8,8,7.9,7.8,7.8,7.9,8.1,8,7.6,7.3,7,6.8,7,7.1,7.2,7.1,6.9,6.7,6.7,6.6,6.9,7.3,7.5,7.3,7.1,6.9,7.1) > par7 = '0.95' > par6 = 'MA' > 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: > 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/1xfcq1259063479.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/2kesp1259063479.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.9331609722 0.8205698826 0.7240803770 0.6910154034 [6] 0.7059933674 0.7225422176 0.6944517171 0.6247327312 0.5354431208 [11] 0.4487062006 0.3827180696 0.3349260374 0.2934830039 0.2516472488 [16] 0.1944953528 0.1253654492 0.0549264738 -0.0008508967 -0.0399376009 [21] -0.0658026792 -0.0982785705 -0.1462015098 -0.1985098399 -0.2402146878 [26] -0.2602543963 -0.2676615613 -0.2837086006 -0.3111445652 -0.3424422917 [31] -0.3580966095 -0.3474385827 -0.3355369376 -0.3425513811 -0.3640965222 [36] -0.3864271065 -0.3907579526 -0.3668783000 -0.3292533927 -0.2982392983 [41] -0.2914430336 -0.3027774141 -0.3175153816 -0.3187044552 -0.2964611424 [46] -0.2548435659 -0.2063533621 -0.1700375267 -0.1612122005 -0.1709102413 [51] -0.1834882402 -0.1681175547 -0.1246672776 -0.0663590348 -0.0296504778 [56] -0.0292032116 -0.0468211371 -0.0575009818 -0.0459920583 -0.0219160449 > (mypacf <- c(rpacf$acf)) [1] 0.9331609722 -0.3886640681 0.2136289569 0.3757157153 0.0963744418 [6] -0.0671946126 -0.1725928403 -0.0285388254 -0.1165217794 -0.2214843240 [11] -0.0781063293 -0.0608390493 -0.0545807330 0.0189067073 -0.1018435772 [16] -0.0006175117 0.0163945526 0.0492872159 0.0021177272 0.0190291803 [21] -0.0542026259 -0.0657640802 0.0219118538 0.0061050786 0.0152984225 [26] -0.0514092100 -0.1037279472 0.0229981625 -0.0105935815 0.0589775195 [31] 0.1002328211 -0.1685390364 -0.0856854455 0.0377732874 -0.0380043678 [36] -0.0123609267 0.0637285245 0.0606011638 0.0021391160 -0.1218069550 [41] 0.0236249350 -0.0221317159 -0.0745949479 0.0360807749 0.0219589191 [46] 0.0531833073 0.0259989919 -0.0810906138 0.0128293736 -0.0531496119 [51] 0.0799379199 -0.0226154663 0.0451629535 -0.0651756288 -0.0959470231 [56] 0.0645815879 -0.0766073336 -0.0551464398 -0.0922674543 > 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/3v7m61259063479.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/4kqp21259063479.tab") > > system("convert tmp/1xfcq1259063479.ps tmp/1xfcq1259063479.png") > system("convert tmp/2kesp1259063479.ps tmp/2kesp1259063479.png") > > > proc.time() user system elapsed 0.585 0.335 3.369