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(293,301,362,330,328,405,232,159,336,361,329,339,290,328,375,294,340,364,248,145,380,305,291,319,334,318,362,296,300,342,215,185,343,333,316,252,320,324,343,295,301,367,196,182,342,361,334,330,345,323,366,323,316,358,235,169,430,409,407,341,326,374,364,349,300,385,304,196,443,414,325,388,356,386,444,387,327,448,225,182,460,411,342,361,377,331,428,340,352,461,221,198,422,329,320,375,364,351,380,319,322,386,221,187,344,342,365,313,356,337,389,326,343,357,220,218,391,425,332,298) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-0.8' > 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/freestat/rcomp/tmp/14svj1228552837.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/freestat/rcomp/tmp/2pjh51228552837.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.0033209995 0.0995940033 -0.0056420101 -0.0478575249 [6] 0.0700726555 0.0943225182 0.2200533532 0.0925876673 0.1662200722 [11] 0.0533191579 0.0518369712 -0.2514423773 0.0348036065 0.0943221961 [16] 0.1355149298 0.0139673165 0.0071195241 0.0162939579 -0.0860705608 [21] 0.1350766638 -0.0140117068 -0.1312255368 0.1010256558 -0.1523584660 [26] 0.0495464917 -0.0521627140 -0.0688548189 -0.0959909070 -0.0834225234 [31] -0.0186603644 -0.2168984980 -0.1216078122 -0.1267536343 0.0325438078 [36] -0.0264537633 -0.0949942666 -0.1992560909 -0.1015074860 -0.1860460332 [41] 0.0319810343 0.0165992417 -0.1080480078 0.1402043605 -0.0558251453 [46] -0.0926249545 -0.1406318525 -0.2116909452 0.0285505903 0.0650609293 [51] 0.0432292216 0.0006903177 -0.0749579058 -0.0655130470 -0.0759638429 [56] -0.0054887116 -0.0421973466 0.0513533637 0.0833236883 0.0633784871 [61] -0.0142142887 > (mypacf <- c(rpacf$acf)) [1] -0.0033209995 0.0995840725 -0.0050637499 -0.0583859689 0.0718161619 [6] 0.1072209694 0.2113569033 0.0825746281 0.1492373576 0.0681796101 [11] 0.0550052427 -0.3052261441 -0.0431332141 0.0647092267 0.0870506541 [16] -0.1371598494 -0.0414940745 0.0539704895 0.0212659813 0.1284241809 [21] 0.0408116849 -0.1966005631 0.1043686468 -0.2684514488 -0.0006679277 [26] -0.0190734806 -0.0245727995 -0.2185277966 -0.0793022947 0.0077576460 [31] -0.1615825385 -0.0903124455 -0.0184727689 -0.0022040802 0.1380964826 [36] -0.1624394955 -0.1120672313 0.0394240293 -0.0366437322 -0.0245090476 [41] 0.0447428589 0.0665912511 0.1296342019 0.0500342894 -0.0227692011 [46] -0.0529847391 -0.0695875493 -0.0414014635 -0.0054709542 -0.0373824053 [51] -0.0020721944 -0.0153362242 0.0046654207 0.0257820863 0.0104813719 [56] -0.0023976920 0.0349014852 -0.0199760543 -0.0211569945 -0.0799873877 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3bcc81228552837.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/freestat/rcomp/tmp/4q8z31228552837.tab") > > system("convert tmp/14svj1228552837.ps tmp/14svj1228552837.png") > system("convert tmp/2pjh51228552837.ps tmp/2pjh51228552837.png") > > > proc.time() user system elapsed 0.798 0.413 0.902