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(2175,2197,2350,2440,2409,2473,2408,2455,2448,2498,2646,2757,2849,2921,2982,3081,3106,3119,3061,3097,3162,3257,3277,3295,3364,3494,3667,3813,3918,3896,3801,3570,3702,3862,3970,4139,4200,4291,4444,4503,4357,4591,4697,4621,4563,4203,4296,4435,4105,4117,3844,3721,3674,3858,3801,3504,3033,3047,2962,2198,2014) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1j2p11229794520.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/2jbv81229794520.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.00000000 0.28898202 0.06499194 0.22780232 0.18938995 0.22076188 [7] 0.08244885 0.05394319 0.16657229 0.12445734 0.06014171 0.25932845 [13] 0.04433815 -0.02673750 0.18967940 0.05178145 0.03686982 -0.06894505 [19] -0.15490019 0.02168547 -0.03305732 -0.10431924 -0.11234985 -0.09933918 [25] -0.09304017 0.03227118 -0.03182749 -0.04208130 0.02722353 -0.03682601 [31] -0.05023423 -0.07493729 -0.06830511 -0.11512755 -0.10477198 -0.12910656 [37] -0.04009523 > (mypacf <- c(rpacf$acf)) [1] 0.288982024 -0.020206097 0.234119591 0.068476857 0.176748965 [6] -0.070492128 0.019318124 0.073071579 0.028603491 -0.007914304 [11] 0.248021808 -0.170032608 -0.020120441 0.116305283 -0.076912274 [16] -0.007435785 -0.133873902 -0.141266041 -0.001854418 -0.046565338 [21] 0.002968707 -0.146990685 0.017038993 -0.048822626 0.078715744 [26] 0.053479822 0.071608181 0.057119763 0.056414220 -0.107596554 [31] 0.018813942 0.013697435 -0.100878679 -0.028734511 -0.126103043 [36] 0.029858892 > 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/3tp381229794520.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/4jece1229794520.tab") > > system("convert tmp/1j2p11229794520.ps tmp/1j2p11229794520.png") > system("convert tmp/2jbv81229794520.ps tmp/2jbv81229794520.png") > > > proc.time() user system elapsed 0.556 0.324 0.694