mreg  R Documentation 
This software was created for the paper referred to below. If a longitudinal data base has regularly updated explanatory variables, but whose outcome variable is only intermittently collected then we can still perform exact maximum likelihood estimation of a regression model if the outcome variable is discrete.
mreg( formula, data, patid, start.theta = NULL, modify = unity, modify.p = 0, mod.formula = ~1, density.name = "negbin", link = "log", iterlim = 100, gradtol = 1e06, steptol = 1e06, na.action = NULL, print.level = 2, zero.start = FALSE )
formula 
This is a formula object e.g. Y~A+B to describe the location parameter 
data 
This is a data frame in which the variables are recorded 
patid 
In a longitudinal context this indexes the individuals. Note that the observations within each patient is assumed to be ordered according the timing of the observations. 
start.theta 
Optional vector of starting values for location and nuisance parameters 
modify 
We may wish to let the location depend on functions of
the previous outcomes. Since these may be missing, we have to
provide a function that can cope with all the potential values the
outcome may have taken. See 
modify.p 
This is the dimension of the parameters associated with the modify function. 
mod.formula 
If we require other variables to interact with the previous observation we must create a set of variables to use. This is a onesided formula e.g. ~X+Z, if we wanted to use those variables. 
density.name 
This is the density the increment in outcome is assumed to follow. It can be one of three values: negbin, poisson, geometric. 
link 
This is the link function g(mu)=eta. Where eta is a linear combination of covariates, and mu is the expected value of the outcome. The link function can be one of four values: identity, log, logit, hyper. 
iterlim 
The maximum number of iterations allowed for the

gradtol 
The parameter 
steptol 
The parameter 
na.action 
Parameter is not used: If any covariates are missing the function will return an error. 
print.level 
The parameter 
zero.start 
It may be the case that it is known that the first value of the outcome was zero for all individuals, in which case invoke this TRUE/FALSE option. 
It returns an object of class mreg
which is similar
to a lm
object. It has print
and
summary
methods to display the fitted parameters and standard errors.
Bond S, Farewell V, 2006, Exact Likelihood Estimation for a Negative Binomial Regression Model with Missing Outcomes, Biometrics
print.mreg
, summary.mreg
,
paper
, unity
data(public) mod1 < mreg( damaged~offset(log(intervisit.time))+esr.init, data=public,patid=ptno,print.level=2, iterlim=1000 ) ## Not run: mod.ncar <mreg(damaged ~ offset(log(intervisit.time)) + esr.init + tender + effused + clinic.time, data = public, patid = ptno, modify = paper, modify.p = 5, mod.formula = ~art.dur.init, density.name = "negbin.ncar", iterlim = 1000, print.level = 2) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.