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(2648.9,2669.6,3042.3,2604.2,2732.1,2621.7,2483.7,2479.3,2684.6,2834.7,2566.1,2251.2,2350,2299.8,2542.8,2530.2,2508.1,2616.8,2534.1,2181.8,2578.9,2841.9,2529.9,2103.2,2326.2,2452.6,2782.1,2727.3,2648.2,2760.7,2613,2225.4,2713.9,2923.3,2707,2473.9,2521,2531.8,3068.8,2826.9,2674.2,2966.6,2798.8,2629.6,3124.6,3115.7,3083,2863.9,2728.7,2789.4,3225.7,3148.2,2836.5,3153.5,2656.9,2834.7,3172.5,2998.8,3103.1,2735.6,2818.1,2874.4,3438.5,2949.1,3306.8,3530,3003.8,3206.4,3514.6,3522.6,3525.5,2996.2,3231.1,3030,3541.7,3113.2,3390.8,3424.2,3079.8,3123.4,3317.1,3579.9,3317.9,2668.1,3609.2,3535.2,3644.7,3925.7,3663.2,3905.3,3990,3695.8) > par5 = '12' > par4 = '0' > par3 = '0' > 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/18sor1228587143.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/27x511228587143.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.741581814 0.630108437 0.624296382 0.604742823 [6] 0.610914418 0.581614158 0.520465806 0.476132107 0.447179623 [11] 0.413350409 0.454653660 0.563129291 0.407441229 0.345192700 [16] 0.319755124 0.340681300 0.383959944 0.351929262 0.335445765 [21] 0.304866997 0.236344171 0.207065477 0.253065205 0.271019766 [26] 0.155659641 0.100788557 0.030724739 0.042349358 0.062555389 [31] 0.018930381 0.006510004 -0.031531323 -0.082862827 -0.072527589 [36] -0.030712161 -0.008102324 > (mypacf <- c(rpacf$acf)) [1] 0.7415818144 0.1781217803 0.2481996032 0.1243821538 0.1707137209 [6] 0.0414971115 -0.0395592943 -0.0413450940 -0.0282901544 -0.0443181244 [11] 0.1571943226 0.3471264008 -0.3192364750 -0.0368625234 -0.1338409498 [16] 0.0982169296 0.0684804176 0.0098825676 0.1177852745 -0.0472656064 [21] -0.1755637492 -0.0844793785 0.0503416833 -0.0865710119 -0.0501491823 [26] -0.0288467387 -0.1031687813 -0.0497526600 -0.0642544249 0.0217203044 [31] 0.0005939521 -0.0244367511 0.0293151202 0.0643670259 -0.0338500200 [36] 0.0271188089 > 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/34n7q1228587143.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/4cjnc1228587143.tab") > > system("convert tmp/18sor1228587143.ps tmp/18sor1228587143.png") > system("convert tmp/27x511228587143.ps tmp/27x511228587143.png") > > > proc.time() user system elapsed 0.610 0.336 0.887