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(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) > 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: 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/1xai91229907076.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/2brvt1229907076.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.919829405 0.806220252 0.697913596 0.619298455 [6] 0.577836781 0.532887627 0.507349103 0.486863402 0.495613814 [11] 0.521632433 0.544683796 0.538740480 0.448797963 0.340167472 [16] 0.236620566 0.155392493 0.101419342 0.050037973 0.023176365 [21] -0.002345404 -0.006908505 0.005833407 0.022416299 0.016403767 [26] -0.050332735 -0.128679523 -0.205114885 -0.265380993 -0.305775850 [31] -0.343798934 -0.345713945 -0.342765929 -0.328327383 -0.303503027 [36] -0.282205155 -0.273006482 -0.299954336 -0.335586146 -0.373257104 [41] -0.402425113 -0.419245348 -0.431099006 -0.405891486 -0.374574214 [46] -0.334008265 -0.289497236 -0.252431953 -0.227414230 -0.223178288 [51] -0.221765401 -0.228778555 -0.234640569 -0.233784437 -0.222418346 [56] -0.174369846 -0.126558386 -0.083203717 -0.048017448 -0.023176612 > (mypacf <- c(rpacf$acf)) [1] 0.9198294054 -0.2590142450 0.0173852682 0.1182921733 0.1338927444 [6] -0.1330647587 0.1737385527 0.0052888501 0.2174482114 0.0486818152 [11] 0.0644849974 -0.1610848385 -0.4312265184 0.0036616094 -0.0515906148 [16] -0.0831923047 -0.0357163436 -0.0033081261 0.0451567060 -0.1181738443 [21] 0.0222835536 0.0492625714 0.0679793956 -0.0887455593 -0.0920487051 [26] 0.0256133836 -0.0487496994 -0.0863546748 -0.0198158776 -0.0367953663 [31] 0.1318575384 -0.0703986829 -0.0369817228 -0.0044224595 -0.0076020765 [36] -0.0146531358 0.0352915007 -0.0275718330 0.0003556884 -0.0316725070 [41] -0.0193546127 -0.0452952277 0.0822377298 -0.0139323969 0.0359921784 [46] -0.0306575667 0.0192898341 -0.0587732823 0.0962367583 -0.0210623966 [51] -0.0174650692 -0.0087822728 0.0641043555 -0.0092348034 0.0561949831 [56] -0.0703509562 -0.0134197877 -0.0642386069 0.0197277302 > 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/3zldi1229907076.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/4wjfz1229907076.tab") > > system("convert tmp/1xai91229907076.ps tmp/1xai91229907076.png") > system("convert tmp/2brvt1229907076.ps tmp/2brvt1229907076.png") > > > proc.time() user system elapsed 0.613 0.323 0.711