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 = '1' > 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/1vv6t1229854627.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/25nzk1229854627.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.000000e+00 -3.166481e-01 1.903175e-01 8.747969e-02 -2.932612e-02 [6] 7.620033e-02 -7.191874e-02 -1.764530e-01 -5.234479e-02 -4.345918e-02 [11] -2.293435e-01 1.805672e-01 -4.266670e-01 1.128044e-01 -2.853507e-03 [16] -1.001220e-02 1.263424e-02 6.757019e-02 1.702227e-01 3.282435e-02 [21] 3.203353e-02 1.360643e-01 -4.076389e-02 1.555222e-01 -8.288076e-02 [26] -1.386413e-02 7.818845e-03 -9.057793e-02 9.220362e-03 -4.317948e-02 [31] -1.974044e-01 6.405615e-02 7.036626e-02 -2.221026e-01 1.854050e-01 [36] -1.368963e-01 1.052304e-01 7.978194e-03 4.153797e-03 3.121941e-02 [41] 4.908868e-03 -1.375761e-02 7.482706e-02 -3.444570e-02 -7.222095e-02 [46] 8.968638e-02 -7.362929e-02 2.572778e-02 -4.091167e-02 2.840184e-03 [51] 1.153595e-04 -5.389558e-03 -9.905289e-03 6.133701e-05 3.755887e-04 [56] -5.980280e-04 -1.782075e-04 -1.018725e-03 5.551941e-04 -3.620781e-05 > (mypacf <- c(rpacf$acf)) [1] -0.316648087 0.100086847 0.194678339 0.034242637 0.030074390 [6] -0.070430083 -0.272882730 -0.222209074 -0.037029932 -0.184094765 [11] 0.150913568 -0.295596468 -0.176761432 -0.025234784 0.066028679 [16] -0.051199341 0.024826799 0.206610993 -0.024439098 -0.196180732 [21] 0.125377069 -0.131383977 0.244203412 -0.070411126 -0.027724528 [26] 0.005305403 -0.003510041 0.025105176 0.053877177 -0.027506268 [31] 0.054996932 0.036324395 -0.015275183 -0.074449984 0.088937114 [36] -0.039483108 -0.082713434 0.052888459 -0.031660037 -0.104061662 [41] -0.043038948 -0.012984465 -0.012960101 -0.030404828 -0.006173587 [46] -0.088201395 0.028428298 0.032264837 -0.133265511 0.017254165 [51] 0.049158602 -0.090021687 -0.039830612 0.023193733 -0.058577799 [56] -0.002544691 -0.013454156 0.028274392 -0.016511617 > 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/3if4w1229854627.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/4l8cc1229854627.tab") > > system("convert tmp/1vv6t1229854627.ps tmp/1vv6t1229854627.png") > system("convert tmp/25nzk1229854627.ps tmp/25nzk1229854627.png") > > > proc.time() user system elapsed 0.582 0.326 0.702