Learn R Programming

mmrm (version 0.3.14)

h_get_kr_comp: Obtain Kenward-Roger Adjustment Components

Description

Obtains the components needed downstream for the computation of Kenward-Roger degrees of freedom. Used in mmrm() fitting if method is "Kenward-Roger".

Usage

h_get_kr_comp(tmb_data, theta)

Value

Named list with elements:

  • P: matrix of \(P\) component.

  • Q: matrix of \(Q\) component.

  • R: matrix of \(R\) component.

Arguments

tmb_data

(mmrm_tmb_data)
produced by h_mmrm_tmb_data().

theta

(numeric)
theta estimate.

Details

the function returns a named list, \(P\), \(Q\) and \(R\), which corresponds to the paper in 1997. The matrices are stacked in columns so that \(P\), \(Q\) and \(R\) has the same column number(number of beta parameters). The number of rows, is dependent on the total number of theta and number of groups, if the fit is a grouped mmrm. For \(P\) matrix, it is stacked sequentially. For \(Q\) and \(R\) matrix, it is stacked so that the \(Q_{ij}\) and \(R_{ij}\) is stacked from \(j\) then to \(i\), i.e. \(R_{i1}\), \(R_{i2}\), etc. \(Q\) and \(R\) only contains intra-group results and inter-group results should be all zero matrices so they are not stacked in the result.