observed_data_loglik: Observed-data log-likelihood

View source: R/observed_data_loglik.R

observed_data_loglikR Documentation

Observed-data log-likelihood

Description

This function returns the value of the observed-data log-likelihood (equation (2) in Lotspeich et al. (2021)) for a given dataset and parameter values theta, gamma, and p.

Usage

observed_data_loglik(
  N,
  n,
  Y_unval = NULL,
  Y_val = NULL,
  X_unval = NULL,
  X_val = NULL,
  C = NULL,
  Bspline = NULL,
  comp_dat_all,
  theta_pred,
  gamma_pred,
  theta,
  gamma,
  p
)

Arguments

N

Phase I sample size

n

Phase II sample size

Y_unval

Column names with the unvalidated outcome. If Y_unval is null, the outcome is assumed to be error-free.

Y_val

Column names with the validated outcome.

X_unval

Column name(s) with the unvalidated predictors. If X_unval and X_val are null, all precictors are assumed to be error-free.

X_val

Column name(s) with the validated predictors. If X_unval and X_val are null, all precictors are assumed to be error-free.

C

(Optional) Column name(s) with additional error-free covariates.

Bspline

Vector of column names containing the B-spline basis functions.

comp_dat_all

Augmented dataset containing rows for each combination of unvalidated subjects' data with values from Phase II (a matrix)

theta_pred

Vector of columns in comp_dat_all that pertain to the predictors in the analysis model.

gamma_pred

Vector of columns in comp_dat_all that pertain to the predictors in the outcome error model.

theta

Parameters for the analysis model (a column vector)

gamma

Parameters for the outcome error model (a column vector)

p

B-spline coefficients for the approximated covariate error model (a matrix)

Validated

Column name with the validation indicator. The validation indicator can be defined as Validated = 1 or TRUE if the subject was validated and Validated = 0 or FALSE otherwise.

Value

Scalar value of the function


sarahlotspeich/logreg2ph_R_only documentation built on Jan. 20, 2025, 6:20 p.m.