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(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 = '1' > 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/13uhd1229681574.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/2s4fy1229681574.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.097465947 0.223903622 0.353989220 -0.097599176 [6] 0.147359919 0.121479230 0.012591339 0.117138313 0.096199344 [11] -0.002922910 -0.055286105 -0.177929633 -0.113420124 -0.083440313 [16] 0.033823270 -0.029197298 0.127752915 0.235558047 -0.023322007 [21] 0.140924876 0.205526739 -0.086069273 0.317890147 0.025441172 [26] 0.019675916 0.208277832 -0.075979023 0.052847347 -0.016623012 [31] -0.187320054 -0.008661629 -0.036225957 -0.239962725 -0.067965127 [36] -0.177828027 -0.112313108 -0.030904968 -0.020080542 -0.050235810 [41] -0.012074058 -0.017241076 -0.072661853 -0.107325394 0.035142555 [46] -0.052066000 0.070031232 0.085839688 -0.140271103 0.088142610 [51] -0.160649874 -0.105920769 -0.059068632 -0.196034051 -0.004041252 [56] -0.019878592 -0.119379751 0.005095557 -0.090968631 -0.115059775 [61] -0.044121565 > (mypacf <- c(rpacf$acf)) [1] 0.097465947 0.216460300 0.334493954 -0.207941716 0.022548395 [6] 0.074331166 0.084060252 -0.009090804 0.050518154 -0.044000580 [11] -0.150407115 -0.252385201 -0.028003282 0.073557740 0.217012141 [16] -0.044272431 0.150818211 0.284219759 -0.007528109 -0.066105332 [21] 0.228836496 -0.052370477 0.105514090 -0.327981069 -0.044377405 [26] -0.052230650 -0.048528440 -0.092728878 0.080046471 -0.068779669 [31] 0.081689987 0.040807169 -0.047393302 -0.086737144 -0.105096186 [36] -0.026318145 0.099232383 -0.021869269 -0.073592046 -0.029011860 [41] -0.136095456 -0.042883779 -0.156283369 0.094331467 0.068365031 [46] -0.005979888 0.036331339 -0.052233809 0.034171891 -0.035352824 [51] 0.146206536 -0.032031646 -0.110654282 -0.064354642 -0.063961848 [56] 0.048397101 -0.014268093 0.079013257 0.010637686 -0.033416029 > 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/3h6kb1229681574.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/40hrj1229681574.tab") > > system("convert tmp/13uhd1229681574.ps tmp/13uhd1229681574.png") > system("convert tmp/2s4fy1229681574.ps tmp/2s4fy1229681574.png") > > > proc.time() user system elapsed 0.595 0.320 0.714