We generalize estimation and inference from a study with a biased sample due to recruitment/consent processes to a target population with different composition. An omitted variable capturing “motivation” causes selection bias. If the probability of consent and study outcomes are both influenced by motivation (likely in trials of behavioral interventions), study power and/or estimation will be compromised. The latent factor “motivation,” though unmeasured, may be a factor that loads on multiple measurable quantities (questionnaire items, socio-economic status, or disease severity). We form a proper weighting mechanism to make inference on the target population from the recruited sample. The unmeasured “motivation” is balanced over treatment by randomization. We weight each observation to make inference on the target population or another sample with a different distribution of the latent factor. We assume that the heterogeneous treatment effect caused by latent motivation cannot be predicted by measured variables. Our objective is to account for treatment modifiers that are omitted or impractical to quantify. The approach complements typical inverse probability weighting approaches.