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(11.9,13.6,15.2,12.5,14.9,13.7,12.5,13.1,14.5,15.2,16.1,14.8,15.1,14.8,16.1,14.3,15.2,14.9,13.1,12.6,13.6,14.4,14,12.9,13.4,13.5,14.8,14.3,14.3,14,13.2,12.2,14.3,15.7,14.2,14.6,14.5,14.3,15.3,14.4,13.7,14.2,13.5,11.9,14.6,15.6,14.1,14.9,14.2,14.6,17.2,15.4,14.3,17.5,14.5,14.4,16.6,16.7,16.6,16.9,15.7,16.4,18.4,16.9,16.5,18.3,15.1,15.7,18.1,16.8,18.9,19,18.1,17.8,21.5,17.1,18.7,19,16.4,16.9,18.6,19.3,19.4,17.6,18.6,18.1,20.4,18.1,19.6,19.9,19.2,17.8,19.2,22.1,21.2,19.5) > par5 = '12' > par4 = '0' > 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: 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/rcomp/tmp/1c0wq1228602485.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/rcomp/tmp/27d2x1228602485.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.762028421 0.683194348 0.710060705 0.630845755 [6] 0.632315882 0.670621723 0.561800560 0.539506790 0.547901477 [11] 0.448015692 0.504674814 0.610703335 0.466165174 0.416288567 [16] 0.427756583 0.378162794 0.405069810 0.433435760 0.358112100 [21] 0.335793218 0.321748410 0.223341291 0.281028843 0.293087608 [26] 0.176727818 0.107360080 0.088815893 0.055266202 0.069086452 [31] 0.058743990 0.017716062 -0.006754151 -0.044190349 -0.085439509 [36] -0.048093336 -0.015076732 -0.076770711 -0.146069688 -0.153413560 [41] -0.160794504 -0.164687756 -0.173200570 -0.195792703 -0.224287544 [46] -0.253517831 -0.275197532 -0.275980383 -0.224770143 > (mypacf <- c(rpacf$acf)) [1] 0.7620284210 0.2444644236 0.3308274575 -0.0271317297 0.1726521543 [6] 0.1772726509 -0.1625866832 0.0156410881 0.0084791968 -0.1433472091 [11] 0.2110460689 0.3217068232 -0.2582209700 -0.1601457245 -0.0189651277 [16] 0.0836074716 0.0119563466 0.0164342768 0.0318336292 -0.0986951881 [21] -0.0562328868 -0.0759171430 0.0762571198 -0.1739606599 -0.1094411827 [26] -0.1493991905 0.0004573954 0.0633847870 -0.0200375383 -0.0613876185 [31] 0.0429102432 -0.0436867975 -0.0489186253 0.0452211739 -0.0470954782 [36] 0.0918784459 -0.0303351843 -0.0632111352 0.0058377442 -0.0244273401 [41] -0.0477973732 -0.0390475003 0.0303497199 0.0137321508 0.0294487238 [46] -0.0102099666 -0.0583145141 0.0513229688 > 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/3enbl1228602486.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/4r62l1228602486.tab") > > system("convert tmp/1c0wq1228602485.ps tmp/1c0wq1228602485.png") > system("convert tmp/27d2x1228602485.ps tmp/27d2x1228602485.png") > > > proc.time() user system elapsed 0.576 0.325 0.802