R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(49.1,52.7,55.1,60.4,57.5,55.9,62.6,61.3,67.1,68.6,74.8,76.9,85.7,86.5,90.8,89.7,96.3,107.5,109.2,100.2,116.8,120.1,123.3,130.2,131.4,125.6,124.5,134.3,135.2,151.8,146.4,140.0,127.8,148.0,165.9,165.5,179.9,190.0,189.8,190.9,203.6,183.5,169.3,144.2,141.5,154.3,169.5,194.0,203.2,192.9,209.4,227.2,263.7,297.8,337.1,361.3,355.2,312.6,309.9,323.7,324.1,355.3,383.4,395.1,412.8,407.0,438.0,446.1,452.5,447.3,475.9,487.7) > par5 = '1' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/16znh1242321125.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/2j4f51242321125.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.3518008043 0.0981164290 -0.1044402911 -0.1759385899 [6] -0.2034504097 -0.0076609880 0.1223462477 0.1618866965 -0.0236649307 [11] -0.1458224799 -0.0280489439 -0.0214984222 -0.0151403230 0.1365729684 [16] 0.0912937161 0.2030579458 0.1245189158 0.0755517099 0.0655358207 [21] -0.0763361201 -0.1218269958 -0.0952675738 -0.1331856191 -0.0406267493 [26] 0.0678490416 0.0765191398 -0.0199984123 -0.0386588515 -0.1312674023 [31] 0.0091249549 -0.0451372555 0.0092245923 0.0269555801 0.0102282054 [36] -0.0301322282 -0.0566641346 0.0253014036 0.0202036283 -0.0009753586 [41] -0.0874669186 -0.0017114110 -0.0138413792 -0.0405548238 -0.0039939673 [46] -0.0677380385 -0.0230474936 -0.0586327582 -0.0621510507 > (mypacf <- c(rpacf$acf)) [1] 0.3518008043 -0.0292699355 -0.1481130944 -0.1037718421 -0.1097978941 [6] 0.1148414059 0.0965172412 0.0432866235 -0.1635275919 -0.1261267868 [11] 0.1642805460 0.0245037334 -0.0521389231 0.0912596530 -0.0456296408 [16] 0.2632436762 0.0768037389 0.0018321333 0.0521695132 -0.1350236074 [21] 0.0542921743 -0.0386148742 -0.1623509407 0.0362677134 0.0165076471 [26] 0.0924083811 -0.1282406637 -0.0731359676 -0.0426979039 0.0751369774 [31] -0.0370431103 -0.1426636099 -0.1302714507 0.0617146526 0.0658867617 [36] -0.0346041478 0.0468847071 -0.0497299749 0.1035303121 -0.0366531978 [41] 0.0244293722 -0.0400852267 -0.0506895448 0.0476036365 -0.1036455420 [46] 0.0323957752 -0.0002810090 -0.0264706548 > 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/3sm1b1242321125.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/4tqwd1242321125.tab") > > system("convert tmp/16znh1242321125.ps tmp/16znh1242321125.png") > system("convert tmp/2j4f51242321125.ps tmp/2j4f51242321125.png") > > > proc.time() user system elapsed 0.582 0.316 0.695