R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(442,441,440,438,458,457,442,432,433,433,434,436,439,439,441,436,460,453,435,421,412,408,402,409,410,410,416,410,437,431,411,398,394,395,389,404,397,401,402,383,406,400,377,372,362,365,361,372,355,365,367,341,370,366,333,320,298,306,293,313,293,304,304,286,320,313,283,272,251,262,247,268,251,257,261,242,274,272,243,234,217,231,209,226,208,214,222,194,230,226,197,188,175,190,165,176,159,169,170,141,170,164,132,123,113,125,101,99,87,90,89,66,102,97,65,54,33,49,30,34) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/rcomp/tmp/1g0eh1280751041.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/rcomp/tmp/2g0eh1280751041.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.967619085 0.939307372 0.913137092 0.883514770 [6] 0.857514666 0.828883196 0.810039734 0.788731830 0.764192357 [11] 0.741756100 0.718653025 0.699305115 0.666802749 0.638773070 [16] 0.613482215 0.585413385 0.559230585 0.530690432 0.511730567 [21] 0.491403221 0.469651002 0.451615273 0.432865652 0.416244450 [26] 0.389345153 0.364347650 0.342277092 0.317307162 0.294325600 [31] 0.269218852 0.253000398 0.235543360 0.215344030 0.198252915 [36] 0.179504983 0.162074853 0.137241823 0.112065179 0.090117518 [41] 0.066581740 0.045449284 0.022824313 0.008577054 -0.007068358 [46] -0.024669607 -0.040494653 -0.057183846 -0.073089431 -0.093783697 [51] -0.116796848 -0.137389315 -0.158548285 -0.177578683 -0.197479021 [56] -0.208523290 -0.219072794 -0.231452265 -0.242339930 -0.252426041 [61] -0.264004722 > (mypacf <- c(rpacf$acf)) [1] 0.9676190849 0.0474104763 0.0229834692 -0.0636142582 0.0362527218 [6] -0.0525906184 0.1412235850 -0.0420104552 -0.0487917395 -0.0082347166 [11] -0.0031111283 0.0390816172 -0.2014662604 0.0369756340 -0.0021369592 [16] -0.0152998422 -0.0193912696 -0.0291623160 0.0879749042 -0.0129289527 [21] 0.0037530831 0.0031648714 0.0043881362 -0.0038903611 -0.1163751402 [26] -0.0136670059 -0.0057890149 -0.0127937918 -0.0153961215 -0.0303788357 [31] 0.0616598635 -0.0144039315 -0.0166713803 -0.0185802677 -0.0153339152 [36] -0.0168006853 -0.0664014170 -0.0457772990 -0.0137097460 0.0061494591 [41] -0.0020204750 -0.0247959681 0.0497223408 -0.0269608472 -0.0005326227 [46] -0.0412801792 -0.0025637979 -0.0287922878 -0.0244259211 -0.0721177117 [51] -0.0306236630 0.0049529782 -0.0023990431 -0.0206022050 0.0545204010 [56] 0.0005305270 -0.0042315381 -0.0295436274 0.0200323590 -0.0581715783 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3cau81280751041.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/rcomp/tmp/4m1ta1280751041.tab") > > try(system("convert tmp/1g0eh1280751041.ps tmp/1g0eh1280751041.png",intern=TRUE)) character(0) > try(system("convert tmp/2g0eh1280751041.ps tmp/2g0eh1280751041.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.780 0.580 1.325