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: RE: descriptive statistics of imputed data using by


From   "David Radwin" <dradwin@mprinc.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: descriptive statistics of imputed data using by
Date   Fri, 5 Apr 2013 11:18:30 -0700 (PDT)

Caitlin,

I can't speak to the imputation aspect, but the correct syntax for -mean-
over multiple subgroups is

mean mathf, over(pov_stat)

That may be the reason for the error message.

The -by- and -bysort- prefix is a separate method to execute -mean- and
other commands by subgroup, but the syntax is different. 

David
--
David Radwin
Senior Research Associate
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-849-4942
Fax: 510-849-0794

www.mprinc.com


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Caitlin Hamrock
> Sent: Friday, April 05, 2013 11:11 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: descriptive statistics of imputed data using by
> 
> .
> Hello,
> I am trying to create a table of descriptive statistics using imputed
> data, however I want to calculate the mean math score (my dependent
> variable) by poverty level (an ordinal independent variable which is
> also imputed) across all of my imputed data sets collectively.  I've
> tried using the following code:
> 
> mi estimate: mean mathf, by pov_stat
> 
> Stata doesn't like this and gives me an error message.  Since the
> poverty status variable is imputed, an individual coded 1 in the first
> imputed data set might be coded 2 in the second.  So then I tried
> this:
> 
> mi xeq: by pov_stat, sort: sum mathf
> 
> This gives me the mean math scores by poverty status independently for
> each imputed data set (I have one original data set and five imputed
> copies and thus 6 sets of means).
> 
> I have two questions:
> First, Is there a stata command that can give me means and standard
> deviations by poverty status across all of my imputed data sets
> simultatneously?
> Second, is it incorrect to calculate the average of the mean math
> scores across all my imputed data sets (exluding the incomplete data
> set _mi_m=0)?  how about the standard deviations?
> 
> Thank you,
> Caitlin
> *
> *   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