 Binomial and Poisson Counts with Vari...    Message/Author  Bob H posted on Wednesday, June 09, 2004 - 5:14 pm
Is it possible to model rates in Mplus when each observation has a numerator and denominator (e.g., either a binomial rate or a Poisson rate)? For example, if observations are at the hospital-level, hospital k would have d(k) deaths arising from n(k) surgeries. For Poisson (count) data it is usual to specify log(n(k)) as an independent variable with its coefficient fixed at 1 (offset term).  Linda K. Muthen posted on Thursday, June 10, 2004 - 8:16 am
We don't explicitly model rates in Mplus, but we do allow the regression of one count variable on another count variable. Can you send the reference for your last sentence?  Bob H posted on Thursday, June 10, 2004 - 4:11 pm
I don't have a reference handy, but the idea is straightforward. A Poisson regression is usually written as a (generalized) log-linear model. For example if Y is a Poisson count:
log(Y) = a + bx
If you want to model the rate, say the count per month, and you observe a count of Y in M months, then you could model the count per month:
log(Y/M) = a + bx
which can be rewritten:
log(Y) = a + bx + log(M)
The term log(M) is called an offset because its coefficient is forced to have a value of 1.0 (it is not estimated). Can this model be fit in Mplus? Is there a way to constrain a regression coefficient to have a constant value in Mplus?  bmuthen posted on Thursday, June 10, 2004 - 4:20 pm
This looks doable in Mplus V3. You would declare Y as a count variable (either Poisson or zero-inflated Poisson) in the Variable command and then in the model command you specify the regression

y on x logM@1;

so that you estimate the intercept and the slope for x, while the slope for the new variable logM (created in the Define command) has its slope fixed at 1.  Bob H posted on Thursday, June 10, 2004 - 10:18 pm
Terrific! Thanks. So we can model Poisson rates. I think we can also model binomial rates.

For the binomial each observation has k(i) out of n(i) trials. I want to use logistic regression to model the success rate p(i), which might depend on some covariates x(i), so we are assuming k(i) is distributed as binomial[n(i),p(i)]. I can replace each original observation with two observations: one observation with Y=1 and a frequency weight = k(i), and a second observation with Y=0 and frequency weight = n(i)-k(i). I would also duplicate the x-values on each of the two observations. I would declare Y to be CATEGORICAL, and specify the analysis TYPE = LOGISTIC. Would that work?  Bob H posted on Thursday, June 10, 2004 - 10:37 pm
In the last post, I should have said each observation has k(i) successes out of n(i) trials.  bmuthen posted on Friday, June 11, 2004 - 9:57 am
Would be interesting if you could try this out on some known example.  bobh posted on Friday, June 11, 2004 - 11:14 am
I just read in the Mplus User's Guide that frequency weights cannot be used when TYPE=LOGISTIC.  bmuthen posted on Friday, June 11, 2004 - 11:19 am
But you don't need to use Type = Logistic to do this - you can simply request estimator = ml and then it will do logistic regression. That goes down a different track in Mplus which allows frequency weights. See the last paragraph in UG example 3.5 and the corresponding example on the Mplus CD where this is explicitly done.  Hillary Schafer posted on Thursday, December 10, 2009 - 9:25 am
Following up on the previous posts, is it possible to specify a binomial (n,p) distribution for variables in the latest version of Mplus?
Thank you.  Tihomir Asparouhov posted on Thursday, December 10, 2009 - 11:44 am
It is not possible to specify this distribution directly. I think however you can rearrange the data and use the binary input to estimate most models. In your data instead of the binomial variable use n binary variables some of them 0 and some of them 1 so that it corresponds to binomial count. If n varies across individual you can specify this as a binary univariate (long) twolevel model. You can also consider as an approximation the offset approach using Poisson distribution. See this thread
http://www.statmodel.com/discussion/messages/23/781.html?1255011004
This approximation is theoretically solid when p is small, i.e., when p is small Poisson (np)=Binomial(n,p). By symmetry you can use that even when p is large.  Jens Jirschitzka posted on Sunday, December 30, 2012 - 9:36 pm
I would like to create a CFA model with one factor and four count indicators. But each count indicator separately needs an offset correction for different exposure times (e.g. person m has another exposure time for y1 than for y2 etc.). So I have four count outcomes y1-y4 and four different log transformed exposure time variables ln1-ln4 (the Poisson regression coefficients for ln1-ln4 was fixed at 1).
Is this model doable in Mplus in the following way:

factor BY y1-y4*;
factor@1;
y1 ON ln1@1;
y2 ON ln2@1;
y3 ON ln3@1;
y4 ON ln4@1;
! the 4 Intercepts are free parameters

Thank you
and best wishes for the new year!  Bengt O. Muthen posted on Monday, December 31, 2012 - 12:56 pm
Yes, this looks right.  Steven A. Miller posted on Monday, March 27, 2017 - 2:20 pm
I'm trying to compare the Mplus output of a ZIP model with the R output from PSCL. PSCL gives me this:

Number of iterations in BFGS optimization: 13
Log-likelihood: -98.51 on 4 Df

However, Mplus gives me this:

Number of Free Parameters 3

Loglikelihood

H0 Value -99.286

Can you tell me what accounts for the difference in the models?

Thanks,
Steve  Bengt O. Muthen posted on Thursday, March 30, 2017 - 9:24 am
Check that you have the same number of parameters. Sharpen the convergence criterion in Mplus using the mconvergence option.    Topics | Tree View | Search | Help/Instructions | Program Credits Administration