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(2150.3,2425.7,2642.0,2291.5,2570.7,2526.6,2266.2,1981.9,2630.3,2942.6,2713.4,2437.5,2678.9,2582.0,2780.0,2512.4,2658.4,2708.7,2518.7,2018.3,2579.3,2693.5,2468.8,2122.8,2412.8,2370.6,2642.5,2634.2,2457.5,2579.1,2505.9,1903.2,2660.2,2844.1,2607.1,2356.0,2659.9,2531.4,2845.7,2654.3,2588.2,2789.6,2533.1,1846.5,2796.3,2895.6,2472.2,2584.4,2630.4,2663.1,3176.2,2856.7,2551.4,3088.7,2628.3,2226.2,3023.6,3077.9,3084.1,2990.3,2949.6,3014.7,3517.7,3121.2,3067.4,3174.6,2676.3,2424.0,3195.1,3146.6,3506.7,3528.5) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1w1jt1229354573.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/20kyz1229354573.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.374190067 -0.108020691 0.319920708 -0.198581161 [6] -0.111798289 0.259089942 -0.254707464 0.073666635 0.248683575 [11] -0.281164085 0.095099263 -0.057860252 -0.107976984 0.082466610 [16] 0.145448399 -0.355477689 0.307867644 -0.001441053 -0.277043373 [21] 0.235843555 -0.048573355 -0.145475387 0.277448912 -0.033717670 [26] -0.162041618 0.225699496 -0.122653254 -0.036032386 0.088123313 [31] -0.086997824 0.007617675 0.066363139 -0.038495527 -0.105920287 [36] 0.096917167 -0.105105235 > (mypacf <- c(rpacf$acf)) [1] -0.3741900672 -0.2884234284 0.2028268302 -0.0102577025 -0.1538388422 [6] 0.0811710576 -0.1332022552 0.0312140384 0.2082991772 -0.0417939905 [11] -0.0014914978 -0.2689895251 -0.0840806664 -0.0090342572 0.2442046424 [16] -0.2212832980 0.0107076788 0.0005723518 -0.1133033897 0.0941431775 [21] 0.0088460597 0.0189325094 0.0492307064 0.0645169438 0.0764756723 [26] -0.0507593462 0.0554911982 -0.0443748661 0.0016448783 -0.0301220961 [31] -0.0002943496 -0.1349996741 0.1019113513 -0.1100856384 -0.0433023438 [36] -0.0074324908 > 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/3qexj1229354573.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/4uics1229354573.tab") > > system("convert tmp/1w1jt1229354573.ps tmp/1w1jt1229354573.png") > system("convert tmp/20kyz1229354573.ps tmp/20kyz1229354573.png") > > > proc.time() user system elapsed 0.592 0.335 1.297