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(1721,1476,1842,2171,1670,1540,1266,897,1266,1519,1074,1435,1385,1440,1883,1822,1661,1774,1133,1361,1688,2216,2896,1382,1330,1419,1662,2040,2126,1649,1610,1952,2102,1749,2091,3036,2414,2097,2705,2431,4192,3990,2854,1966,2431,2763,2831,2023,2934,2489,3252,3018,3193,3976,2584,2512,2169,2504,1843,1408,2179,3690,2372,2494,3872,2786,2312,1599,3167,3433,2648,1978,1947,3113,2856,3174,3507,4174,2978,4428,2832,2930,3681,3253,1660,2208,3139,3409,3445,2410,3262,2897,2526,3982,4097,3403,3362,2708,3129,3550,2696,2885,2945,3600,3808,3671,4005) > 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/freestat/rcomp/tmp/1y9xq1229540220.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/freestat/rcomp/tmp/2x28s1229540220.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.652644547 0.473626313 0.459657419 0.478270578 [6] 0.461754289 0.395766541 0.379803465 0.403217008 0.354766778 [11] 0.329141728 0.412881435 0.407493194 0.427985697 0.282709635 [16] 0.249832652 0.247260304 0.224311219 0.257424794 0.179430475 [21] 0.128830235 0.077102487 0.109985387 0.149832287 0.204298796 [26] 0.176435195 0.182189849 0.098283114 0.068013778 0.146318761 [31] 0.046731348 -0.035837254 -0.068185291 -0.015241148 -0.065482965 [36] -0.032056319 -0.034079403 0.009914968 -0.004975647 -0.041335660 [41] -0.043930793 0.037558489 0.076611678 -0.041277481 -0.102043293 [46] -0.106189314 -0.084028154 -0.042674906 -0.041661257 -0.076199767 [51] -0.081774953 -0.054050327 -0.023543466 0.016301344 -0.015711041 [56] -0.020784351 -0.090153098 -0.114123095 -0.083795426 -0.107203470 [61] -0.122360196 > (mypacf <- c(rpacf$acf)) [1] 0.6526445473 0.0830606821 0.2140233114 0.1709754079 0.0999211871 [6] 0.0016504333 0.0683337815 0.0902452273 -0.0392086610 0.0346354110 [11] 0.1992154713 0.0082557313 0.1405105242 -0.2266634903 0.0038381077 [16] -0.0935627979 -0.0312865750 0.1029644952 -0.1560308747 -0.0230119921 [21] -0.1529270286 0.0764326851 0.0440780275 0.0902502969 0.0740314767 [26] 0.0210512533 -0.0721445916 -0.0406282660 0.1204295566 -0.2228274988 [31] -0.1383640707 0.0296322864 0.0462488866 -0.1102017236 0.0986703302 [36] -0.0804798916 0.0181170022 0.0327990194 0.0525189746 -0.0269333067 [41] 0.1979676175 0.0357103969 -0.0556497275 -0.0887402224 0.0110723707 [46] -0.0905524386 0.1538187533 -0.0616400035 -0.0568774042 -0.0546704425 [51] 0.0045708161 0.0074230166 0.0191856367 0.0079301299 -0.0357356201 [56] -0.0005534447 0.0511633370 -0.0145537554 -0.1366584557 -0.0103126519 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3wlkw1229540220.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/freestat/rcomp/tmp/4yowi1229540220.tab") > > system("convert tmp/1y9xq1229540220.ps tmp/1y9xq1229540220.png") > system("convert tmp/2x28s1229540220.ps tmp/2x28s1229540220.png") > > > proc.time() user system elapsed 0.817 0.421 0.902