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(1954,2302,3054,2414,2226,2725,2589,3470,2400,3180,4009,3924,2072,2434,2956,2828,2687,2629,3150,4119,3030,3055,3821,4001,2529,2472,3134,2789,2758,2993,3282,3437,2804,3076,3782,3889,2271,2452,3084,2522,2769,3438,2839,3746,2632,2851,3871,3618,2389,2344,2678,2492,2858,2246,2800,3869,3007,3023,3907,4209,2353,2570,2903,2910,3782,2759,2931,3641,2794,3070,3576,4106,2452,2206,2488,2416,2534,2521,3093,3903,2907,3025,3812,4209) > 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/rcomp/tmp/1pvsi1273071992.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/2pvsi1273071992.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.229344580 -0.195231404 0.074243039 0.144873030 [6] -0.150103065 -0.355227773 -0.230345808 0.103800136 0.017599638 [11] -0.315646906 0.041733365 0.651081052 0.140963697 -0.184913429 [16] -0.011853625 0.060075292 -0.145314923 -0.293961644 -0.215344040 [21] 0.064317932 0.056107158 -0.222742131 0.073228797 0.560923063 [26] 0.152721784 -0.132580090 -0.022790637 0.062908588 -0.109239014 [31] -0.249080654 -0.216314195 0.036293119 0.042159645 -0.219191859 [36] -0.007418154 0.460338057 0.154189735 -0.076287893 -0.030338783 [41] 0.045745999 -0.012112264 -0.181478410 -0.209114107 0.069594826 [46] 0.104516494 -0.155902475 -0.001325694 0.361111142 > (mypacf <- c(rpacf$acf)) [1] 0.229344580 -0.261589679 0.216101799 0.007553558 -0.161825066 [6] -0.273777080 -0.188496956 0.133541319 -0.039326110 -0.253911298 [11] 0.154409044 0.528491138 -0.237575578 -0.019616036 -0.181187759 [16] -0.151092501 -0.112210039 0.097424155 -0.006196116 -0.108995101 [21] 0.071540695 0.044463247 0.093355263 0.122145205 -0.090235330 [26] -0.133785561 -0.099296704 0.087456232 -0.010171607 0.009016837 [31] -0.054971400 -0.044219912 -0.024068729 0.015769797 -0.103098417 [36] 0.043432741 -0.065402894 0.097852743 -0.035894053 -0.005485054 [41] 0.100984663 -0.106235527 0.002978417 0.063487629 0.021699065 [46] -0.011907800 0.052844301 -0.042787595 > 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/3tdro1273071992.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/4wwpc1273071992.tab") > > try(system("convert tmp/1pvsi1273071992.ps tmp/1pvsi1273071992.png",intern=TRUE)) character(0) > try(system("convert tmp/2pvsi1273071992.ps tmp/2pvsi1273071992.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.579 0.326 1.264