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(2490,3266,3475,3127,2955,3870,2852,3142,3029,3180,2560,2733,2452,2553,2777,2520,2318,2873,2311,2395,2099,2268,2316,2181,2175,2627,2578,3090,2634,3225,2938,3174,3350,2588,2061,2691,2061,2918,2223,2651,2379,3146,2883,2768,3258,2839,2470,5072,1463,1600,2203,2013,2169,2640,2411,2528,2292,1988,1774,2279) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.4' > 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/10def1229949232.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/2oxpx1229949232.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.303786824 0.285872943 0.248518548 0.064398411 [6] -0.038674593 0.078036585 -0.126520536 0.029414756 -0.018382576 [11] 0.084047421 -0.207565385 0.047105974 -0.075900990 0.004866016 [16] 0.044281009 -0.045652460 -0.166019058 -0.043376189 -0.201739862 [21] -0.051567163 -0.129638284 -0.021051687 -0.034657453 0.070373437 [26] 0.043927439 0.035373181 0.011837876 0.097285992 -0.002311479 [31] 0.114011657 -0.056729245 0.011071289 0.050138409 0.056093496 [36] 0.043545859 0.142571545 0.069162737 0.130989826 0.080570787 [41] 0.034792444 -0.042534907 0.040855597 -0.099813127 -0.109930426 [46] -0.064833994 -0.111980372 -0.197327845 -0.117516803 -0.117224448 [51] -0.105937526 -0.082487476 -0.076544771 -0.096513592 -0.074296441 [56] -0.077583538 -0.077421138 -0.046727033 -0.006060405 0.001590747 > (mypacf <- c(rpacf$acf)) [1] 0.303786824 0.213268278 0.133198862 -0.094316547 -0.139293181 [6] 0.105764921 -0.134704884 0.109862364 -0.028942524 0.138642460 [11] -0.336788434 0.160859821 -0.067644113 0.146478587 0.012420215 [16] -0.176574863 -0.091834005 -0.132373180 0.057247566 0.033816001 [21] 0.041923635 -0.074039418 0.012740312 0.011124736 0.093347198 [26] 0.015932170 -0.027524473 0.017593402 -0.053372737 0.076060968 [31] -0.094297653 0.064894242 0.051147947 0.043083654 0.010132076 [36] 0.074767220 0.017676073 -0.018640280 0.042298140 -0.118197938 [41] 0.078545958 -0.040236759 -0.057139882 -0.102210185 0.039133900 [46] -0.013856084 -0.121945320 -0.087588182 0.043320219 -0.008396823 [51] -0.058399508 -0.039538570 -0.010575593 -0.062471579 0.002365210 [56] 0.033824111 0.026931311 -0.005902310 -0.045593176 > 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/31beb1229949233.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/4q3gj1229949233.tab") > > system("convert tmp/10def1229949232.ps tmp/10def1229949232.png") > system("convert tmp/2oxpx1229949232.ps tmp/2oxpx1229949232.png") > > > proc.time() user system elapsed 0.596 0.315 0.704