prep_data_for_log_lik: Prepare the data for computing the log-likelihood

Description Usage Arguments Value

View source: R/02-likelihood.R

Description

Take in the parameter vector and the model_data and prepare the data for computing the log-likelihood. The log-likelihood is not permutation-invariant, which is a fancy math way of saying "it matters what order the parameters are in". Inside model_data, you have a named vector of control_days containing each subject's id and the number of control days they have in the data. The data is sorted in ascending order of id, in blocks with all control days followed by the case day. This function splits the parameter vector W into a list, with one item per id, containing the ordered elements of W corresponding to each subjects' control and case days.

Usage

1
prep_data_for_log_lik(W, model_data)

Arguments

W

Parameter vector. First n elements are eta, then Gamma and beta.

model_data

A list of class "cc_modeldata" as returned by model_setup().

Value

A list with n items (where n is the number of subjects) containing vectors of the parameters corresponding to each subject's control and case days.


awstringer1/casecrossover documentation built on March 11, 2021, 4:41 a.m.