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(277 + ,260.6 + ,291.6 + ,275.4 + ,275.3 + ,231.7 + ,238.8 + ,274.2 + ,277.8 + ,299.1 + ,286.6 + ,232.3 + ,294.1 + ,267.5 + ,309.7 + ,280.7 + ,287.3 + ,235.7 + ,256.4 + ,289 + ,290.8 + ,321.9 + ,291.8 + ,241.4 + ,295.5 + ,258.2 + ,306.1 + ,281.5 + ,283.1 + ,237.4 + ,274.8 + ,299.3 + ,300.4 + ,340.9 + ,318.8 + ,265.7 + ,322.7 + ,281.6 + ,323.5 + ,312.6 + ,310.8 + ,262.8 + ,273.8 + ,320 + ,310.3 + ,342.2 + ,320.1 + ,265.6 + ,327 + ,300.7 + ,346.4 + ,317.3 + ,326.2 + ,270.7 + ,278.2 + ,324.6 + ,321.8 + ,343.5 + ,354 + ,278.2 + ,330.2 + ,307.3 + ,375.9 + ,335.3 + ,339.3 + ,280.3 + ,293.7 + ,341.2 + ,345.1 + ,368.7 + ,369.4 + ,288.4 + ,341 + ,319.1 + ,374.2 + ,344.5 + ,337.3 + ,281 + ,282.2 + ,321 + ,325.4 + ,366.3 + ,380.3 + ,300.7 + ,359.3 + ,327.6 + ,383.6 + ,352.4 + ,329.4 + ,294.5 + ,333.5 + ,334.3 + ,358 + ,396.1 + ,387 + ,307.2 + ,363.9 + ,344.7 + ,397.6 + ,376.8 + ,337.1 + ,299.3 + ,323.1 + ,329.1 + ,347 + ,462 + ,436.5 + ,360.4 + ,415.5 + ,382.1 + ,432.2 + ,424.3 + ,386.7 + ,354.5 + ,375.8 + ,368 + ,402.4 + ,426.5 + ,433.3 + ,338.5 + ,416.8 + ,381.1 + ,445.7 + ,412.4 + ,394 + ,348.2 + ,380.1 + ,373.7 + ,393.6 + ,434.2 + ,430.7 + ,344.5 + ,411.9 + ,370.5 + ,437.3 + ,411.3 + ,385.5 + ,341.3 + ,384.2 + ,373.2 + ,415.8 + ,448.6 + ,454.3 + ,350.3 + ,419.1 + ,398 + ,456.1 + ,430.1 + ,399.8 + ,362.7 + ,384.9 + ,385.3 + ,432.3 + ,468.9 + ,442.7 + ,370.2 + ,439.4 + ,393.9 + ,468.7 + ,438.8 + ,430.1 + ,366.3 + ,391 + ,380.9 + ,431.4 + ,465.4 + ,471.5 + ,387.5 + ,446.4 + ,421.5 + ,504.8 + ,492.1 + ,421.3 + ,396.7 + ,428 + ,421.9 + ,465.6 + ,525.8 + ,499.9 + ,435.3 + ,479.5 + ,473 + ,554.4 + ,489.6 + ,462.2 + ,420.3) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '2' > par3 = '0' > par2 = '0.6' > 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/html/rcomp/tmp/1gjo71263299737.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/2usrr1263299737.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.4696863220 0.4475799986 0.1886788954 0.1546529674 [6] 0.0695340908 0.0750973511 0.0831958565 0.0107186545 -0.0846081287 [11] -0.2696388606 -0.2737111279 -0.5988955408 -0.2269149605 -0.2204844006 [16] 0.0333586598 -0.0428409161 -0.0453770557 -0.0450465538 -0.0688694930 [21] -0.0754096234 0.0038546272 0.0944250792 0.0736613009 0.1692956038 [26] -0.0093642023 0.0247550943 -0.1517992912 -0.0860329416 -0.0019139226 [31] -0.0239926777 0.0305457728 0.0265852117 -0.0032782455 -0.0393253139 [36] -0.0465658110 -0.0568382903 0.0223242179 -0.0220526179 0.0711570291 [41] 0.0826521164 -0.0167625911 0.0038896705 -0.0604939436 -0.0009206897 [46] -0.0143417026 0.0160385207 0.0495801520 0.0203839239 -0.0023637374 [51] 0.0094629739 -0.0436718448 -0.0644793666 0.0191996447 -0.0345779307 [56] 0.0881012015 -0.0229055447 -0.0215018341 -0.0528229106 -0.0845148530 [61] -0.0745642402 > (mypacf <- c(rpacf$acf)) [1] 0.4696863220 0.2912192505 -0.1361347098 -0.0033237287 0.0145947761 [6] 0.0287769726 0.0584689625 -0.0891991495 -0.1557354744 -0.2543546331 [11] -0.0539867582 -0.4823726839 0.3636351050 0.1910780918 0.1447743671 [16] -0.0610748305 -0.1722467389 0.0701078363 0.0212262680 -0.1519430863 [21] -0.0755171659 -0.0965590262 -0.0369152525 -0.1871564187 0.1521585177 [26] 0.1552052892 0.0716234574 -0.1501843576 0.0177711079 -0.0359317049 [31] 0.0824864592 -0.0764799856 -0.0923987442 -0.0325723909 -0.0348509040 [36] -0.1058151948 0.0336299869 0.0699752550 0.0626249495 0.0383904886 [41] -0.0616240554 -0.0557386888 0.0675851122 -0.0110868793 -0.0506612762 [46] -0.0300596963 -0.0005125521 -0.1276497613 0.0253128013 0.0222447799 [51] 0.0067118604 0.0528318444 0.0317423518 -0.1465315462 0.1330450714 [56] -0.0026605898 -0.1387389242 -0.0613007103 -0.0324548488 -0.1396469317 > 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/3fvey1263299737.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/43ogz1263299737.tab") > > try(system("convert tmp/1gjo71263299737.ps tmp/1gjo71263299737.png",intern=TRUE)) character(0) > try(system("convert tmp/2usrr1263299737.ps tmp/2usrr1263299737.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.593 0.312 0.704