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(527,516,503,489,479,475,524,552,532,511,492,492,493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626) > 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/1a3681229864799.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/29hmf1229864799.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.2946841601 -0.1801461967 -0.3254117054 -0.3119856807 [6] 0.0234167246 0.1564132116 0.0338039755 -0.2768717824 -0.2705260484 [11] -0.1801122173 0.2636459170 0.8270346666 0.2440020857 -0.1298177684 [16] -0.2867499788 -0.2960535278 0.0008414975 0.1332528908 0.0243292583 [21] -0.2406109120 -0.2349426376 -0.1617933425 0.2500748868 0.6793016614 [26] 0.1729406733 -0.1011664025 -0.2358933226 -0.2610617847 0.0043006370 [31] 0.1033679375 0.0149183097 -0.2065599207 -0.2232915294 -0.1374611511 [36] 0.2239269726 0.5526632547 0.1044812842 -0.0928838560 -0.1881373342 [41] -0.1886582329 0.0018762983 0.0780493443 0.0007667877 -0.1758863660 [46] -0.1781378929 -0.1087401000 0.2006325405 0.4369158076 0.0865956814 [51] -0.0658792987 -0.1647143389 -0.1426516088 -0.0082699618 0.0534036088 [56] 0.0084964535 -0.1313999992 -0.1388279614 -0.0825507293 0.1584103286 [61] 0.3009921618 > (mypacf <- c(rpacf$acf)) [1] 0.2946841601 -0.2923743776 -0.2043419692 -0.2323466550 0.0896130084 [6] -0.0486486071 -0.1280647090 -0.3714582973 -0.1403342579 -0.3350972730 [11] 0.1653908138 0.6877598117 -0.2058610655 0.1726356851 0.1262859035 [16] 0.0104491703 -0.0183728868 -0.0013793523 -0.0291500472 -0.0201633220 [21] -0.0674042788 0.0406398563 -0.0008985868 -0.0558505504 -0.0963472004 [26] 0.0169716933 0.0145997048 -0.0393350246 0.0329208077 -0.0412017060 [31] 0.0333280241 -0.0163204714 -0.0908546965 0.0547970027 -0.0954434976 [36] -0.0398816536 -0.0869881688 -0.0674844561 0.0081132709 0.0554550254 [41] -0.1561157054 0.0726865280 -0.0489364916 0.0171785319 0.0506886873 [46] -0.0222293120 0.0106952391 -0.0047142285 0.1124837405 0.0048666689 [51] -0.0599107428 0.0300677825 -0.0493343485 -0.0446103266 0.0520829098 [56] 0.0115305142 -0.0077181284 -0.0088047401 -0.0361923889 -0.1178504784 > 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 1:par1) { + 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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/33fsi1229864799.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-1,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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/42uog1229864799.tab") > > system("convert tmp/1a3681229864799.ps tmp/1a3681229864799.png") > system("convert tmp/29hmf1229864799.ps tmp/29hmf1229864799.png") > > > proc.time() user system elapsed 0.586 0.319 0.686