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(101.3,91.5,152.6,86.6,86.6,98.5,86.7,89.1,111,92.6,85.1,116.1,98.3,97.7,177.9,94.2,83.8,109.5,102.3,102.5,162.7,85.3,88.2,104.7,99.4,113.8,166.6,89.2,93.2,115,97.2,112.5,121.8,100.2,93.8,113.6,110.7,127.6,185.9,105.9,108,125.2,106.2,123.3,145.2,114.3,108.4,120.9,126.3,141.3,208.2,131.6,119.8,122.5,137.6,141,154.1,127,106.1,129.9) > 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/1qfps1229578793.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/2aqwh1229578793.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.142074037 -0.008900855 0.247958261 -0.045470408 [6] 0.101044746 0.616055645 0.026490542 -0.137979505 0.172530265 [11] -0.122450916 0.014787814 0.611422184 -0.022695607 -0.131940329 [16] 0.100431797 -0.136734486 -0.026693749 0.379745404 -0.077142221 [21] -0.168333755 0.035427264 -0.172271742 -0.053372764 0.362851814 [26] -0.098242233 -0.136929411 0.001438987 -0.165770583 -0.070610009 [31] 0.200858853 -0.103816890 -0.181530457 -0.062376901 -0.166057537 [36] -0.089530899 0.201716079 -0.121665008 -0.157895941 -0.032567447 [41] -0.135020530 -0.089725964 0.019445163 -0.125479550 -0.174130715 [46] -0.078201384 -0.133569238 -0.119485285 0.011599976 -0.113303488 [51] -0.108478374 -0.053757808 -0.037299892 -0.033159002 0.004617667 [56] -0.024196901 -0.038149147 0.014152540 -0.004825863 -0.004886250 > (mypacf <- c(rpacf$acf)) [1] 0.142074037 -0.029685081 0.258927890 -0.132526290 0.167054784 [6] 0.563567765 -0.155293242 -0.219418145 0.031369872 -0.077324205 [11] -0.015740262 0.431306410 -0.116003724 -0.048851720 -0.137255876 [16] -0.003831861 -0.080634141 -0.149469496 0.063970657 0.113278681 [21] -0.123404926 0.034299003 0.035223260 0.009330790 -0.089256057 [26] 0.035050793 -0.017317832 -0.050838575 -0.067315072 -0.037832261 [31] 0.043917068 -0.111883750 -0.043539963 0.108561269 -0.059497442 [36] 0.003363283 -0.031542959 -0.038596889 0.069279599 -0.069917818 [41] -0.029147453 -0.226589146 -0.006004926 0.062949553 -0.008757539 [46] -0.028796874 0.014300566 -0.100952024 0.015517979 0.010931382 [51] -0.023180120 0.087412110 0.092540104 0.104448137 -0.012403970 [56] -0.005337906 0.074910855 -0.096931781 -0.036320780 > 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/3fhg21229578793.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/4ghyh1229578793.tab") > > system("convert tmp/1qfps1229578793.ps tmp/1qfps1229578793.png") > system("convert tmp/2aqwh1229578793.ps tmp/2aqwh1229578793.png") > > > proc.time() user system elapsed 0.599 0.322 0.909