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(376,375,374,372,370,369,370,372,373,373,374,376,371,374,369,363,357,366,362,366,361,362,358,363,360,360,348,345,332,333,323,327,332,337,336,337,343,337,326,321,309,302,293,287,292,292,289,302,310,295,276,264,257,243,227,226,226,229,224,240,244,226,208,199,193,180,167,164,166,173,169,191,193,166,143,147,139,129,115,108,106,116,108,135) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/1esfn1282152959.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/26jx81282152959.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.1115248028 0.0117524145 -0.1980816908 0.0732962365 [6] -0.0980982874 0.0904281430 -0.0899468391 0.1138763784 -0.0901244546 [11] -0.0243016763 0.0218402120 0.0272882556 0.0196644995 -0.0609886060 [16] 0.1601002193 -0.0347298605 -0.0733570566 -0.2434707491 0.1019758307 [21] -0.0182805830 0.0006637645 -0.1486785015 0.2470425422 0.0089862309 [26] 0.0181523452 -0.1890835020 -0.0437027935 0.0780813403 0.0113783190 [31] 0.0663542847 0.1046501655 -0.1287292812 -0.0185092256 -0.0488219959 [36] 0.0989300805 0.0348106792 -0.0642717610 -0.0124795763 0.1060549051 [41] -0.1325210577 -0.0630460800 -0.0049522046 0.0338340517 0.0168712045 [46] 0.0479285580 -0.0782416375 -0.0087959360 0.0005019210 > (mypacf <- c(rpacf$acf)) [1] -0.111524803 -0.000693999 -0.199326771 0.030793455 -0.093965787 [6] 0.035558171 -0.065657623 0.068569263 -0.049460969 -0.076715143 [11] 0.061542485 -0.017733398 0.036550312 -0.069423094 0.178201736 [16] -0.010910260 -0.097991077 -0.203831099 0.019410313 -0.010825010 [21] -0.123140113 -0.116822651 0.184052142 0.083950488 -0.037760312 [26] -0.133301681 -0.140006903 0.117930543 -0.025592134 0.064686925 [31] 0.105162652 -0.091555148 0.110414418 -0.101945516 0.022508500 [36] -0.042255841 -0.007809997 -0.025843238 0.035660102 -0.121511593 [41] 0.011806972 0.042630122 -0.138678945 -0.051245919 0.083721169 [46] -0.077545363 -0.072095982 0.028711406 > 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/3ltvh1282152959.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/4v2u21282152959.tab") > > try(system("convert tmp/1esfn1282152959.ps tmp/1esfn1282152959.png",intern=TRUE)) character(0) > try(system("convert tmp/26jx81282152959.ps tmp/26jx81282152959.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.578 0.305 0.859