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(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,3195.1,3146.6,3506.7,3528.5,3365.1,3153,3843.3,3123.2,3361.1,3481.9,2970.5,2537,3257.6,3301.3,3391.6,2933.6,3283.2,3139.7,3486.4,3202.2,3294.4,3550.3,3279.3,2678.6,3451.4,3977.1,3814.8,3310.5,3971.8,4051.9,4057.6,4391.4,3628.9,4092.2,3822.5) > par5 = '12' > par4 = '0' > par3 = '0' > 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: 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/freestat/rcomp/tmp/1eqgc1228834311.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/freestat/rcomp/tmp/2xqoo1228834311.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.572945638 0.438534414 0.507750177 0.411539322 [6] 0.310201669 0.327552633 0.160788602 0.223468230 0.209576622 [11] 0.068866272 0.145438816 0.358300792 0.116167769 0.011949028 [16] 0.040747732 0.027294859 -0.007523147 0.029714341 -0.029179270 [21] 0.025119866 0.023144099 -0.009253589 0.060344766 0.178651680 [26] 0.053337016 -0.032022709 -0.019747574 -0.021267449 -0.072114527 [31] -0.057822254 -0.086566455 -0.072505133 -0.113691979 -0.135470695 [36] -0.082444070 0.026222233 -0.063773345 -0.151454469 -0.115737692 [41] -0.090639583 -0.191945351 -0.189646525 -0.191876400 -0.208307778 [46] -0.214388184 -0.252754066 -0.253249390 -0.152459059 -0.217902784 [51] -0.294600198 -0.234701621 -0.194214000 -0.250351704 -0.212744935 [56] -0.194088189 -0.173901223 -0.078553601 -0.101520765 -0.059236859 > (mypacf <- c(rpacf$acf)) [1] 0.5729456383 0.1641540036 0.3116234971 0.0157047284 -0.0236980208 [6] 0.0586010986 -0.2171348407 0.1858091779 -0.0470823016 -0.0872784738 [11] 0.1504972256 0.3327025980 -0.2615775819 -0.2311162942 -0.1220532212 [16] 0.0603078483 0.0126680365 0.1178560573 0.1398151871 -0.0335419062 [21] -0.0686632411 0.0670508337 0.0339925270 -0.0583694878 -0.0490380803 [26] -0.0406001750 -0.0203361132 -0.0430754775 -0.0265284212 -0.0042316128 [31] -0.0236994340 0.0132880686 -0.0562251653 -0.0388189195 -0.0019340832 [36] 0.1134632312 -0.0098452102 -0.0885111912 0.0019972107 -0.0097266457 [41] -0.1936084612 -0.0834248612 0.0149892261 -0.0427128037 0.0451181628 [46] -0.0012938338 -0.0800404524 -0.1429780108 -0.0522022102 0.0427447870 [51] 0.0074258897 0.0375116457 0.0746488153 0.0149713431 -0.0543241369 [56] -0.0002256340 0.1690292343 -0.0562933446 0.0610456982 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/36pkk1228834311.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/freestat/rcomp/tmp/43yir1228834311.tab") > > system("convert tmp/1eqgc1228834311.ps tmp/1eqgc1228834311.png") > system("convert tmp/2xqoo1228834311.ps tmp/2xqoo1228834311.png") > > > proc.time() user system elapsed 0.831 0.442 1.613