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(101.02,100.67,100.47,100.38,100.33,100.34,100.37,100.39,100.21,100.21,100.22,100.28,100.25,100.25,100.21,100.16,100.18,100.1,99.96,99.88,99.88,99.86,99.84,99.8,99.82,99.81,99.92,100.03,99.99,100.02,100.01,100.13,100.33,100.13,99.96,100.05,99.83,99.8,100.01,100.1,100.13,100.16,100.41,101.34,101.65,101.85,102.07,102.12,102.14,102.21,102.28,102.19,102.33,102.54,102.44,102.78,102.9,103.08,102.77,102.65,102.71,103.29,102.86,103.45,103.72,103.65,103.83,104.45,105.14,105.07,105.31,105.19,105.3,105.02,105.17,105.28,105.45,105.38,105.8,105.96,105.08,105.11,105.61,105.5) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > 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/12qsk1228839344.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/2jzry1228839344.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.0016270692 0.0314320734 0.0582120689 0.2221612174 [6] -0.0851666025 -0.1243057031 0.1803812322 -0.0623951381 -0.2228136759 [11] -0.2067090084 0.1070460862 -0.3968454990 -0.1261394731 -0.0250994538 [16] 0.1015695931 -0.1293616331 -0.0164597929 0.2549414192 -0.0790099762 [21] -0.0026175160 0.1655828634 0.1743100869 0.0061303793 0.0440343367 [26] 0.1786061413 0.0659398072 -0.1388573514 -0.0321029725 0.0685397509 [31] -0.0653961451 -0.0206547720 -0.0254007890 -0.0013119427 -0.0983717366 [36] -0.0611230724 -0.0006128072 -0.0952685513 -0.0656592521 0.0886508079 [41] 0.0200943067 -0.0103973106 -0.0570392569 0.0157785199 0.0180819734 [46] -0.0646545627 0.0050329138 0.0412945508 -0.0271561683 -0.0906179609 [51] 0.0193447061 -0.0148213273 0.0101466386 -0.0398440392 0.0237581047 [56] 0.0256619732 0.0041549686 0.0423808502 0.0242274819 -0.0225053684 [61] -0.0568553351 > (mypacf <- c(rpacf$acf)) [1] 0.0016270692 0.0314295093 0.0581690102 0.2220668423 -0.0907010804 [6] -0.1497896694 0.1737103184 -0.1019190287 -0.2099331563 -0.1782636646 [11] 0.0521893551 -0.3824649344 -0.0110876734 0.0181061640 0.0409689552 [16] 0.0522713799 0.0547829623 0.1269382447 -0.0894524779 -0.0094316184 [21] 0.0886573348 -0.1346930836 0.1008203098 -0.0453348232 0.0432740309 [26] 0.0768696952 -0.0176232801 -0.0645260111 -0.0060012269 0.1333892870 [31] 0.0416638841 -0.0504147719 0.0815909799 -0.0112641253 0.0306659449 [36] -0.0791060777 -0.0568947092 -0.0726122277 0.0713045071 0.0008787555 [41] -0.0207058528 -0.0283308186 -0.0140818916 -0.0265814800 -0.0315703606 [46] -0.1101382609 -0.0159384176 -0.0980710070 -0.1135981189 -0.0045969946 [51] -0.0246299374 0.0308174295 0.0543261180 -0.0715386243 0.0070995814 [56] 0.0013437885 0.0105012336 -0.0072524837 -0.0899545222 -0.0958687791 > 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/3y8w91228839344.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/4uo301228839344.tab") > > system("convert tmp/12qsk1228839344.ps tmp/12qsk1228839344.png") > system("convert tmp/2jzry1228839344.ps tmp/2jzry1228839344.png") > > > proc.time() user system elapsed 0.839 0.435 0.977