mlcoef: Coefficients of Multivariate Logistic Regression Models

View source: R/mlcoef.R

mlcoefR Documentation

Coefficients of Multivariate Logistic Regression Models

Description

Extract regression coefficients from multivariate logistic regression models.

Usage

mlcoef(fit, probs = c(0.025, 0.25, 0.5, 0.75, 0.975), dimnames)

Arguments

fit

A stanfit object returned from the mlreg function. The fitted multivariate logistic regression model.

probs

Numeric vector of probabilities. Passed to the probs argument of the stats::quantile function. The length of probs defines the length of the first dimension of the returned 3-dimensional array. By default, probs = c(0.025, 0.25, 0.5, 0.75, 0.975). See details for the interpretation of values at each probability.

dimnames

List (optional). If provided, then names within the returned 3-dimensional array will receive these values. Passed to the dimnames argument of the array function. If omitted, then generic names will be provided to the returned 3D array. See the dimnames argument of the array function for details.

Details

Extracts regression coefficient estimates from a multivariate logistic regression model fit using the mlreg function. Summarizes estimates by the quantiles of their posterior distributions, and returns summaries in a 3-dimensional array. The dimensions of the 3D array represent the posterior quantiles, the predictor variables, and the response variables, respectively. Values at probs = 0.025 and 0.975 comprise 95% credible intervals. Values at probs = 0.25 and 0.75 comprise 50% credible intervals, and values at probs = 0.5 represent point estimates.

Value

Numeric 3-dimensional array of regression coefficient posterior quantiles.

See Also

mlreg for fitting multivariate logistic regression models.

mlcor for extracting residual correlations from multivariate logistic regression models.

mlformat for formatting output of multivariate logistic regression models.

Examples

# Define example data file path.
path<-system.file("extdata",
                  "example_mvlogistic_data.rds",
                  package="LocaTT",
                  mustWork=TRUE)

# Read in example regression data.
data<-readRDS(file=path)

# Extract regression coefficients.
out<-mlcoef(fit=data$fit)

LocaTT documentation built on June 14, 2026, 1:06 a.m.