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(89,97,154,81,110,116,73,73,174,103,130,91,136,106,136,122,131,135,75,68,143,115,93,128,152,125,107,116,220,137,34,51,153,145,116,145,98,118,139,140,113,149,79,47,166,180,122,134,114,125,181,142,143,187,137,62,239,157,139,187,99,146,175,148,130,183,115,80,223,131,201,157) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1qb1n1292324011.ps",horizontal=F,onefile=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/2qb1n1292324011.ps",horizontal=F,onefile=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.106976648 -0.176108564 0.083820544 0.171013020 [6] 0.041601654 0.012612972 -0.025441860 -0.140043368 0.034170520 [11] -0.002046582 0.172272648 -0.268096929 -0.112963153 0.039607828 [16] -0.166949300 -0.060893295 0.104210485 -0.014763941 -0.206993159 [21] 0.055189955 0.030740646 0.064430700 -0.125235723 -0.082733092 [26] -0.014880197 0.120024083 -0.015338995 0.019928515 0.012432902 [31] -0.097307577 0.114752919 -0.050933227 0.038645937 -0.129912064 [36] 0.069612953 -0.041358933 -0.005804077 0.053266263 0.007973630 [41] -0.025289059 0.002213669 0.109012164 -0.019692362 0.066058826 [46] -0.029997861 0.045569690 0.055695209 -0.058509858 > (mypacf <- c(rpacf$acf)) [1] -0.1069766477 -0.1897237661 0.0431394533 0.1610229287 0.1125817712 [6] 0.0901420119 -0.0139626096 -0.1915756511 -0.0670193979 -0.0854179991 [11] 0.2255046046 -0.1756335758 -0.0859356928 -0.1039759047 -0.3010389053 [16] -0.0997501096 0.1306687459 0.1568347863 0.0002020723 -0.0618958296 [21] -0.1424753610 -0.0682202620 -0.0801531991 -0.0435135762 -0.0621941776 [26] 0.1607479065 -0.1152447449 -0.0555773804 -0.0163912701 -0.1175974352 [31] -0.0040909773 -0.0962318378 0.0676534417 -0.1563731891 0.0046418201 [36] -0.1300102575 -0.1567834354 0.0289129590 -0.0287304681 -0.0332426126 [41] 0.2019819937 -0.0011323361 -0.0142115350 -0.0625767348 -0.0843327092 [46] -0.0873397228 0.0384190305 -0.0599750463 > 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/3ttib1292324011.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/4xcgz1292324011.tab") > > try(system("convert tmp/1qb1n1292324011.ps tmp/1qb1n1292324011.png",intern=TRUE)) character(0) > try(system("convert tmp/2qb1n1292324011.ps tmp/2qb1n1292324011.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.596 0.319 1.247