  This paper considers treatment effects under endogeneity with complex
heterogeneity in the selection equation. We model the outcome of an endogenous
treatment as a triangular system, where both the outcome and first-stage
equations consist of a random coefficients model. The first-stage specifically
allows for nonmonotone selection into treatment. We provide conditions under
which marginal distributions of potential outcomes, average and quantile
treatment effects, all conditional on first-stage random coefficients, are
identified. Under the same conditions, we derive bounds on the (conditional)
joint distributions of potential outcomes and gains from treatment, and provide
additional conditions for their point identification. All conditional
quantities yield unconditional effects (\emph{e.g.}, the average treatment
effect) by weighted integration.
