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(2851,2672,2755,2721,2946,3036,2282,2212,2922,4301,5764,7132,2541,2475,3031,3266,3776,3230,3028,1759,3595,4474,6838,8357,3113,3006,4047,3523,3937,3986,3260,1573,3528,5211,7614,9254,5375,3088,3718,4514,4520,4539,3663,1643,4739,5428,8314,10651,3633,4292,4154,4121,4647,4753,3965,1723,5048,6922,9858,11331,4016,3975,4510,4276,4968,4677,3523,1821,5222,6873,10803,13916,2639,2899,3370,3740,2927,3986,4217,1738,5221,6424,9842,13076,3934,3162,4286,4676,5010,4874,4633,1659,5951,6981,9851,12670) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/html/freestat/rcomp/tmp/1rdw81274007516.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/html/freestat/rcomp/tmp/2rdw81274007516.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.058924310 -0.201964225 -0.109641390 -0.289888703 [6] 0.124322990 0.158406398 0.157686889 -0.316669112 -0.105338878 [11] -0.196969826 -0.072982362 0.806645351 0.003215289 -0.175782235 [16] -0.107226412 -0.249280305 0.102232840 0.151038501 0.148502793 [21] -0.294341444 -0.081162269 -0.160745523 -0.058279203 0.633650074 [26] 0.008844212 -0.124969662 -0.104358096 -0.199164308 0.082709286 [31] 0.111853411 0.117263502 -0.218219127 -0.075315167 -0.125273709 [36] -0.014840308 0.495059984 -0.021341415 -0.102231293 -0.066236066 [41] -0.157994732 0.059328584 0.096464890 0.081455158 -0.163259871 [46] -0.050597119 -0.110242134 0.003703788 0.367816807 > (mypacf <- c(rpacf$acf)) [1] -0.058924310 -0.206152074 -0.142680784 -0.377636935 -0.014759313 [6] -0.008419723 0.151078882 -0.402609628 -0.051297908 -0.469531810 [11] -0.281829971 0.591613514 0.088546883 -0.004577918 0.025829519 [16] -0.031064983 0.028092763 -0.065095944 -0.105013513 -0.035950624 [21] 0.048947248 0.037013645 0.098555262 -0.059332544 -0.081185267 [26] 0.020562790 -0.011923157 -0.010046198 -0.003982312 -0.118966981 [31] -0.059994185 0.112828837 -0.039597272 -0.001822220 0.067660138 [36] 0.014161032 -0.045649746 -0.079898939 0.006294425 0.005937654 [41] -0.055265525 0.033486603 0.040853181 0.014951915 0.035700126 [46] -0.026168321 -0.062534459 -0.098674512 > 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/355cz1274007516.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/4yftk1274007516.tab") > > try(system("convert tmp/1rdw81274007516.ps tmp/1rdw81274007516.png",intern=TRUE)) character(0) > try(system("convert tmp/2rdw81274007516.ps tmp/2rdw81274007516.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.794 0.440 0.894