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(492865,480961,461935,456608,441977,439148,488180,520564,501492,485025,464196,460170,467037,460070,447988,442867,436087,431328,484015,509673,512927,502831,470984,471067,476049,474605,470439,461251,454724,455626,516847,525192,522975,518585,509239,512238,519164,517009,509933,509127,500857,506971,569323,579714,577992,565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799) > par5 = '12' > par4 = '0' > 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/1o5rc1229597126.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/2p8ux1229597126.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.289551286 -0.173301946 -0.330196590 -0.340578865 [6] 0.012819070 0.161510409 0.030243282 -0.279875820 -0.231012656 [11] -0.153312356 0.253488595 0.764695595 0.211812700 -0.104057885 [16] -0.270176336 -0.301303468 -0.005084994 0.135868139 0.011767003 [21] -0.231565200 -0.218447844 -0.126596195 0.246316627 0.601851395 [26] 0.110463170 -0.118560426 -0.187114638 -0.220583835 0.014941378 [31] 0.083801954 -0.022337613 -0.189977795 -0.177363650 -0.098841650 [36] 0.196674282 0.451431681 0.090077744 -0.076654018 -0.175271242 [41] -0.178684871 0.010467204 0.059554328 -0.002504959 -0.149330603 [46] -0.129043738 -0.061212867 0.159158132 0.287069621 0.066600981 [51] -0.031029847 -0.098474986 -0.107816707 -0.030143310 0.012707876 [56] -0.004865113 -0.052064059 -0.051364252 -0.037323534 0.097059507 [61] 0.148698234 > (mypacf <- c(rpacf$acf)) [1] 0.2895512863 -0.2806735494 -0.2187986672 -0.2608813331 0.0898534853 [6] -0.0495032542 -0.1596574004 -0.3997697620 -0.1054612544 -0.3427601593 [11] 0.1142834599 0.5785754384 -0.1958723686 0.1988208952 0.1379418181 [16] 0.0519730818 0.0407834967 0.0513182761 -0.0117972249 -0.0004088438 [21] -0.1793608144 0.0844657085 -0.0581273256 -0.0473535119 -0.2058406177 [26] -0.0986346020 0.0851883424 -0.0893457809 -0.0688423489 -0.0512518965 [31] -0.0030932006 -0.0058881414 -0.0194296704 -0.0322575385 -0.0418427829 [36] -0.0952522133 0.1333892366 -0.0515409513 -0.1473012456 0.0477701032 [41] -0.1297357060 -0.0331427807 0.0165220542 -0.0765589367 0.0686987845 [46] -0.0526041274 -0.0256726574 -0.0651590562 0.0318075236 -0.0022083046 [51] 0.0206361287 0.0142724029 -0.0109100186 -0.0517457034 0.0192683062 [56] 0.1166421630 0.0052604917 -0.0087031651 0.0209364405 -0.0277610096 > 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/31p1r1229597126.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/4cfo31229597127.tab") > > system("convert tmp/1o5rc1229597126.ps tmp/1o5rc1229597126.png") > system("convert tmp/2p8ux1229597126.ps tmp/2p8ux1229597126.png") > > > proc.time() user system elapsed 0.611 0.314 1.092