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(655362,873127,1107897,1555964,1671159,1493308,2957796,2638691,1305669,1280496,921901,867888,652586,913831,1108544,1555827,1699283,1509458,3268975,2425016,1312703,1365498,934453,775019,651142,843192,1146766,1652601,1465906,1652734,2922334,2702805,1458956,1410363,1019279,936574,708917,885295,1099663,1576220,1487870,1488635,2882530,2677026,1404398,1344370,936865,872705,628151,953712,1160384,1400618,1661511,1495347,2918786,2775677,1407026,1370199,964526,850851,683118,847224,1073256,1514326,1503734,1507712,2865698,2788128,1391596,1366378,946295,859626) > 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/1n5rd1229802946.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/29fkg1229802946.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.580323404 0.169291732 -0.022644676 -0.334883714 [6] -0.557729125 -0.653629456 -0.526616335 -0.269955091 0.004388280 [11] 0.170258497 0.505957590 0.823558482 0.491206290 0.149716032 [16] -0.009742349 -0.271983740 -0.452440751 -0.533286980 -0.427058440 [21] -0.217796214 -0.009846197 0.130729357 0.390947362 0.649498750 [26] 0.407761383 0.116829648 -0.003017681 -0.199176733 -0.353610385 [31] -0.413491281 -0.333684196 -0.174910069 -0.009182589 0.101316669 [36] 0.282385190 0.493588342 0.314247283 0.090933774 0.002028894 [41] -0.150153852 -0.258134833 -0.300890431 -0.239205443 -0.127352032 [46] -0.004299554 0.073395327 0.188673839 0.335012495 0.209552749 [51] 0.058273970 0.005979091 -0.108051442 -0.165993861 -0.178873019 [56] -0.139669856 -0.054802662 0.003670926 0.041755015 0.105578065 [61] 0.164433341 > (mypacf <- c(rpacf$acf)) [1] 0.580323404 -0.252529059 0.001369621 -0.444964321 -0.239114028 [6] -0.455135091 -0.155907868 -0.296481624 -0.137954712 -0.570015424 [11] 0.242590971 0.244485680 -0.384684228 -0.140457619 -0.111465155 [16] -0.001188811 0.001881863 0.013329064 0.010644396 -0.109556162 [21] 0.017348344 -0.002071672 -0.029062107 0.029294054 0.016374925 [26] -0.110982891 0.007431341 0.007800356 -0.017509521 0.021914041 [31] -0.026430865 -0.014440202 0.037831780 0.027565189 -0.046318416 [36] 0.001611697 -0.064318291 0.107134436 -0.118181186 0.035376049 [41] -0.025095873 0.023118548 0.022695620 0.015336673 0.021696511 [46] 0.030235387 0.001842400 -0.082263795 0.002852116 -0.007844119 [51] 0.010459847 -0.114010456 0.012945806 0.003390830 -0.013940544 [56] 0.123238106 -0.094934141 0.084009620 -0.010661062 -0.082777822 > 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/31v381229802946.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/43frz1229802946.tab") > > system("convert tmp/1n5rd1229802946.ps tmp/1n5rd1229802946.png") > system("convert tmp/29fkg1229802946.ps tmp/29fkg1229802946.png") > > > proc.time() user system elapsed 0.585 0.314 0.704