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(101.0,98.7,105.1,98.4,101.7,102.9,92.2,94.9,92.8,98.5,94.3,87.4,103.4,101.2,109.6,111.9,108.9,105.6,107.8,97.5,102.4,105.6,99.8,96.2,113.1,107.4,116.8,112.9,105.3,109.3,107.9,101.1,114.7,116.2,108.4,113.4,108.7,112.6,124.2,114.9,110.5,121.5,118.1,111.7,132.7,119.0,116.7,120.1,113.4,106.6,116.3,112.6,111.6,125.1,110.7,109.6,114.2,113.4,116.0,109.6,117.8,115.8,125.3,113.0,120.5,116.6,111.8,115.2,118.6,122.4,116.4,114.5,119.8,115.8,127.8,118.8,119.7,118.6,120.8,115.9,109.7,114.8,116.2,112.2) > par7 = '' > par6 = 'White Noise' > 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/rcomp/tmp/1cik51261344105.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/2ev6q1261344105.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.459391839 -0.020466414 0.164824941 -0.183047881 [6] -0.067197646 0.100224333 0.000598593 -0.189806136 0.399901209 [11] -0.319117839 0.271188763 -0.181147984 -0.171881475 0.222379066 [16] -0.094720385 -0.070686445 0.154388182 0.001305975 -0.255708544 [21] 0.376989038 -0.199708309 -0.079166171 0.183370263 -0.147899661 [26] -0.019238818 0.131572306 -0.049545684 -0.056234089 0.188402417 [31] -0.152026948 0.088098562 0.003847751 -0.135807053 0.068540701 [36] 0.040896357 -0.129852503 0.165992486 -0.043264858 -0.115419454 [41] 0.164829850 -0.155038271 0.004886501 0.071279880 0.017022985 [46] -0.064787905 0.120162467 -0.082049722 -0.028493648 0.077107190 [51] -0.097658431 0.052201632 -0.017882738 0.035775423 0.014881750 [56] -0.023434022 -0.011209982 0.017137678 -0.018063879 -0.010381564 [61] 0.043344949 > (mypacf <- c(rpacf$acf)) [1] -0.4593918385 -0.2934337963 0.0247741755 -0.1118973207 -0.2463422081 [6] -0.1474171645 -0.0119079185 -0.2610677853 0.1997283215 -0.1180698598 [11] 0.3050749784 -0.1491098473 -0.2611631025 -0.0325668839 0.0082847433 [16] -0.1630566987 0.0468202500 -0.1627537830 -0.1608273987 -0.0618665811 [21] 0.0358564520 -0.0104396821 0.0264545097 -0.1051415251 -0.1703774265 [26] -0.1015707712 0.0371292873 -0.0114775962 0.0547466277 0.0402239929 [31] -0.0154502932 0.0005133928 0.0616303596 -0.0437391892 0.0913768404 [36] -0.1132391281 0.0024797954 -0.1374312004 0.0084568160 -0.0459612362 [41] -0.1196172036 -0.0463953802 -0.0279936968 0.0383013938 0.1479479376 [46] -0.0506429735 0.0598591830 -0.0344132077 -0.0337334341 0.0670578955 [51] -0.0216222849 -0.0583625793 -0.0278929236 -0.0244597251 -0.0467923043 [56] 0.0598091544 0.0086027567 -0.0172670745 -0.0262656785 -0.0447858786 > 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/3rbfm1261344105.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/4lqxa1261344105.tab") > try(system("convert tmp/1cik51261344105.ps tmp/1cik51261344105.png",intern=TRUE)) character(0) > try(system("convert tmp/2ev6q1261344105.ps tmp/2ev6q1261344105.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.579 0.320 0.705