R version 2.9.0 (2009-04-17) 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(55,43,55,50,44,59,41,25,46,47,50,51,41,54,55,43,53,59,54,49,62,57,60,55,69,62,65,55,66,67,59,54,60,65,59,68,58,75,61,59,69,64,62,60,59,54,58,59,69,81,74,54,68,74,51,61,46,56,50,59,53) > 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/html/rcomp/tmp/1u4fn1260459087.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/rcomp/tmp/2mqtf1260459087.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 4.543137e-01 3.942920e-01 4.577852e-01 3.972026e-01 [6] 3.030113e-01 2.788656e-01 1.858498e-01 2.383550e-01 2.281539e-01 [11] 5.907796e-02 2.179999e-01 2.258398e-01 1.252043e-01 8.678916e-03 [16] 1.216438e-01 1.427759e-02 -8.827629e-02 -8.953296e-02 -1.205794e-01 [21] -1.562215e-02 -1.457730e-01 -1.673559e-01 -1.192096e-01 1.921608e-02 [26] -1.356706e-01 -1.213625e-01 -1.122189e-01 -1.722168e-01 -1.262275e-01 [31] -2.176680e-01 -1.954896e-01 -1.533490e-01 -1.899835e-01 -2.945691e-01 [36] -1.261836e-01 -1.824879e-01 -1.821365e-01 -1.534513e-01 -9.784330e-02 [41] -1.752974e-01 -1.869723e-01 -2.099544e-01 -1.909535e-01 -6.008490e-02 [46] -1.191430e-01 -1.686362e-01 -4.438787e-02 -4.789705e-02 -3.515237e-02 [51] 4.875961e-02 1.240559e-02 -3.980172e-03 4.278185e-02 2.940639e-02 [56] 3.193572e-02 1.852744e-02 2.406708e-02 6.455998e-05 1.023452e-02 [61] 1.716122e-03 > (mypacf <- c(rpacf$acf)) [1] 0.454313737 0.236758111 0.285005232 0.124207515 -0.006321685 [6] -0.008161819 -0.107606177 0.081231089 0.064603819 -0.151083844 [11] 0.180951894 0.076823184 -0.023440443 -0.215671094 0.042930282 [16] -0.105424784 -0.184487850 -0.016372508 -0.035133196 0.161348744 [21] -0.098310324 -0.001165302 -0.036164743 0.122531220 -0.025917188 [26] -0.058231074 -0.063512488 -0.139990922 0.123792837 -0.091204168 [31] -0.028570262 0.018159179 -0.052551804 -0.066916077 -0.038381984 [36] -0.032591246 0.011379337 0.030142644 0.110185549 -0.176865696 [41] -0.025913163 -0.104993526 0.050315181 0.063481712 0.097734736 [46] -0.022809217 0.032885801 -0.050691767 0.043782365 0.046962599 [51] -0.057593168 -0.023842967 -0.009874426 0.095102726 -0.044645083 [56] -0.099704924 0.014013216 -0.069552622 -0.112593491 -0.005761868 > 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/3owj81260459087.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/4wnr51260459087.tab") > > system("convert tmp/1u4fn1260459087.ps tmp/1u4fn1260459087.png") > system("convert tmp/2mqtf1260459087.ps tmp/2mqtf1260459087.png") > > > proc.time() user system elapsed 0.593 0.326 1.144