*! version 1.0 22Oct2016

Title

wtdtttdiag -- Obtain diagnostic plots
assessing the fit of an estimated parametric Waiting Time
Distribution (WTD) with respect to the observed histogram of
prescription redemptions.

Syntax

wtdtttdiag
varname [if] [in], [reverse
nbins(integer)
nq(integer)
replace
twoway options]

Description

wtdtttdiag produce a diagnostic plot, i.e. a
histogram based on observed prescription redemptions and the
corresponding fitted parametric model of a previous call to wtdttt or ranwtdttt - the latter only if the estimation procedure has converged. wtdtttdiag should be executed immediately after the
relevant wtdttt or ranwtdttt estimated model you want to assess the fit of.
Note that wtdtttdiag is only useful when you did not specify
covariates in your wtdttt or ranwtdttt model.

Options

nbins(integer) The number of bins plotted in the
histogram. If not specified it is taken to be the integer part of
min, where n is the number of observations.

nq(integer) Number of points used in plotting the fitted
distribution. The default value is 300.

replace Replace current dataset with a dataset
containing the values used to make the plot.

Graph options Graph options are allowed which allows
you to control the visual characteristics of the plot. Particularly
useful options include ytitle, legend, lpattern
and fcolor. For a full list of options see
twoway options.

Examples

A simple example assessing the fit of a Log-Normal model

. wtdttt rx1time, disttype(lnorm)

. wtdtttdiag rx1time

An example with a reverse WTD based on a Weibull distribution and
where data used in the plot replace the current dataset in Stata's
memory:

. wtdttt rx1time, reverse disttype(wei) iadpercentile(0.8)

. wtdtttdiag rx1time, replace

Further examples are provided in the example do-file
wtdttt_ex.do, which contains analyses based on the datafile
wtddat.dta - a simulated dataset, which is also enclosed.

Author

Katrine Bødkergaard Nielsen, Aarhus University, kani@clin.au.dk.

Henrik Støvring, Aarhus University, stovring@ph.au.dk.