ml_by_group: 'ml_by_group' gets maximum likelihood estimates for groups of...

Description Usage Arguments Value See Also

View source: R/ml_by_group.R

Description

ml_by_group gets maximum likelihood estimates for groups of outcomes.

Usage

1
2
ml_by_group(X, W = NULL, y, outcomes, outcome_groups, return_ci = TRUE,
  ci_level, family, return_theta = FALSE)

Arguments

X

An n x K matrix of exposure data, where K is the dimension of the exposure.

W

Matrix of covariates of dimension n x m.

y

Vector of length n containing outcomes data. If family = "bernoulli", y must be an integer vector where 1 = success, 0 = failure. If family = "gaussian", y must be a numeric vector containing continuous data.

outcomes

Character vector specifying which outcomes the rows of X and W correspond to.

outcome_groups

A list of length G, where each element is a character vector indiciating which outcomes belong to that group.

return_ci

Get confidence intervals? Default = TRUE

ci_level

A number between 0 and 1 giving the desired credible interval. For example, ci_level = 0.95 (the default) returns a 95% credible interval.

family

A string specifying the distribution of the outcomes: either "bernoulli" (for classification) or "gaussian" (for regression)

return_theta

Return ML estimates for theta? Default = FALSE

Value

A list containing the following elements: 1. estimated coefficients and credible intervals for beta; 2. estimated coefficients and credible intervals for theta.

See Also

Other Processing model output: moretrees_compute_betas, moretrees_compute_thetas


emgthomas/moretrees_pkg documentation built on June 20, 2020, 6:13 p.m.