R version 2.7.0 (2008-04-22) 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(108.9,110.5,111.0,110.7,110.0,111.4,107.7,110.4,110.5,106.4,107.5,108.8,107.1,107.9,107.2,106.3,106.7,105.4,109.4,106.7,105.2,107.0,105.4,106.1,105.8,104.2,102.7,102.7,104.9,102.3,104.0,101.2,102.2,101.4,101.1,97.2,99.7,99.4,98.0,103.1,99.4,100.8,96.4,99.7,100.9,101.3,102.6,105.6,107.2,104.0,108.7,104.9,105.3,105.0,106.1,103.7,102.1,97.2,99.5,102.9) > par5 = '12' > par4 = '0' > par3 = '0' > 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/158641228829526.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/2cktv1228829526.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.8028276274 0.7506852361 0.6516742142 0.5728114909 [6] 0.5081249682 0.4464999182 0.3917355460 0.3006411334 0.2737466808 [11] 0.2180564970 0.2402381137 0.1489099453 0.1570754209 0.1347014002 [16] 0.1243414341 0.0987581639 0.0334609587 0.0001326536 -0.0530752653 [21] -0.0350805274 -0.0761680693 -0.0989316831 -0.1358872347 -0.2113338211 [26] -0.2129749614 -0.2174445863 -0.2561346910 -0.2689174275 -0.2731237412 [31] -0.3007463300 -0.3005254837 -0.2924797648 -0.3382646869 -0.3347060062 [36] -0.3344889984 -0.2809499317 -0.2729813638 -0.2604566671 -0.2351909313 [41] -0.2041135406 -0.1769297783 -0.1270087461 -0.0735249517 -0.0694093256 [46] -0.0266621809 -0.0135659531 -0.0012105279 -0.0109624985 -0.0413414108 [51] -0.0650243109 -0.0784081339 -0.0929008581 -0.1046334204 -0.1146156923 [56] -0.1226496146 -0.1123384980 -0.0838807853 -0.0368922571 -0.0084867460 > (mypacf <- c(rpacf$acf)) [1] 0.802827627 0.298629121 -0.033262385 -0.037533592 0.015458041 [6] 0.001057750 -0.009756698 -0.136412640 0.069051797 -0.001267376 [11] 0.167530587 -0.225496380 0.078680846 0.055764382 0.027275815 [16] -0.104768205 -0.173409820 -0.025147610 0.038516122 0.093206373 [21] -0.080981705 -0.136856667 0.061824986 -0.211032993 0.076082045 [26] 0.034805758 -0.151463325 0.051242407 -0.010398475 -0.055170150 [31] -0.062877442 0.070858214 -0.163995981 -0.021060842 0.122882941 [36] 0.033573168 -0.041078330 0.025338690 0.007465434 0.106057393 [41] -0.065987151 0.055130357 0.002054019 0.100495127 -0.008336327 [46] -0.093177149 -0.019542514 -0.055219757 -0.123494906 -0.024755428 [51] -0.095838167 -0.030978869 0.047085544 -0.044889326 -0.045026752 [56] 0.050687557 0.028899077 0.016191372 0.055676517 > 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/3wcu31228829526.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/4rgw91228829526.tab") > > system("convert tmp/158641228829526.ps tmp/158641228829526.png") > system("convert tmp/2cktv1228829526.ps tmp/2cktv1228829526.png") > > > proc.time() user system elapsed 1.575 0.585 1.664