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(357,363,364,363,358,357,357,380,378,376,380,379,384,392,394,392,396,392,396,419,421,420,418,410,418,426,428,430,424,423,427,441,449,452,462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397) > par5 = '12' > par4 = '1' > par3 = '1' > 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/1rdpv1229427352.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/26fmz1229427352.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.007412952 0.080144342 0.126137065 0.004398911 [6] 0.091455282 0.042037188 -0.034370417 0.163981475 -0.025477900 [11] -0.195745271 0.123335193 -0.247977478 -0.071943836 0.124319869 [16] 0.031387827 0.041724462 -0.066024049 0.053562166 0.077073689 [21] -0.003528395 -0.048003642 -0.001974707 0.064773143 -0.165297238 [26] -0.103371530 -0.173424046 0.016454394 -0.120764103 0.029746587 [31] -0.112873434 -0.091287146 -0.099357937 -0.059026252 0.001336334 [36] 0.044981356 -0.016821012 -0.029738087 0.106469128 -0.146293685 [41] 0.029462337 0.001771040 -0.112996433 0.076507824 -0.026430615 [46] -0.093652613 0.031691203 -0.091495404 -0.010045754 0.062701107 [51] -0.103806321 0.074110311 0.024360279 -0.085391925 0.116894931 [56] -0.058128194 0.006628033 0.048673722 0.036257571 0.006182362 [61] 0.012807335 > (mypacf <- c(rpacf$acf)) [1] -0.007412952 0.080093792 0.128106116 0.001037494 0.072724242 [6] 0.029051712 -0.047666895 0.141434688 -0.025264380 -0.227135964 [11] 0.092452764 -0.226435269 -0.074542337 0.167538525 0.139645575 [16] 0.014287070 -0.078773841 0.143113836 0.002948015 -0.004220897 [21] -0.012276442 -0.201031034 0.066315342 -0.199213427 -0.140195046 [26] -0.154162409 0.126791660 -0.007745469 0.051355260 0.005257030 [31] -0.061929768 -0.068618103 0.010350308 -0.114820137 0.112002739 [36] -0.087629870 -0.130412975 0.029653055 -0.038412615 0.103414875 [41] 0.013834811 -0.136078414 0.027758019 0.019377205 -0.035765213 [46] -0.091108399 0.022245423 0.006411705 -0.078114770 -0.049456979 [51] 0.047440502 -0.064648830 0.048200157 -0.032245110 -0.070215826 [56] -0.035461815 -0.018995469 -0.013177613 -0.016957937 0.064277440 > 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/3njl01229427352.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/4wbzj1229427352.tab") > > system("convert tmp/1rdpv1229427352.ps tmp/1rdpv1229427352.png") > system("convert tmp/26fmz1229427352.ps tmp/26fmz1229427352.png") > > > proc.time() user system elapsed 0.667 0.333 0.809