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(900,899,898,896,916,915,900,890,891,891,892,894,896,889,878,883,901,897,881,866,867,866,862,871,865,856,847,859,870,872,856,839,829,825,822,827,822,812,810,816,820,823,810,793,777,772,765,765,753,742,736,740,742,742,728,707,699,696,689,692,673,653,642,648,654,653,630,609,598,601,592,591,568,538,523,530,529,534,513,491,480,478,462,461,437,411,400,405,395,407,385,366,349,343,332,327,306,276,269,268,260,274,247,226,212,199,188,179,155,124,117,116,105,112,86,64,53,42,32,24) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/1enzj1282231359.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/2enzj1282231359.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.00000000 0.29396758 -0.09834886 -0.25172975 -0.10962033 0.19952565 [7] 0.58297015 0.21751749 -0.08179534 -0.27392675 -0.11034613 0.28130819 [13] 0.80549529 0.23608029 -0.08998908 -0.24157515 -0.13494143 0.15126022 [19] 0.50886710 0.16250105 -0.10640137 -0.28099785 -0.11965719 0.22571259 [25] 0.60655619 0.19948278 -0.07767683 -0.24187904 -0.15367235 0.12422846 [31] 0.42442899 0.10829006 -0.13452100 -0.28686763 -0.14213861 0.16747307 [37] 0.46105226 0.15924388 -0.12590735 -0.25704276 -0.13357047 0.10283927 [43] 0.32407186 0.05389393 -0.16444168 -0.30858037 -0.17424562 0.11134818 [49] 0.34010046 > (mypacf <- c(rpacf$acf)) [1] 0.293967581 -0.202243019 -0.179771259 0.011085041 0.210765967 [6] 0.496994881 -0.070712386 0.001561276 -0.105577701 0.034669081 [11] 0.237614037 0.660540773 -0.172468187 0.007753353 0.016976709 [16] -0.027020538 -0.116119214 -0.108602863 -0.120060752 -0.058574080 [21] 0.007148676 -0.011508724 -0.059449084 -0.083045378 0.125754371 [26] 0.034890650 -0.002550276 -0.012686756 0.057022269 0.014355813 [31] -0.032921077 -0.069958411 -0.064456087 -0.033511265 -0.006039831 [36] -0.032326706 -0.047135926 -0.146606696 0.038013111 0.116857562 [41] -0.027958676 -0.072456928 -0.017293062 0.062375543 -0.041378406 [46] -0.079359858 -0.086965551 -0.040206535 > 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/3axes1282231359.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/43owd1282231359.tab") > > try(system("convert tmp/1enzj1282231359.ps tmp/1enzj1282231359.png",intern=TRUE)) character(0) > try(system("convert tmp/2enzj1282231359.ps tmp/2enzj1282231359.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.597 0.315 0.779