*! version 0.12.4 13dec2018

Title

rctmiss -- Analyse a randomised controlled trial (RCT) allowing for informatively missing outcome data.

Description

rctmiss analyses a randomised trial with missing outcome data under a range of assumptions about the missing data.
For example, if a main analysis has been performed under an assumption of missing at random (MAR), then rctmiss can be used to assess the sensitivity of the results to plausible departures from MAR.
This forms a part of an intention-to-treat analysis strategy (White et al, 2011).

The data and missingness are modelled jointly using either
a pattern-mixture model (modelling the differences between missing and observed data)
or a selection model (modelling the missing data mechanism).
Assumptions about the missing data are expressed via a sensitivity parameter delta which measures the degree of departure from missing at random.
I recommend the use of the pattern-mixture model as it usually makes the sensitivity parameter delta easier to interpret.
Results can be obtained for a single assumption (a single value of delta, possibly varying between individuals),
or graphed over a range of assumptions (a range of values of delta).

Syntax

rctmiss, options: estimation_command

where estimation_command is the substantive analysis that would be performed in the absence of missing data:
a regression of an outcome y on covariates x.
Randomised group is one of the covariates in x.

Model options
pmmdelta(IM_exp) Specifies a pattern-mixture model (PMM) analysis: see Specifying delta.

smdelta(IM_exp) Specifies a selection model (SM) analysis: see Specifying delta.

auxiliary(varlist) Specifies any auxiliary variables --
variables that are not in the substantive model
but are in the imputation model (for PMM analysis) or the missingness model (for SM analysis).

fullsandwich In a PMM analysis,
specifies that the full sandwich estimation method is to be used: see
Missing values of outcome: pattern mixture model.

sens(varname[,suboptions])
Defines the randomised group variable (which must be coded 0/1)
whose coefficient is to be explored as the sensitivity parameter delta varies in a sensitivity analysis.
If not specified, then the analysis uses a single value of delta.
Suboptions for the sensitivity analysis
and
suboptions for the sensitivity analysis graph
are described below.

Suboptions of sens() for the sensitivity analysis

senstype(string) senstype(equal|unequal) requests sensitivity analyses with delta equal/unequal across randomised groups;
senstype(all) (the default) requests all sensitivity analyses.
The sensitivity analyses are defined in Graphical sensitivity analyses.

list or list(options) Requests a listing of the sensitivity analysis results.

savedta(file[,replace]) Writes the sensitivity analysis results to the specified file.

clear Clears the current data and loads the sensitivity analysis results into memory. This is useful for editing the graph command, which is stored in F9.

nograph Suppresses graph. Only allowed with list, savedta or clear option.

Suboptions of sens() for the sensitivity analysis graph

stagger(#) Controls the horizontal separation of the different sensitivity analyses at each value of delta.

colors(string) Up to three colours for sensitivity analyses.

lwidth(#) Line width option for the whole graph.

lpatterns(string) Names line patterns for sensitivity analyses;
or, with the ciband option, for point estimate and confidence limits.

msymbol(string) Symbol style option for the graph.
Use msymbol(none) to suppress marker symbols.

ciband Joins confidence limits to each other (as a confidence band) rather than to the point estimates (as in a forest plot).

graph_options Other options for twoway graphs: for example name(), saving(), ylab(), title() etc.

Handling incomplete baseline variables
basemiss(mean|mim [, min(#)]) See Missing values of baseline covariates.
basemiss(mean) (the default) imputes missing values of baseline variables with the mean of all observed values.
basemiss(mim) applies the missing indicator method which also includes a dummy variable for missingness of any baseline variable with # or more missing values: default # is 3.
I don't recommend excluding observations with missing baseline values;
if you want to do this then you must use if or in on your estimation command.

Display
eform(string) Reports estimated coefficients on the exponentiated scale, named as string.
eform(Odds ratio) is the default when the main command is logistic.

Selection model options
nosw Causes the weights not to be stabilised.

savewt(newvarname) Saves the weights as newvarname.

nommconstant Omits the constant from the missingness model.

Graphical sensitivity analyses

rctmiss presents, by default, three sensitivity analyses:

1. delta varies over the specified range in arm 1 only, and takes its base value (usually 0) in arm 0.

2. delta is equal in the two arms and varies over the specified range.

3. delta varies over the specified range in arm 0 only, and takes its base value (usually 0) in arm 1.

Specifying delta

In options smdelta(IM_exp) and pmmdelta(IM_exp), IM_exp defines the informatively missing parameter delta with the syntax:

expression|numlist, [expdelta base(#)]

If sens(varname) is not specified, the main argument must be an expression, giving a single analysis.

If sens(varname) is specified, the main argument must be a numlist, giving a sensitivity analysis.

expdelta indicates that the main argument gives exp(delta). If this is 0 then delta is taken as -999.

base(#) is used when sens(varname) is specified,
and indicates the value of delta assumed in sensitivity analyses 1 and 3. Default is base(0) meaning MAR.

Missing values of outcome: pattern mixture model

Under the pattern mixture model approach,
the assumptions about the missing data are expressed as the coefficient of m in a model for y on x and m.
For linear regression, the coefficient is the difference between
the mean unobserved outcome and the mean observed outcome.
For logistic regression, the coefficient is the log odds ratio between the outcome and missingness,
and equals the log IMOR of Higgins et al (2008).

Estimation follows the mean score method
which uses the imputation model to construct and solve the expected score equation
(see White et al 2017).
There are two options for the variance:

1. Full Sandwich method: the most general method.
Variances are computed from a sandwich variance which takes proper account
of the same data being used in imputation and substantive models.

2. Two Regressions method: only applicable for linear regression without auxiliary variables.
Here the regression coefficients for the substantive model are expressed as the sum of two regressions
(the complete cases analysis plus a correction term),
and the final variance is the sum of the two variances.

The Full Sandwich method is used if the Two Regressions method is not applicable
or if the fullsandwich option is specified.

Missing values of outcome: selection model

Using the selection model approach, the assumptions about the missing data are expressed
as the coefficient of y in a model for m on x and y (selection model):
the coefficient is the increase in the log odds of missingness for a 1-unit increase in y.
If y is binary then this is again the log IMOR of Higgins et al (2008).

Missing values of baseline covariates

Missing values of a baseline covariate are handled in an unusual (and superior) way.
Stata's usual way is to drop observations with missing values of any baseline covariate.
This is not recommended in a RCT (White & Thompson, 2005).
Instead, rctmiss imputes missing values of a covariate with the mean of the observed values of that covariate (computed across all randomised groups),
or with the basemiss(mim) option, using the missing indicator method.
To get Stata's standard procedure, you need to explicitly exclude observations, e.g. using rctmiss: reg y rand x if !missing(x).

Including a missing indicator for a variable with 1 missing value amounts to dropping that observation,
which is undesirable.
By default, rctmiss therefore only includes missing indicators
for variables with 3 or more missing values;
you can change this using the basemiss(mim, min(#)) option.

What substantive analyses are allowed?

At present, estimation_command must use regress, logistic / logit or poisson.
if and in are allowed.
Weights are not allowed, except that (experimentally) iweights may be used with the full sandwich method.

The following estimation_command options are allowed:

robust only affects the complete-case analysis in the Two Regressions method.
Otherwise, robust variances are used throughout.

noconstant applies to the substantive model and (in the PMM case) to the imputation model.

cluster(varname) and vce(cluster varname)
modify variance calculations in all models.

Other options may work but have not been tested.

Limitations

Only two-arm trials are supported at present.

Stata 11 factor variables are not supported: you need to use xi before rctmiss.
That is, use xi:rctmiss... and not rctmiss:xi....

The only regression commands currently allowed are regress, logistic/logit and poisson.

Examples

UK500 data (quantitative outcome)

. use http://www.homepages.ucl.ac.uk/~rmjwiww/stata/missing/uk500.dta, clear

Analysis assuming MAR, dropping missing baselines:

. reg sat96 rand sat94 i.centreid

Analysis assuming MAR, with mean imputation for missing baselines:

. gen sat94fill = sat94

. summ sat94

. replace sat94fill = r(mean) if mi(sat94)

. reg sat96 rand sat94fill i.centreid

Same using rctmiss:

. xi: rctmiss, pmmdelta(0): reg sat96 rand sat94 i.centreid

Single MNAR analysis, assuming missing values are 5 units lower than observed values in both arms:

. xi: rctmiss, pmmdelta(-5): reg sat96 rand sat94 i.centreid

Sensitivity analysis, assuming missing values are from 0 to 10 units lower than observed values,
in one arm or in both arms:

. xi: rctmiss, sens(rand) pmmdelta(-10/0): reg sat96 rand sat94 i.centreid

Improving appearance:

. xi: rctmiss, sens(rand, legend(rows(3)) title(Sensitivity analysis for UK500 data)) pmmdelta(-10/0) stagger(0.05) list(sepby(delta)): reg sat96 rand sat94 i.centreid

Smoking data (binary outcome)

. use http://www.homepages.ucl.ac.uk/~rmjwiww/stata/missing/smoke.dta, clear

. tab rand quit, miss

Analysis assuming missing = smoking:

. gen quit2 = quit

. replace quit2 = 0 if missing(quit)

. logistic quit2 rand

Same analysis using rctmiss:

. rctmiss, pmmdelta(0, expdelta): logistic quit rand

Sensitivity analysis based around missing=smoking:

. rctmiss, sens(rand) pmmdelta(0(0.1)1, expdelta base(0)): logistic quit rand

References

White IR, Carpenter J, Horton NJ.
A mean score method for sensitivity analysis
to departures from the missing at random assumption in randomised trials.
Statistica Sinica 2018;28:1985–2003.
http://www3.stat.sinica.edu.tw/statistica/J28N4/J28N415/J28N415.html

White IR, Horton NJ, Carpenter J, Pocock SJ. An intention-to-treat analysis strategy for randomised trials with missing outcome data. British Medical Journal 2011;342:d40.
http://www.bmj.com/content/342/bmj.d40.full

Higgins JPT, White IR, Wood AM. Imputation methods for missing outcome data in meta-analysis of clinical trials. Clinical Trials 2008; 5: 225-239.
http://ctj.sagepub.com/content/5/3/225.short

White IR, Thompson SG. Adjusting for partially missing baseline measurements in randomised trials. Statistics in Medicine 2005; 24: 993-1007.
http://onlinelibrary.wiley.com/doi/10.1002/sim.1981/abstract

Author and updates

Ian White, MRC Clinical Trials Unit at UCL, London, UK.
Email ian.white@ucl.ac.uk.

You can get the latest version of this and my other Stata software using
net from http://www.homepages.ucl.ac.uk/~rmjwiww/stata/.

I thank James Carpenter (MRC CTU at UCL, UK) and Nicholas Horton (Amherst College, USA)
for working with me on the theory behind this method,
and Tim Morris (MRC CTU at UCL, UK) for helpful comments on the progam.