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(112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140,145,150,178,163,172,178,199,199,184,162,146,166,171,180,193,181,183,218,230,242,209,191,172,194,196,196,236,235,229,243,264,272,237,211,180,201,204,188,235,227,234,264,302,293,259,229,203,229,242,233,267,269,270,315,364,347,312,274,237,278,284,277,317,313,318,374,413,405,355,306,271,306,315,301,356,348,355,422,465,467,404,347,305,336,340,318,362,348,363,435,491,505,404,359,310,337,360,342,406,396,420,472,548,559,463,407,362,405,417,391,419,461,472,535,622,606,508,461,390,432) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.0' > 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/1c6k81260995433.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/23bfl1260995433.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.3411237983 0.1050467496 -0.2021386642 0.0213592288 [6] 0.0556543435 0.0308036696 -0.0555785695 -0.0007606578 0.1763686815 [11] -0.0763581912 0.0643839399 -0.3866128596 0.1516020121 -0.0576067980 [16] 0.1495652202 -0.1389421819 0.0704823385 0.0156307241 -0.0106106130 [21] -0.1167285978 0.0385542023 -0.0913645276 0.2232689055 -0.0184181674 [26] -0.1002881161 0.0485657567 -0.0302396339 0.0471343505 -0.0180304684 [31] -0.0510696473 -0.0537672361 0.1957284827 -0.1224193885 0.0777498102 [36] -0.1524548378 -0.0099950101 0.0469202805 0.0312375443 -0.0150867473 [41] -0.0341315285 -0.0655933853 0.0950573679 -0.0896620926 0.0288258081 [46] -0.0368860804 -0.0421346581 0.1081915971 -0.0501473118 0.1050148119 [51] -0.0171246719 -0.0317121520 0.0738819772 0.0442953912 -0.0947628881 [56] 0.1559178185 -0.1057542879 0.0480259491 0.1040924614 -0.1001502332 [61] 0.0734029228 > (mypacf <- c(rpacf$acf)) [1] -0.341123798 -0.012809250 -0.192662435 -0.125028366 0.033089658 [6] 0.034677379 -0.060186934 -0.020223154 0.225576717 0.043070773 [11] 0.046588236 -0.338694805 -0.109178652 -0.076839449 -0.021750781 [16] -0.139545243 0.025891863 0.114821992 -0.013162286 -0.167430139 [21] 0.132403960 -0.072038705 0.142854473 -0.067331874 -0.102667592 [26] -0.010065593 0.043783534 -0.089951024 0.046904263 -0.004895487 [31] -0.096380590 -0.015278257 0.011500315 -0.019159019 0.023034543 [36] -0.164879721 -0.033997008 0.008681692 0.045131155 -0.076487744 [41] -0.174763796 0.073564439 -0.102615821 -0.060515631 -0.026869135 [46] -0.122720060 -0.013210672 -0.049295162 0.088215008 0.126404993 [51] 0.010929074 0.106488712 0.056543778 0.050950935 0.015776911 [56] -0.044823727 -0.065795495 0.135338827 -0.014362870 -0.004982551 > 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/31t8z1260995433.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/4cd9z1260995433.tab") > > try(system("convert tmp/1c6k81260995433.ps tmp/1c6k81260995433.png",intern=TRUE)) character(0) > try(system("convert tmp/23bfl1260995433.ps tmp/23bfl1260995433.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.604 0.334 3.446