pop_avg: Extract population average of top model and extract...

View source: R/fcts RSF.R

pop_avgR Documentation

Extract population average of top model and extract individual coefficients

Description

Extract population average of top model and extract individual coefficients. Population average can be calculated based on bootstrap (Prokopenko et al. 2016 JAppEco) or weighted based on standard errors (Murtaugh 2007 Ecology)

Usage

pop_avg(
  m = 1,
  mod_ls,
  cutoff = -1,
  nudge = 0.01,
  method = "murtaugh",
  nboot = 1000,
  id_year = F
)

Arguments

m

model number (based on number in list of formula provided to rsf_ind)

mod_ls

A list of list of model generated by rsf_ind

cutoff

A cutoff value to exclude individuals with bad fit, default = -1 indicating model that did not converge will be excluded. Values > 0 will exclude based on coefficient values

method

If = "boot", population average is based on bootstrap, if = "murtaugh" based on standard errors weighting. See Prokopenko et al 2016 or Murtaugh 2007 for details.

nboot

Number of bootstrap iterations, default = 1000. Only applicable if method = "boot".

id_year

Whether id_year (instead of individual) are provided. Individual and year needs to be separated by an underscore for the function to work properly.

Value

A list containing a table population average with confidence intervals and a table of individual coefficients

Examples

data(goats)
ls1<-list()
ls1[[1]]<-as.formula(STATUS~ELEVATION+SLOPE+ET+ASPECT+HLI+TASP)
ls1[[2]]<-as.formula(STATUS~ET+ASPECT+HLI+TASP)
out<-rsf_ind(goats$ID, data=goats, form_ls=ls1)
pop_avg(m=1, out, method="murtaugh")

BastilleRousseau/IndRSA documentation built on July 1, 2024, 7:48 a.m.