R version 2.10.1 (2009-12-14) 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(2550,2867,3458,2961,3163,2880,3331,3062,3534,3622,4464,5411,2564,2820,3508,3088,3299,2939,3320,3418,3604,3495,4163,4882,2211,3260,2992,2425,2707,3244,3965,3315,3333,3583,4021,4904,2252,2952,3573,3048,3059,2731,3563,3092,3478,3478,4308,5029,2075,3264,3308,3688,3136,2824,3644,4694,2914,3686,4358,5587,2265,3685,3754,3708,3210,3517,3905,3670,4221,4404,5086,5725,2367,3819,4067,4022,3937,4365,4290) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/rcomp/tmp/15tzu1272902055.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/25tzu1272902055.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.125112769 -0.029359643 0.080017923 0.143276657 [6] -0.015521257 -0.212343751 0.034944841 0.125801725 0.061415920 [11] -0.081620407 0.039750031 0.650801572 0.015951758 -0.067334829 [16] 0.038783133 0.077580538 -0.068664229 -0.247183791 0.020561187 [21] 0.036912219 0.002785632 -0.095633062 0.017397359 0.492401920 [26] -0.022466124 -0.079866172 -0.017595425 -0.012593831 -0.045461476 [31] -0.212070089 -0.061491161 -0.022494480 -0.018698695 -0.140398377 [36] -0.012198672 0.363263002 -0.054744018 -0.082229752 -0.023328117 [41] 0.009298599 -0.038498391 -0.183681331 -0.061989630 -0.019978024 [46] -0.014848571 -0.108878254 -0.011624543 0.244461617 -0.050001274 [51] -0.097250476 -0.037994299 -0.033860642 -0.052605404 -0.099334803 [56] -0.009249127 -0.039045021 -0.017302598 -0.079877744 0.005058372 [61] 0.138891749 > (mypacf <- c(rpacf$acf)) [1] 0.1251127692 -0.0457286476 0.0911956194 0.1225428001 -0.0441426907 [6] -0.2089287557 0.0696106400 0.0969259024 0.0821189677 -0.0569763186 [11] 0.0193640496 0.6282059091 -0.2013581206 -0.0320950166 -0.0345911758 [16] -0.0969547127 -0.0005363958 -0.0789698104 -0.0114647834 -0.0831202421 [21] -0.0234820622 0.0457478401 0.0205696059 0.1255377273 -0.0253638587 [26] -0.0382667505 -0.0736793316 -0.1118061686 0.1474103049 0.0011885843 [31] -0.2072236670 0.0166490985 -0.0366797929 -0.0622482490 0.0867843515 [36] -0.0216085895 -0.0521211241 -0.0249951635 0.0400860098 0.1288043747 [41] -0.0685455450 -0.0072243392 -0.0017047562 -0.0288753846 0.0059870325 [46] 0.0664849024 -0.0091923288 -0.1899241633 0.0194506780 0.0059207217 [51] -0.0359267292 -0.0605217036 -0.0242262987 0.1028939305 0.0515237601 [56] -0.0621203105 0.0755101509 -0.0487898526 -0.0647864661 0.0044349052 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/313xl1272902055.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/rcomp/tmp/4cuwo1272902055.tab") > > try(system("convert tmp/15tzu1272902055.ps tmp/15tzu1272902055.png",intern=TRUE)) character(0) > try(system("convert tmp/25tzu1272902055.ps tmp/25tzu1272902055.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.650 0.470 0.919