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(451,450,444,429,421,400,389,384,432,446,431,423,416,416,413,399,386,374,365,365,418,428,424,421,417,423,423,419,406,398,390,391,444,460,455,456,452,459,461,451,443,439,430,436,488,506,502,501,501,515,521,520,512,509,505,511,570,592,594,586,586,592,594,586,572,563,555,554,601,622,617,606,595,599,600,592,575,567,555,555,608,631,629,624,610,616,621,604,584,574,555,545,599,620,608,590,579,580,579,572,560,551,537,541,588,607,599,578,563,566,561,554,540,526,512,505,554,584,569,540,522,526,527,516,503,489,479,475,524,552,532,511,492,492,493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1.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/1g9ib1228942666.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/26g461228942666.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.00000000 0.95658188 0.88706899 0.83477639 0.80730223 0.79934261 [7] 0.78683760 0.76171831 0.73419868 0.72935324 0.74965874 0.78610007 [13] 0.79602842 0.73192247 0.64423448 0.57276853 0.52704306 0.50116623 [19] 0.47211208 0.43269146 0.39172152 0.37341081 0.37927740 0.40103512 [25] 0.39804413 0.32730318 0.23468097 0.15889667 0.11008462 0.08152113 [31] 0.05108200 0.01192910 -0.02833104 -0.04680110 -0.04180389 -0.02117136 [37] -0.02211823 -0.08654399 -0.17141100 -0.23914855 -0.27910199 -0.29810080 [43] -0.31715679 -0.34472540 -0.37309936 -0.37988592 -0.36427050 -0.33343536 [49] -0.32259410 -0.37087309 -0.43755489 -0.48715336 -0.50975610 -0.51180242 [55] -0.51229711 -0.52110707 -0.53079059 -0.52009663 -0.48820569 -0.44124005 [61] -0.41380834 > (mypacf <- c(rpacf$acf)) [1] 0.956581878 -0.329364726 0.287880767 0.117169916 0.153558396 [6] -0.108381213 0.013329711 0.048497178 0.288932071 0.123147542 [11] 0.249815497 -0.337616754 -0.756727838 -0.013463907 -0.101093719 [16] 0.030428699 0.102815123 0.093423021 0.098045118 -0.077799045 [21] -0.091636742 -0.126792313 -0.001062420 0.020504110 -0.169597021 [26] 0.029553524 0.039118294 0.011760421 0.027948192 -0.006710724 [31] 0.017401334 -0.070126563 -0.085622004 -0.050885635 -0.003848675 [36] 0.122389363 -0.098521328 0.046228582 -0.005417617 -0.028476787 [41] 0.001694988 0.007438462 -0.029397011 0.024298904 -0.007204486 [46] -0.008707954 -0.010313037 0.029266546 -0.013011072 0.052832884 [51] 0.007011154 -0.050425559 -0.019810109 0.037981980 -0.024466464 [56] 0.039228658 -0.001777272 0.047485935 0.025887228 -0.022052155 > 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/38w681228942666.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/43tmk1228942666.tab") > > system("convert tmp/1g9ib1228942666.ps tmp/1g9ib1228942666.png") > system("convert tmp/26g461228942666.ps tmp/26g461228942666.png") > > > proc.time() user system elapsed 0.578 0.316 0.691