Makes a list of IPMs where there is a discrete covariate.

Share:

Description

Wrapper function to build the IPM corresponding to every level of the discrete covariate, and return a list of these.

Usage

1
2
3
4
5
6
7
8
9
sampleSequentialIPMs(dataf, nBigMatrix = 10, minSize = -2, 
    maxSize = 10,	
	integrateType = "midpoint", correction = "none", 
	explSurv = surv ~ size + size2 + covariate, 
	explGrow = sizeNext ~ size + size2 + covariate,
	regType = "constantVar", 
	explFec = fec ~size,  Family="gaussian", 
	Transform = "none", 
	fecConstants = data.frame(NA))

Arguments

dataf

a dataframe with columns ‘size’, ‘sizeNext’, 'surv', 'fec', 'covariate', 'covariatel'; and 'age' indicating which individuals are seedlings for identifying the mean and variance in seedling size.

nBigMatrix

number of bins in size.

minSize

minimum size.

maxSize

maximum size.

integrateType

integration type.

correction

correction for unintentional eviction (individuals move outside the size range of the IPM). This correction redistributes individuals so that column sums of the IPM match expected survival for that column.

explSurv

Formula and explanatory variables used in the survival model.

explGrow

explanatory variables used in the growth model.

regType

Formula and regression Type for growth (normal density function, truncated, etc).

explFec

explanatory variables used in the fecundity.

Family

a character vector containing the names of the families to be used for the glms, e.g., binomial, poisson, etc. Again, these must appear in the order defined by the list of formula

Transform

a character vector containing the names of the transforms to be used for the response variables, e.g., log, sqrt, -1, etc. Again, these must appear in the order defined by the list of formula

fecConstants

data.frame of constant multipliers for the fecundity model.

Value

list of matrices corresponding to covariates, in order.

Note

Formerly makeListIPMs(). makeListIPMs() is no longer supported but has been hidden (.makeListIPMs()) and can be accessed for backward compatibility.

Author(s)

Cory Merow, C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans.

Examples

1
2
dff <- generateData()
IPMlist <- sampleSequentialIPMs(dff, Transform="log")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.