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(113.9000,112.0000,113.8500,113.0800,111.7200,110.6900,113.5300,113.9900,112.7400,112.1500,115.8200,118.3800,118.8100,123.8500,117.9600,120.1600,118.7400,119.8400,124.8100,121.3300,120.2000,118.3200,129.5800,130.2000,127.1900,133.1000,129.1200,123.2800,123.3600,124.1300,126.9700,127.1400,123.7000,123.6700,130.1900,134.0100,124.9600,129.9600,128.3200,132.3800,126.2500,128.9100,131.4200,129.4400,126.8600,126.7100,131.6300,132.7800,126.6100,132.8400,123.1400,128.1300,125.4900,126.4800,130.8600,127.3200,126.5600,126.6400,129.2600,126.4700,135.4000,135.5000,132.2200,122.6200,125.1600,128.5000,133.8600,128.8700,125.0700,125.2500,132.1600,130.2400) > 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: 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/1my731228579334.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/2wlzi1228579334.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.0000000000 -0.3088980881 -0.1150712449 -0.1973033317 0.1237658047 [6] 0.1054834022 -0.0882871069 0.0329257718 -0.0295322085 -0.0028947541 [11] -0.0723676084 -0.1051347032 0.3462627844 -0.0336631283 -0.1344041158 [16] 0.0110924402 -0.0115420120 0.0653768536 -0.1672539167 0.1885269371 [21] -0.0809076282 0.0123211628 -0.1462674217 0.1162903257 0.1540555339 [26] -0.1242583791 -0.0312228524 0.0815044334 -0.0910847949 0.0751015275 [31] -0.1803652442 0.1931588508 0.0095504929 -0.1015603630 -0.1468884277 [36] 0.0864029143 0.2371057100 -0.1284230727 -0.0254340617 -0.0001306333 [41] -0.0177271105 -0.0329580718 0.0194713169 0.0423972795 0.0169267709 [46] -0.0367085544 -0.1365219666 0.0954881781 0.0869920285 > (mypacf <- c(rpacf$acf)) [1] -3.088981e-01 -2.326923e-01 -3.658216e-01 -1.672708e-01 -2.454988e-02 [6] -1.321562e-01 -1.411814e-05 -4.793127e-03 -5.599387e-02 -1.239214e-01 [11] -2.911342e-01 1.555617e-01 1.303085e-01 -2.670839e-02 2.107011e-01 [16] 6.912421e-02 -8.072358e-03 -1.557231e-01 5.943849e-02 -4.396083e-02 [21] -4.475890e-02 -1.188605e-01 1.126171e-01 1.016456e-01 -1.313035e-01 [26] 3.802414e-02 1.649505e-01 -2.023163e-01 1.848709e-02 -4.078301e-02 [31] -1.177206e-02 7.476039e-02 -7.194909e-02 -1.384674e-01 -8.689763e-02 [36] -8.623405e-02 3.150831e-02 4.091438e-02 -1.694776e-02 3.906231e-02 [41] -8.076365e-02 -4.844061e-02 -2.922719e-02 -9.401786e-02 9.677091e-02 [46] -6.943036e-02 1.396831e-02 -3.831725e-02 > 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/3mxgz1228579334.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/4k1g51228579334.tab") > > system("convert tmp/1my731228579334.ps tmp/1my731228579334.png") > system("convert tmp/2wlzi1228579334.ps tmp/2wlzi1228579334.png") > > > proc.time() user system elapsed 0.568 0.308 0.680