% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update_possible_subj_data.R
\name{update_possible_subj_data}
\alias{update_possible_subj_data}
\title{Update subject-level data with posterior probabilities}
\usage{
update_possible_subj_data(
  obs_data_possibilities,
  MAA_model,
  participant_level_data,
  omega_hat
)
}
\arguments{
\item{obs_data_possibilities}{A \link{data.frame} containing all possible
observation-level data combinations, including ID, S (possible
seroconversion dates), and Y (MAA classifications).}

\item{MAA_model}{A fitted \code{\link[stats:glm]{stats::glm()}} model object used to predict
P(Y=1|T=t), the probability of MAA-positive status given time since
seroconversion.}

\item{participant_level_data}{A \link{data.frame} containing participant-level
information, including ID, Stratum, and P(S>=l|E=e) (the probability
that seroconversion occurs on or after the last negative test date).}

\item{omega_hat}{A \link{data.frame} containing estimated parameters for the
seroconversion date distribution model, including S, Stratum,
P(S=s|S>=s,E=e), and P(S>s|S>=s,E=e).}
}
\value{
A \link{data.frame} containing updated subject-level data with the
following columns:
\itemize{
\item \code{ID}: Participant identifier
\item \code{Stratum}: Stratification variable
\item \code{S}: Possible seroconversion date
\item \verb{P(Y=y|T=t)}: Probability of observed MAA outcomes given time since
seroconversion
\item \verb{P(S=s|E=e)}: Marginal probability of seroconversion at time s given
enrollment date
\item \code{P(S=s|e,l,r,o,y)}: Posterior probability of seroconversion at time s
given all observed data (used to estimate omega and theta)
\item \code{P(S>=s|e,l,r,o,y)}: Posterior probability that seroconversion occurs
on or after time s (used to estimate omega)
}
}
\description{
Internal helper function that updates subject-level data by computing
various conditional probabilities used in the EM algorithm for
fitting the joint model. This function combines observation-level
predictions with participant-level data and omega estimates to compute
posterior probabilities needed for parameter estimation.
}
\keyword{internal}
