R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(2953,2635,2404,2413,2136,1565,1451,2037,2477,2785,2994,2681,3098,2708,2517,2445,2087,1801,1216,2173,2286,3121,3458,3511,3524,2767,2744,2603,2527,1846,1066,2327,3066,3048,3806,4042,3583,3438,2957,2885,2744,1837,1447,2504,3248,3098,4318,3561,3316,3379,2717,2354,2445,1542,1606,2590,3588,3202,4704,4005,3810,3488,2781,2944,2817,1960,1937,2903,3357,3552,4581,3905,4581,4037,3345,3175,2808,2050,1719,3143,3756,4776,4540,4309,4563,3506,3665,3361,3094,2440,1633,2935,4159,4159,4894,4921,4577,4155,3851,3429,3370,2726) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1iduq1273075036.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2bmtb1273075036.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.083540162 0.038230915 0.053865416 -0.257698527 [6] -0.243869887 -0.265139734 -0.279919206 -0.181864527 0.051558465 [11] -0.058960414 0.230129717 0.689563604 0.120479154 0.105882826 [16] -0.016620666 -0.175400807 -0.242939885 -0.236508868 -0.258401483 [21] -0.146164255 0.045466663 -0.030288649 0.264578084 0.490068120 [26] 0.187583686 0.010358410 -0.028329543 -0.115713662 -0.210174954 [31] -0.194163749 -0.227479137 -0.097740009 0.001020185 0.001123395 [36] 0.216303296 0.383322353 0.210016393 -0.024146775 -0.032447762 [41] -0.100565035 -0.170304603 -0.158917291 -0.172088659 -0.071118689 [46] -0.028579747 0.083778217 0.108312322 0.333321132 > (mypacf <- c(rpacf$acf)) [1] 0.0835401625 0.0314715949 0.0485293876 -0.2698610490 -0.2201900639 [6] -0.2523593079 -0.2714984933 -0.3010123978 -0.1419154994 -0.4060611953 [11] -0.2464240743 0.4739342755 0.1082669293 -0.0359542899 -0.1573346333 [16] 0.0683826787 -0.0501414433 0.0094999081 -0.0126771054 -0.0499856205 [21] 0.0006856916 0.0822165750 0.0312276732 -0.0151622227 0.0840446416 [26] -0.1727862654 -0.1036789100 0.0269828497 0.1186605126 -0.0101926752 [31] 0.0076304805 0.0372283511 -0.0553548374 -0.0315964673 -0.0549956180 [36] -0.0610715560 0.0027047518 0.0539973899 -0.0460703150 -0.0459531249 [41] -0.0007198449 0.0213003166 -0.0209508015 -0.0015137625 -0.0619843708 [46] 0.1154917539 -0.0392571359 0.0319536271 > 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/3w5sy1273075036.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/40nqm1273075036.tab") > > try(system("convert tmp/1iduq1273075036.ps tmp/1iduq1273075036.png",intern=TRUE)) character(0) > try(system("convert tmp/2bmtb1273075036.ps tmp/2bmtb1273075036.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.559 0.310 0.832