get_constants: Calculate constants independent of delta in MLE and REMLE...

Description Usage Arguments Value

View source: R/mcLMM.R

Description

Calculate constants independent of delta in MLE and REMLE likelihoods

Usage

1

Arguments

Y

Matrix with individuals as rows and measurements as columns Missing measurements must be NA.

X

Matrix with n rows and c columns for n individuals and c covariates.

Value

A list of named constants. These constants are difficult to describe briefly. See Jew et al, 2020 for a more in-depth discussion of these constants. ns is the total number of measured responses. nt is the number of contexts. ni is the number of individuals. nc is the number of covariates. ntc is the number of measurement contexts multiplied by the number of covariates. g.sizes is a vector of the unique number of measurements across all individuals. g.ind.sizes is a vector of the number of individuals that have a certain number of measurements. B is a dummy matrix that will store the inverse of XHX (beta hat covariance). D and E are vector representations of the upper triangle of symmetric matrices that are used to calculate B. sxy is a vector of the sum of responses multiplied by each covariate within each context. gxsy is a matrix where each row represents a group and column represents the sum of the covariate in each context multiplied by the sum of responses for each individual. sy2 is the sum of squared responses. syi2g provides the sum of squared responses within each group of measurement numbers.


brandonjew/mcLMM documentation built on Dec. 19, 2021, 11:42 a.m.