Sequential response selection model (source code)

= Sequential response selection model
{title2=$q_j(y)=\mathbb P(A\geq j\mid A\geq j-1,Y=y)$}

Suppose outcome collection stops at the first success or after $m$ unsuccessful attempts, and let $A$ count unsuccessful attempts. Conditional on the outcome $y$, put $q_j(y)=\mathbb P(A\geq j\mid A\geq j-1,Y=y)$. For $k<m$, the joint density of $A=k$ and an observed $Y=y$ is
$$
f_\beta(y)\left(\prod_{j=1}^{k}q_j(y)\right)(1-q_{k+1}(y)).
$$
For $A=m$, the unobserved outcome is integrated out, giving $\int f_\beta(y)\prod_{j=1}^m q_j(y)\,dy$. These probabilities sum to one by telescoping and integration. Dependence of $q_j$ on $y$ models <missing not at random>. If all $q_j$ are independent of $y$ conditional on the regression predictors, the outcome density among responders remains $f_\beta$, as required for <complete-case analysis> of that conditional model.