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(76,75,74,72,70,69,70,72,73,73,74,76,74,67,66,58,55,58,64,68,66,76,75,88,85,83,77,66,65,65,63,62,57,68,69,79,74,76,82,75,75,76,78,77,67,74,68,87,76,88,95,96,96,105,108,113,101,107,102,116,105,121,134,140,131,141,131,128,123,129,125,144,135,141,156,159,146,154,145,133,126,127,122,148) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/rcomp/tmp/10zgt1282055315.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/2bqfe1282055315.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.0000000000 -0.2574139372 0.2315090331 -0.1299233247 0.1080945646 [6] -0.3491654048 0.0665095849 -0.2919405139 0.0699174154 -0.0713363768 [11] 0.2097948060 -0.3128552382 0.6541724024 -0.2124315163 0.1989457838 [16] -0.1327194676 0.1728153790 -0.2423693080 0.0329383783 -0.1686541430 [21] 0.0705658972 -0.0600812248 0.1543768182 -0.2713313131 0.3724518147 [26] -0.2143884653 0.1134809584 -0.1304180282 0.1533694458 -0.0752414176 [31] 0.0663893976 -0.0759509540 0.0002088723 -0.0518568803 0.0397066607 [36] -0.1960523770 0.2192504082 -0.1233613521 0.0795051818 -0.0409490876 [41] 0.1069097942 0.0046842942 0.0360986760 -0.0448279462 -0.0493231996 [46] -0.0517701728 -0.0530658553 -0.1283862929 0.0664443245 -0.0666579597 [51] 0.0776730714 0.0352014079 0.0752874592 0.0380983242 0.0525115178 [56] -0.0137673577 -0.0663486482 -0.0644470716 -0.0865700189 -0.0755066651 [61] 0.0411772066 > (mypacf <- c(rpacf$acf)) [1] -0.2574139372 0.1769737191 -0.0390502250 0.0358307986 -0.3209321984 [6] -0.1114274773 -0.2230415752 -0.0802297071 0.0147885915 0.1126515225 [11] -0.3366776005 0.5013529966 -0.0044600214 -0.0269178169 0.0303205197 [16] 0.0269051839 0.1324586963 -0.1249688797 0.0836115402 0.1098168756 [21] 0.0048885111 -0.0391470426 -0.0008153263 -0.0721811799 -0.0951499594 [26] -0.1024247482 0.0381380387 -0.0387596540 0.0642836860 0.0585569161 [31] -0.0316757071 -0.1559584405 -0.0596017669 -0.0464186895 0.0306545244 [36] 0.0037552992 0.0662490868 0.0125234352 0.0399893324 0.0262513677 [41] 0.0377764667 0.0014315176 -0.0878873124 0.0092375882 -0.0576751928 [46] -0.0568600758 0.0369190081 -0.1108768637 -0.1030595944 -0.0197163319 [51] -0.0278991864 0.0077100535 -0.0900009957 0.1103079515 0.0456842972 [56] -0.0592078024 -0.0780920083 -0.0219538173 -0.0099600887 0.0732684055 > 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/3eqvk1282055315.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/4hrc71282055315.tab") > > try(system("convert tmp/10zgt1282055315.ps tmp/10zgt1282055315.png",intern=TRUE)) character(0) > try(system("convert tmp/2bqfe1282055315.ps tmp/2bqfe1282055315.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.80 0.52 1.30