R version 2.7.0 (2008-04-22) 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(98.1,101.1,111.1,93.3,100,108,70.4,75.4,105.5,112.3,102.5,93.5,86.7,95.2,103.8,97,95.5,101,67.5,64,106.7,100.6,101.2,93.1,84.2,85.8,91.8,92.4,80.3,79.7,62.5,57.1,100.8,100.7,86.2,83.2,71.7,77.5,89.8,80.3,78.7,93.8,57.6,60.6,91,85.3,77.4,77.3,68.3,69.9,81.7,75.1,69.9,84,54.3,60,89.9,77,85.3,77.6,69.2,75.5,85.7,72.2,79.9,85.3,52.2,61.2,82.4,85.4,78.2,70.2,70.2,69.3,77.5,66.1,69,79.2,56.2,63.3,77.8,92,78.1,65.1,71.1,70.9,72,81.9,70.6,72.5,65.1,54.9,80) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.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/1xqkv1229679008.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/25ouo1229679008.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.440358422 0.087409475 0.206287266 0.148410210 [6] 0.311127220 0.458029506 0.301742353 0.176978806 0.157929154 [11] 0.015877829 0.317905015 0.719216447 0.303475537 -0.032092618 [16] 0.071386152 0.046110641 0.159597519 0.301852778 0.151426172 [21] 0.050550847 0.037301347 -0.088254782 0.187667703 0.480001470 [26] 0.137525080 -0.140657841 -0.091517206 -0.071288165 0.008251476 [31] 0.122530821 0.039520525 -0.048429124 -0.073359256 -0.170562873 [36] 0.031156545 0.300654363 0.034258632 -0.186289749 -0.135154655 [41] -0.129213595 -0.069533143 0.009598379 -0.059541191 -0.121202124 [46] -0.143328879 -0.210209643 -0.037631344 0.147028208 -0.043482838 [51] -0.239078227 -0.196986053 -0.174279312 -0.129600713 -0.054608725 [56] -0.084769897 -0.138701240 -0.150843448 -0.206241491 -0.082126699 [61] 0.070439930 > (mypacf <- c(rpacf$acf)) [1] 0.440358422 -0.132127674 0.278901698 -0.083718247 0.410040300 [6] 0.152425701 0.130318230 -0.014509514 0.035466931 -0.248374271 [11] 0.476703461 0.399676007 -0.257938687 -0.295416856 0.016533590 [16] -0.031270913 -0.108888790 -0.116152262 -0.034840581 -0.047214206 [21] 0.081183871 0.004619042 0.116775828 -0.105874845 0.033861669 [26] -0.059014417 -0.061054069 -0.056867275 -0.087727057 -0.062560950 [31] 0.086431060 0.007762394 0.025531393 -0.045895281 -0.029205663 [36] 0.106157148 0.014360997 0.078452797 -0.025632250 -0.011035335 [41] -0.055406670 -0.021748304 -0.147562982 -0.069892982 -0.068827705 [46] 0.051656267 0.017046548 -0.057861007 0.018085937 -0.010061871 [51] 0.016511197 -0.009001490 0.015045279 -0.044045916 0.090080787 [56] -0.031440015 0.080576212 -0.092206514 -0.019356814 -0.064972662 > 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/3rza11229679009.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/4ukvs1229679009.tab") > > system("convert tmp/1xqkv1229679008.ps tmp/1xqkv1229679008.png") > system("convert tmp/25ouo1229679008.ps tmp/25ouo1229679008.png") > > > proc.time() user system elapsed 1.540 0.542 1.642