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(306,303,344,254,309,310,379,294,356,318,405,545,268,243,273,273,236,222,302,285,309,322,362,471,198,253,173,186,185,105,228,214,189,270,277,378,185,182,258,179,197,168,250,211,260,234,305,347,203,217,227,242,185,175,252,319,202,254,336,431,150,280,187,279,193,227,225,205,259,254,275,394,159,230,188,195,189,220,274) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1nxjz1273085132.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/2nxjz1273085132.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.320658417 0.264274195 0.154982236 0.160276902 [6] 0.031977935 -0.210939479 -0.018980288 0.084729347 0.072511689 [11] 0.153286674 0.193032535 0.545520874 0.170272402 0.054809644 [16] 0.003631466 -0.030850439 -0.085196694 -0.351997106 -0.114843147 [21] -0.088172242 -0.049258590 -0.074904546 0.056199406 0.271162947 [26] -0.001767000 -0.081647240 -0.080119236 -0.093517711 -0.158263172 [31] -0.267811082 -0.124191450 -0.088629925 -0.014446165 -0.048371906 [36] 0.047025324 0.269763715 -0.011308904 0.020619412 -0.086417224 [41] -0.006551167 -0.096875482 -0.197221327 -0.054768721 -0.023772952 [46] -0.016541098 -0.011712086 0.054808145 0.208562857 > (mypacf <- c(rpacf$acf)) [1] 0.320658417 0.179955753 0.032006870 0.074742923 -0.070507207 [6] -0.291860906 0.116149013 0.202350807 0.045724666 0.167183951 [11] 0.090510743 0.401437839 -0.179323723 -0.229984303 -0.099891480 [16] -0.105710101 0.005353607 -0.130069394 0.068100391 -0.083200772 [21] -0.030517965 -0.150924354 0.051435230 0.059995561 -0.093392725 [26] 0.001218229 0.009949058 0.010997620 -0.062107971 0.175083887 [31] -0.040447601 -0.028591336 0.091453913 -0.010995147 -0.022054711 [36] 0.138302811 -0.071610246 0.053139537 -0.084158796 -0.037783835 [41] 0.020986808 -0.070687314 -0.002124013 0.018732940 -0.098022674 [46] -0.030567688 -0.001243140 -0.046537100 > 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/3jogq1273085132.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/4bgyt1273085132.tab") > > try(system("convert tmp/1nxjz1273085132.ps tmp/1nxjz1273085132.png",intern=TRUE)) character(0) > try(system("convert tmp/2nxjz1273085132.ps tmp/2nxjz1273085132.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.784 0.417 0.881