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(12460,12870,14122,15366,15366,15046,10356,10194,11027,11449,12107,12862,12587,13951,15210,17511,17247,16900,12237,12188,12801,13276,14171,14629,16242,17239,18516,19862,19542,18515,13182,13148,13853,14341,14895,15317,15649,16373,17543,18911,19401,18295,12665,12246,12969,13563,15714,16094,15823,15460,16827,18279,18789,18041,12129,11708,12387,12982,13664,14073,14222,14715,15697,16908,17412,16232,10281,10258,11013,11779,12333,12684,12654,13239,14729,16146,16324,13797,9399,9626,10290,10931,11382,11704,11716,12470,13662,15097,15821,13083,9081,9479,10295,10999,11643,12055,12431,12940,14168,16031,16445,14245,9820,10389,11298,12156,12759,13414,13683,14070,15176,16694,17694,14294,9255,9868,10878,11685,12496,12488) > 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/freestat/rcomp/tmp/1nzym1229611609.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/freestat/rcomp/tmp/2khfk1229611609.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.000000e+00 -7.819991e-02 -1.311836e-02 -2.114696e-01 -1.174084e-02 [6] 1.156728e-02 1.148184e-01 1.230624e-01 -6.724328e-02 1.397962e-01 [11] -1.205545e-01 1.105789e-01 -2.485332e-01 4.972885e-02 8.528632e-03 [16] 1.450857e-02 -4.609540e-02 -6.901434e-02 -2.680578e-02 -4.810823e-02 [21] -4.447503e-02 2.263313e-02 1.845318e-01 -5.597613e-02 -9.520004e-02 [26] -9.819244e-02 -6.230634e-02 8.039623e-02 1.345839e-01 7.558796e-02 [31] -1.532727e-01 -2.490560e-02 5.987070e-02 6.685102e-02 -9.532938e-02 [36] -6.656381e-02 -5.931646e-02 5.290270e-02 4.995953e-02 -4.973180e-02 [41] -2.566218e-04 -8.431765e-02 2.612075e-05 -4.092385e-02 2.633779e-03 [46] -5.571371e-02 2.502558e-02 -1.778656e-02 5.307190e-02 -5.431361e-02 [51] 5.842295e-02 -1.466922e-02 -5.930486e-02 -9.310302e-02 7.255926e-02 [56] 7.320421e-02 1.322079e-02 1.016294e-02 -9.799955e-02 3.934789e-02 [61] -2.985660e-02 > (mypacf <- c(rpacf$acf)) [1] -0.078199910 -0.019351928 -0.215426225 -0.049403164 -0.004646728 [6] 0.071915280 0.135753396 -0.037937735 0.191475079 -0.042562447 [11] 0.102608746 -0.214490060 -0.032055060 0.009686933 -0.107046569 [16] -0.087409594 -0.078717256 -0.059705412 0.001125658 -0.162780918 [21] 0.107546001 0.190119018 0.028633981 -0.085659470 -0.034296871 [26] -0.033945063 0.021747679 0.015085803 0.055669101 -0.150782556 [31] -0.002417326 0.065744940 0.043246751 -0.068663272 -0.110551434 [36] -0.135215036 0.026655541 -0.048721531 -0.051239246 0.012951010 [41] -0.017858872 -0.047832719 -0.063257488 -0.018791966 0.022206249 [46] -0.024512350 -0.027834212 0.065031353 -0.062418788 0.019506270 [51] -0.061743212 0.005726097 -0.146013330 -0.046406751 -0.003751398 [56] -0.013550758 0.010472870 -0.031645078 -0.038377221 -0.045046607 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3cpj51229611609.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/freestat/rcomp/tmp/48jpd1229611609.tab") > > system("convert tmp/1nzym1229611609.ps tmp/1nzym1229611609.png") > system("convert tmp/2khfk1229611609.ps tmp/2khfk1229611609.png") > > > proc.time() user system elapsed 0.815 0.421 0.928