R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(159,158,157,155,175,174,159,149,150,150,151,153,146,156,154,151,171,167,144,138,138,132,132,132,125,131,129,131,145,156,126,123,127,116,114,114,109,110,113,114,138,155,126,123,124,124,134,131,126,128,128,124,148,174,146,137,152,159,170,166,165,168,175,180,199,228,206,193,201,214,225,224,215,222,238,248,262,288,261,240,248,260,266,268,256,261,287,295,304,331,299,275,293,309,311,311,289,298,319,325,331,348,320,305,322,337,346,343,321,331,343,345,347,363,322,304,323,340,352,351) > 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/rcomp/tmp/1x4mt1282229873.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/2vza21282229873.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.970740811 0.938652124 0.921192138 0.908749103 [6] 0.903653094 0.894229169 0.866330281 0.839790377 0.817151309 [11] 0.796041581 0.787420430 0.778433914 0.740002573 0.699103379 [16] 0.672018892 0.650114337 0.633597751 0.611891393 0.574601861 [21] 0.540314244 0.510883700 0.482638000 0.465781509 0.449321135 [26] 0.407975776 0.364361845 0.333790810 0.309384442 0.288829881 [31] 0.262172049 0.220644539 0.184605796 0.154955315 0.125997841 [36] 0.105645068 0.086377319 0.048850721 0.008566264 -0.018173133 [41] -0.038605749 -0.057550212 -0.081299297 -0.117261043 -0.147646272 [46] -0.170427453 -0.191736079 -0.207643156 -0.221247573 > (mypacf <- c(rpacf$acf)) [1] 0.9707408109 -0.0639169763 0.2404918525 0.0531056713 0.1873678084 [6] -0.0605673059 -0.2556700474 0.0243996137 -0.0892283324 -0.0180480296 [11] 0.1669924581 0.0150671822 -0.4241414134 -0.0202002522 0.1090776431 [16] -0.0190813728 -0.0387785104 -0.0151175197 -0.0471542299 -0.0211067818 [21] -0.0303864123 0.0102095729 0.0511361440 0.0006743075 -0.2078974270 [26] -0.0081014420 0.0516665581 -0.0165034802 -0.0755835153 -0.0165658405 [31] -0.0464122587 0.0005863802 -0.0215423684 0.0079136325 -0.0101813947 [36] 0.0060240360 -0.0419754709 -0.0454488378 0.0757224402 -0.0243997275 [41] -0.0875672470 0.0186310224 0.0003119520 -0.0244576753 -0.0398769542 [46] 0.0616954561 -0.0326462347 0.0101051866 > 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/3bwj21282229873.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/445051282229873.tab") > > try(system("convert tmp/1x4mt1282229873.ps tmp/1x4mt1282229873.png",intern=TRUE)) character(0) > try(system("convert tmp/2vza21282229873.ps tmp/2vza21282229873.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.730 0.590 1.275