mm {binaryMM}R Documentation

Fit Marginalized Transition and/or Latent Variable Models

Description

Fit a marginalzed transition and/or latent variable models (mTLV) as described by Schildcrout and Heagerty 2007.

Usage

mm(
  mean.formula,
  lv.formula = NULL,
  t.formula = NULL,
  id,
  data,
  inits = NULL,
  weight = NULL,
  offset = NULL,
  q = 30,
  step.max = 1,
  step.tol = 1e-06,
  hess.eps = 1e-07,
  adapt.quad = FALSE,
  verbose = FALSE,
  iter.lim = 100,
  return_args = FALSE
)

Arguments

mean.formula

Mean model formula in which a binary variable is regressed on covariates

lv.formula

Latent variable model formula (right hand side only)

t.formula

Transition model formula (right hand side only)

id

a vector of cluster identifiers (it should be the same length of nrow(data)).

data

a required data frame

inits

an optional list of length 3 containing initial values for marginal mean parameters and all dependence parameters. The format of the list should be: (1) estimates of the mean parameters, (2) estimates of the transition parameters (or NULL if only fitting a mLV model) and (3) estimates of the latent variable parameters (or NULL if only fitting a mT model). If NULL, initial values will be automatically generated.

weight

a vector of sampling weights - if using weighted estimating equations. The vector should be the same length of nrow(data).

offset

an optional offset

q

a scalar to denote the number of quadrature points used to compute the Gauss-Hermite quadrature rule

step.max

a scalar

step.tol

a scalar

hess.eps

a scalar

adapt.quad

an indicator if adaptive quadrature is to be used. NOT CURRENTLY IMPLEMENTED.

verbose

an indicator if model output should be printed to the screen during maximization (or minimization of negative log-likelihood)

iter.lim

a scalar to denote the maximum iteration limit. Default value is 100.

return_args

indicator to denote if attributes of the output should be printed.

Value

This function returns marginal mean (beta) and dependence parameters (alpha) along with the associated model and empirical covariance matricies

Examples


data(datrand)
fit <- mm(Y~time*binary, t.formula=~1, data=datrand, id=id, step.max=4, verbose=FALSE)

[Package binaryMM version 0.1.1 Index]