Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Number of observations for marginal means r(_N)


From   Ada Keding <ada.keding@york.ac.uk>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Number of observations for marginal means r(_N)
Date   Mon, 10 Jun 2013 15:32:38 +0100

Dear all,

I am having trouble extracting the number of observations on which
estimates for group means at different time points (visits) are based
in a mixed model.


My data is saved in long format, and the model looks something like this:

          xtmixed outcome i.arm i.visit i.arm##i.visit i.covariate ||
id:visit, cov(un) reml

I then extract marginal means with 'margins'

          margins arm##visit, atmeans

This gives means and confidence intervals for the outcome of each arm
at each visit, but not the number of associated observations. As far
as I gather, these are saved as r(_N).
When I call up the matrix for r(_N)...

          matrix list r(_N)

... it gives the same number of observations for each margin however,
which is a large value that bears no resemblance to the number of IDs
in the data set. How can I extract the particular number of IDs used
at each margin?

Any pointers are much appreciated.

Many thanks,

Ada


Ada Keding
University of York
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index