get_covariance: Calculate the covariance matrix for the MMM and return it and...

View source: R/fit_mmm.R

get_covarianceR Documentation

Calculate the covariance matrix for the MMM and return it and the robust standard error

Description

Use a sandwich estimator to return the standard errors for the full multivariate mixed model.

Usage

get_covariance(hessian, cpgradient, parameters, A, data, id)

Arguments

hessian

The sparse Hessian matrix for the MMM returned by the average_hessians function().

cpgradient

The cross-product and average of the subject level gradients returned by the get_crossproducts() function.

parameters

The parameter estimates returned by the stack_parameters() function.

A

the A helper matrix returned by the create_A_matrix function().

data

The data.frame with original data in long format.

id

A character value with the subject identifier in the orginal data.

Value

A data.frame with parameter estimates and standard errors for the multivariate mixed model.


JanvandenBrand/jmmm documentation built on May 30, 2022, 9:37 a.m.