glm or glmer.
However, the standard family functions as decribed in
family will work with brms.
brmsfamily(family, link = NULL, link_sigma = "log", link_shape = "log", link_nu = "logm1", link_phi = "log", link_kappa = "log", link_beta = "log", link_zi = "logit", link_hu = "logit", link_disc = "log", link_bs = "log", link_ndt = "log", link_bias = "logit", link_quantile = "logit")
student(link = "identity", link_sigma = "log", link_nu = "logm1")
bernoulli(link = "logit")
negbinomial(link = "log", link_shape = "log")
geometric(link = "log")
lognormal(link = "identity", link_sigma = "log")
exponential(link = "log")
weibull(link = "log", link_shape = "log")
frechet(link = "log", link_nu = "logm1")
exgaussian(link = "identity", link_sigma = "log", link_beta = "log")
wiener(link = "identity", link_bs = "log", link_ndt = "log", link_bias = "logit")
Beta(link = "logit", link_phi = "log")
von_mises(link = "tan_half", link_kappa = "log")
asym_laplace(link = "identity", link_sigma = "log", link_quantile = "logit")
hurdle_poisson(link = "log")
hurdle_negbinomial(link = "log", link_shape = "log", link_hu = "logit")
hurdle_gamma(link = "log", link_shape = "log", link_hu = "logit")
hurdle_lognormal(link = "identity", link_sigma = "log", link_hu = "logit")
zero_inflated_beta(link = "logit", link_phi = "log", link_zi = "logit")
zero_inflated_poisson(link = "log", link_zi = "logit")
zero_inflated_negbinomial(link = "log", link_shape = "log", link_zi = "logit")
zero_inflated_binomial(link = "logit", link_zi = "logit")
categorical(link = "logit")
cumulative(link = "logit", link_disc = "log")
sratio(link = "logit", link_disc = "log")
cratio(link = "logit", link_disc = "log")
acat(link = "logit", link_disc = "log")gaussian, student, binomial,
bernoulli, poisson, negbinomial,
geometric, Gamma, lognormal,
exgaussian, wiener, inverse.gaussian,
exponential, weibull, frechet,
Beta, von_mises,
categorical, cumulative, cratio, sratio,
acat, hurdle_poisson, hurdle_negbinomial,
hurdle_gamma, hurdle_lognormal,
zero_inflated_binomial, zero_inflated_beta,
zero_inflated_negbinomial,
and zero_inflated_poisson.sigma if being predicted.shape if being predicted.nu if being predicted.phi if being predicted.kappa if being predicted.beta if being predicted.zi if being predicted.hu if being predicted.disc if being predicted.bs if being predicted.ndt if being predicted.bias if being predicted.quantile if being predicted.gaussian with identity link leads to linear regression.
Family student with identity link leads to
robust linear regression that is less influenced by outliers.
Families poisson, negbinomial, and geometric
with log link lead to regression models for count data.
Families binomial and bernoulli with logit link leads to
logistic regression and family categorical to multi-logistic regression
when there are more than two possible outcomes.
Families cumulative, cratio ('contiuation ratio'),
sratio ('stopping ratio'), and acat ('adjacent category')
leads to ordinal regression. Families Gamma, weibull,
exponential, lognormal, frechet, and
inverse.gaussian can be used (among others) for survival regression.
Family asym_laplace allows for quantile regression when fixing
the auxiliary quantile parameter to the quantile of interest.
Family exgaussian ('exponentially modified Gaussian') is especially
suited to model reaction times and the wiener family provides
an implementation of the Wiener diffusion model. For this family,
the main formula predicts the drift parameter 'delta' and
all other parameters are modeled as auxiliary parameters
(see brmsformula for details).
Families hurdle_poisson, hurdle_negbinomial, hurdle_gamma,
hurdle_lognormal, zero_inflated_poisson,
zero_inflated_negbinomial, zero_inflated_binomial, and
zero_inflated_beta allow to estimate zero-inflated and hurdle models.
These models can be very helpful when there are many zeros in the data
that cannot be explained by the primary distribution of the response.
Families hurdle_lognormal and hurdle_gamma are
especially useful, as traditional lognormal or Gamma
models cannot be reasonably fitted for data containing zeros in the response.
In the following, we list all possible links for each family.
The families gaussian, student, exgaussian. and
asym_laplace accept the links (as names) identity,
log, and inverse;
families poisson, negbinomial, and geometric the links
log, identity, and sqrt;
families binomial, bernoulli, Beta,
cumulative, cratio, sratio, and acat
the links logit, probit, probit_approx,
cloglog, and cauchit;
family categorical the link logit;
families Gamma, weibull, exponential, and
frechet the links log, identity, and inverse;
family lognormal the links identity and inverse;
family inverse.gaussian the links 1/mu^2,
inverse, identity and log;
families hurdle_poisson, hurdle_negbinomial,
hurdle_gamma, zero_inflated_poisson, and
zero_inflated_negbinomial the link log;
families wiener and hurdle_lognormal the link identity.
The first link mentioned for each family is the default.
Please note that when calling the Gamma
family function, the default link will be inverse not log.
Also, the probit_approx link cannot be used when calling the
binomial family function.
The current implementation of inverse.gaussian models has some
convergence problems and requires carefully chosen prior distributions
to work efficiently. For this reason, we currently do not recommend
to use the inverse.gaussian family, unless you really feel
that your data requires exactly this type of model.
brm,
family
# create a family object
(fam1 <- student("log"))
# alternatively use the brmsfamily function
(fam2 <- brmsfamily("student", "log"))
# both leads to the same object
identical(fam1, fam2)
Run the code above in your browser using DataLab