profile_out: Profiles out nuisance parameters from the observed-data...

View source: R/profile_out.R

profile_outR Documentation

Profiles out nuisance parameters from the observed-data log-likelihood for a given value of theta

Description

For a given vector theta to parameterize P(Y|X,C), this function repeats the EM algorithm to find the values of gamma and p at convergence. The resulting parameters are used to find the profile log-likelihood for theta by plugging them into the observed-data log-likelihood. This function is used by pl_theta().

Usage

profile_out(
  theta,
  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,
  gamma0,
  p0,
  p_val_num,
  TOL,
  MAX_ITER
)

Arguments

theta

Parameters for the analysis model (a column vector)

n

Phase II sample size

N

Phase I sample size

Y_unval

Column with the unvalidated outcome (can be name or numeric index)

Y_val

Column with the validated outcome (can be name or numeric index)

X_unval

Column(s) with the unvalidated predictors (can be name or numeric index)

X_val

Column(s) with the validated predictors (can be name or numeric index)

C

(Optional) Column(s) with additional error-free covariates (can be name or numeric index)

Bspline

Vector of columns containing the B-spline basis functions (can be name or numeric index)

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 data that pertain to the predictors in the analysis model.

gamma_pred

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

gamma0

Starting values for gamma, the parameters for the outcome error model (a column vector)

p0

Starting values for p, the B-spline coefficients for the approximated covariate error model (a matrix)

p_val_num

Contributions of validated subjects to the numerator for p, which are fixed (a matrix)

TOL

Tolerance between iterations in the EM algorithm used to define convergence.

MAX_ITER

Maximum number of iterations allowed in the EM algorithm.

Value

Profile likelihood for theta: the value of the observed-data log-likelihood after profiling out other parameters.


sarahlotspeich/logreg2ph documentation built on July 24, 2022, 6:34 p.m.