Description
Usage
Arguments
Value
get_design_matrix
gets design matrix for gaussian, binomial, and poisson models
formula 
A twosided linear formula object describing the
mixed effects of the model.
To specify that a random term should have phylogenetic covariance matrix along
with nonphylogenetic one, add __ (two underscores) at the end of the group variable;
e.g., + (1  sp__) will construct two random terms,
one with phylogenetic covariance matrix and another with nonphylogenetic (identity) matrix.
In contrast, __ in the nested terms (below) will only create a phylogenetic covariance matrix.
Nested random terms have the general form (1sp__@site__) which represents
phylogenetically related species nested within correlated sites.
This form can be used for bipartite questions. For example, species could be
phylogenetically related pollinators and sites could be phylogenetically related plants, leading to
the random effect (1insects__@plants__) . If more than one phylogeny is used, remember to add
all to the argument cov_ranef = list(insects = insect_phylo, plants = plant_phylo) . Phylogenetic correlations can
be dropped by removing the __ underscores. Thus, the form (1sp@site__) excludes the phylogenetic
correlations among species, while the form (1sp__@site) excludes the correlations among sites.
Note that correlated random terms are not allowed. For example,
(xg) will be the same as (0 + xg) in the lme4::lmer syntax. However,
(x1 + x2g) won't work, so instead use (x1g) + (x2g) .

data 
A data.frame containing the variables named in formula.

random.effects 
Optional prebuild list of random effects. If NULL (the default),
the function prep_dat_pglmm will prepare the random effects for you from the information
in formula , data , and cov_ranef . random.effect allows a list of
pregenerated random effects terms to increase flexibility; for example, this makes it
possible to construct models with both phylogenetic correlation and spatiotemporal autocorrelation.
In preparing random.effect , make sure that the orders of rows and columns of
covariance matrices in the list are the same as their corresponding group variables
in the data. Also, this should be a list of lists, e.g.
random.effects = list(re1 = list(matrix_a), re2 = list(1, sp = sp, covar = Vsp)) .

na.action 
What to do with NAs?

A list of design matrices.
phyr documentation built on Jan. 13, 2021, 5:40 p.m.