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(2350.44,2440.25,2408.64,2472.81,2407.6,2454.62,2448.05,2497.84,2645.64,2756.76,2849.27,2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '2' > 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: > 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/1g8781260724187.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/2uias1260724187.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.3624980343 -0.2346120750 0.0930610558 -0.0070313402 [6] 0.2044083083 -0.1876828645 -0.1314886867 0.2051565940 0.0427688911 [11] -0.3080731665 0.2801602240 -0.0439585446 -0.1302217248 0.1571128165 [16] -0.1243936986 0.1786498325 -0.0871704150 -0.1790360551 0.2179877211 [21] -0.0321366617 -0.0541993220 -0.0236297556 0.0140007553 -0.0426407403 [26] 0.1059557703 -0.0949700996 -0.0078015225 0.1211339752 -0.0734395577 [31] 0.0197453825 -0.0351431817 0.0399163925 -0.0036117442 0.0189281416 [36] -0.1094213012 0.0559514487 0.0532373679 -0.0491497830 0.0205443550 [41] -0.0425614423 0.0340229768 0.0286653436 -0.0235788536 0.0211888983 [46] -0.0256388543 0.0145958582 -0.0144581821 0.0152543986 -0.0564637018 [51] 0.0462911318 -0.0016418892 -0.0085782579 0.0265521009 -0.0509257282 [56] 0.0703703472 -0.0308282913 -0.0053162717 -0.0006780147 0.0017189198 [61] 0.0063278095 > (mypacf <- c(rpacf$acf)) [1] -0.3624980343 -0.4213895153 -0.2527801498 -0.2545503583 0.1203669120 [6] -0.0396346073 -0.1578264799 -0.0265110812 0.0689008702 -0.3456991638 [11] 0.1023784330 -0.0040406131 -0.1746137824 0.0283830220 0.0440060692 [16] 0.0757095681 0.0128955229 -0.0346828873 0.0146465676 -0.1236379636 [21] 0.0767748290 -0.0694519777 -0.0580123285 -0.1560086825 -0.0384968537 [26] -0.0754682007 -0.1267415115 -0.0016009023 0.1229368112 -0.1060754108 [31] -0.0104963976 0.0736324249 -0.0735115233 0.0258171612 -0.0538124794 [36] -0.0714874989 -0.0925666621 0.0796542216 0.0263217787 -0.0828074968 [41] -0.0001464639 -0.0081534118 -0.0614495246 0.0565912971 -0.0352896978 [46] 0.0350069800 -0.0467594791 -0.0362168436 -0.0831626795 -0.0222259327 [51] -0.0212932362 0.0434314072 -0.0355886948 0.0173587166 0.0380021217 [56] 0.0615292983 -0.0613119262 -0.0150535763 -0.0330308748 -0.0421318102 > 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/37di31260724187.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/461re1260724187.tab") > > try(system("convert tmp/1g8781260724187.ps tmp/1g8781260724187.png",intern=TRUE)) character(0) > try(system("convert tmp/2uias1260724187.ps tmp/2uias1260724187.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.304 0.685