R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(65.1,72.5,70.6,81.9,72,70.9,71.1,65.1,78.1,92,77.8,63.3,56.2,79.2,69,66.1,77.5,69.3,70.2,70.2,78.2,85.4,82.4,61.2,52.2,85.3,79.9,72.2,85.7,75.5,69.2,77.6,85.3,77,89.9,60,54.3,84,69.9,75.1,81.7,69.9,68.3,77.3,77.4,85.3,91,60.6,57.6,93.8,78.7,80.3,89.8,77.5,71.7,83.2,86.2,100.7,100.8,57.1) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1.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: Write here your technical program description (don't use hard returns!) > 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 (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/freestat/rcomp/tmp/1wn8s1229693344.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2izzz1229693345.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.000000000 0.141618328 0.135883048 0.438582652 0.031659503 [6] 0.087533061 0.192393903 -0.070281604 -0.021416261 0.036108380 [11] -0.223055359 -0.222122684 -0.186964792 -0.237445698 -0.245021448 [16] -0.119970971 -0.210025077 -0.133765474 0.091164731 -0.112404841 [21] -0.001689563 0.174042903 -0.001787892 0.282358475 0.060304400 [26] 0.044347264 0.279342920 0.060714644 0.008573505 0.185788306 [31] 0.034096635 0.016383508 0.061673670 -0.110803890 -0.138634391 [36] -0.092274080 -0.069177025 -0.130803747 -0.069351961 -0.034025109 [41] -0.091410173 -0.079070795 -0.108694100 -0.110786104 0.030023600 [46] -0.045821708 -0.056580457 0.030791767 > (mypacf <- c(rpacf$acf)) [1] 0.141618328 0.118197844 0.419014881 -0.087471050 0.009012851 [6] 0.005997525 -0.094031214 -0.072565172 -0.026795730 -0.181062467 [11] -0.207467030 -0.178234289 -0.027255139 -0.076344049 0.074246533 [16] -0.045790893 0.059332426 0.220960659 0.019894911 0.056035744 [21] 0.053695533 -0.037284351 0.230182602 -0.294916429 -0.042606878 [26] -0.060518622 -0.060536659 -0.091401025 0.034302661 0.091459552 [31] 0.112769805 0.035335132 0.058561122 -0.094726792 -0.031460955 [36] -0.010658641 0.058665285 -0.051800609 -0.005310219 -0.002904292 [41] -0.147572542 -0.054639438 -0.058894779 -0.045193351 0.030324485 [46] -0.141989064 0.049998018 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/34j3g1229693345.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/freestat/rcomp/tmp/4p85h1229693345.tab") > > system("convert tmp/1wn8s1229693344.ps tmp/1wn8s1229693344.png") > system("convert tmp/2izzz1229693345.ps tmp/2izzz1229693345.png") > > > proc.time() user system elapsed 0.810 0.434 0.904