  Extending (generalizing or transporting) causal inferences from a randomized
trial to a target population requires ``generalizability'' or
``transportability'' assumptions, which state that randomized and
non-randomized individuals are exchangeable conditional on baseline covariates.
These assumptions are made on the basis of background knowledge, which is often
uncertain or controversial, and need to be subjected to sensitivity analysis.
We present simple methods for sensitivity analyses that do not require detailed
background knowledge about specific unknown or unmeasured determinants of the
outcome or modifiers of the treatment effect. Instead, our methods directly
parameterize violations of the assumptions using bias functions. We show how
the methods can be applied to non-nested trial designs, where the trial data
are combined with a separately obtained sample of non-randomized individuals,
as well as to nested trial designs, where a clinical trial is embedded within a
cohort sampled from the target population. We illustrate the methods using data
from a clinical trial comparing treatments for chronic hepatitis C infection.
