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(14620,16005,16683,15487,15684,15962,12000,13769,14031,16078,15827,13149,15969,16628,16670,16487,16883,16201,12168,14010,16556,17404,16435,13123,16744,17410,16484,17103,17301,17301,12843,13748,16904,17342,15476,15424,15988,19244,18715,17780,17160,17349,11171,13438,16713,18369,17067,14055,15500,18475,19423,18686,19646,19733,12605,16616,19156,21348,20049,18020,20262,21789,20603,21928,21025,19346,11786,19082,20127,20217,20385,16653,13065,20275,21776,20260,22523,23033,14133,20110,19682,22197,17212,11784,15467,17002,15952,18767,20605,19809,14233,19311,20827,23388,20181,14344) > 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/freestat/rcomp/tmp/12w9b1243888303.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/2kop21243888303.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.4480574564 0.1052671938 0.0943997129 0.1993636456 [6] 0.2794858397 0.2823890485 0.2298414719 0.1117879820 -0.0830249042 [11] -0.0325408479 0.2844423622 0.6366364118 0.2649218957 0.0499562714 [16] -0.0005266156 0.1281037513 0.2736764251 0.2386078690 0.1549798620 [21] 0.0492701294 -0.1267084915 -0.1279842359 0.1519725745 0.4149361423 [26] 0.1095833197 -0.0894952387 -0.1388384816 0.0162565278 0.1219651323 [31] 0.0879776268 0.0686648030 -0.0198919826 -0.1633225221 -0.1811937510 [36] 0.0395755691 0.2567737059 -0.0095846047 -0.1390678443 -0.1407385414 [41] -0.0328808506 0.0341545329 -0.0062435829 -0.0147317578 -0.1188186065 [46] -0.2651568908 -0.2605669746 -0.0873204084 0.0552667159 > (mypacf <- c(rpacf$acf)) [1] 4.480575e-01 -1.194732e-01 1.207482e-01 1.487759e-01 1.625078e-01 [6] 1.291674e-01 8.307082e-02 -3.991292e-02 -2.184333e-01 -4.803271e-05 [11] 2.785721e-01 5.538551e-01 -2.368440e-01 4.308118e-02 -2.222324e-01 [16] 7.768851e-02 7.205635e-02 -6.468041e-02 -5.758725e-02 -5.936227e-03 [21] 6.026832e-02 -1.571301e-01 6.975339e-02 -1.546116e-02 -5.513608e-02 [26] -6.417055e-02 -5.175508e-02 -7.416088e-03 -1.364121e-01 1.718642e-02 [31] 1.958877e-04 7.243845e-02 5.637210e-02 -9.209479e-02 -7.704980e-02 [36] 1.661634e-02 -8.072905e-02 9.283170e-02 1.068071e-01 -3.523346e-02 [41] -2.944526e-02 -7.387988e-02 -2.924355e-02 -1.472218e-01 -8.578531e-02 [46] -1.328334e-02 -2.556085e-02 -1.537624e-02 > 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/39uo71243888303.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/4g0ze1243888303.tab") > > system("convert tmp/12w9b1243888303.ps tmp/12w9b1243888303.png") > system("convert tmp/2kop21243888303.ps tmp/2kop21243888303.png") > > > proc.time() user system elapsed 0.793 0.414 0.920