modSelect: AIC-based model selection for models fitted using fitxy

Description Usage Arguments Value See Also Examples

View source: R/2DLTfunctions.r

Description

AIC-based model selection of a list of models fitted using fitxy. Parameter estimates for the hazard and perpendicular distribution functions along with associated coefficients of variation are also provided. Models are ranked in order of increasing dAIC. The model list can also be returned in a data frame suitable making a tex-type table.

Usage

1
2
modSelect(modList, modNames = NULL, tab = FALSE, digits = 2,
  maxblength = NULL, maxlogphilength = NULL)

Arguments

modList

a list of fitxy-type models.

modNames

a vector of model names.

tab

boolean - return a data frame suitable for generating a table for report or paper.

digits

- number of digits of rounding (see round) in the table

maxblength=NULL;

maximum number of parameters for the hazard function. If NULL the maximum number of parameters for the models in modList is used.

maxlogphilength=NULL;

maximum number of parameters for the perpendicular density function. If NULL the maximum number of parameters for the models in modList is used.

Value

tab=FALSE list; element 1 =data frame of AIC-ranked models, with parameter estimates, coefficients of variation and AIC; element 2= vector of the order of AIC-ranked models. tab=TRUE, a three element list with AIC-ranked model order and two tables, the first as tab=FALSE, the second, a table for use in reports or manuscripts.

See Also

fitxy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
ystart=4;w=1
hr=h2; b=log(c(0.75,1))
pi.x=pi.norm; logphi=c(0.5,log(0.2))
N=50 #true number of animals
#generate some observations
simDat=simXY(N=N,pi.x=pi.x,logphi=logphi,
hr=hr,b=b,w=w,ystart=ystart)
x=simDat$locs$x; y=simDat$locs$y 
fit1=fityx(y,x,b,hr,ystart,pi.x,logphi,w)
fit2=fityx(y,x,b=log(c(0.001,1)),hr=h1,ystart,pi.x,logphi,w)
modSelect(modList=list(fit1,fit2),modNames=c('h1','h2'),tab=TRUE)

## End(Not run)

david-borchers/LT2D documentation built on Aug. 17, 2020, 1:37 a.m.