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 at the end of May, and its replacement, statalist.org is already up and running.


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

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


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Number of observations for marginal means r(_N)
Date   Wed, 12 Jun 2013 09:47:08 -0500

All the observations are used, but the covariates are fixed at their
means for each category.

Perhaps you want -tab arm visit if e(sample)- ?

Scott



On Mon, Jun 10, 2013 at 9:32 AM, Ada Keding <ada.keding@york.ac.uk> wrote:
> 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/
*
*   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