lmf fit linear models within each combination of year and age class and
estimates coefficients of selection using maximum likelihood procedures.
lmf is compatible with populations without age-structure.
lmf(formula, age, year, data, na.action = na.exclude,
method = c("BFGS"), control = list(maxit = 500,
reltol = sqrt(.Machine$double.eps)), ...)na.exclude (see ?na.fail).
?optim for details.
maxit sets the maximum number of iterations to use before convergence
and reltol sets the relative threshold for improvement in the
likelihood which desides whether to continue maximation or end.
See ?optim for details.
?optim for options.
lmf returns an object of class "lmf".The function summary is used to obtain and
print a summary of the results. For construction of confidene intervals or
perform statistical inference on the parameters the function boot.lmf is used.An object of class "lmf" is a list containing the following components:
lm.influence?). Sorted by age class and year.cooks.distance?). Sorted by age class and year.maxit.lmf use formulas for model specification. These should be formatted as
decribed under arguments. Note however that your response should be specified
as a two-column matrix with the columns recruits and survival. The first column
should give the number of recruits that an individual produced a given year and
the second column should contain information on whether the individual survived
or not (1 or 0) to the next breeding season. These two columns will be used to
calculate the individual reproductive values (Wj) which the model will substitute
for the response in the age and year specific linear regressions
(i.e. Wj ~ terms).
procomp, promat, eigenl,
lm.extract, fs, atCfn,
nfs, boot.lmf
#Data set from Engen et al. 2012
data(sparrowdata)
#Fit model
lmf.1 <- lmf(formula = cbind(recruits, survival) ~ weight + tars,
age = age, year = year, data = sparrowdata)
#View diagnostic plots
plot(lmf.1)
#View output
print(lmf.1)
#Print summary
summary(lmf.1)
Run the code above in your browser using DataLab