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]

Re: st: adjusted twoway table


From   "Lima, Julie" <julie_lima@brown.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: adjusted twoway table
Date   Fri, 19 Aug 2011 11:34:06 -0500

Terrific -- thank you for the help!

On Fri, Aug 19, 2011 at 8:05 AM, Maarten Buis <maartenlbuis@gmail.com> wrote:
> On Fri, Aug 19, 2011 at 1:54 PM, Lima, Julie <julie_lima@brown.edu> wrote:
>> Yes -- I'm using mlogit with caregiver arragement as dependent
>> variable, the primary caregiver variable as dummies in the model
>> (ref=wife) and then a slew of covariates.
>
> You can get a nicer looking table this way:
> *--------------- begin example ----------------
> // prepare some data
> // caregiver arrangement = occ
> // primary caregiver = marst
> sysuse nlsw88, clear
> gen occ = cond(occupation < 3, 1 ,     ///
>          cond(occupation < 7, 2, 3 )) ///
>          if !missing(occupation)
> label define occ 1 "higher" ///
>                 2 "middle" ///
>                 3 "lower"
> label value occ occ
>
> gen marst = married + 2* never_married
> label define marst 0 "divorced/widowed" ///
>                   1 "married"          ///
>                   2 "never married"
> label value marst marst
>
> // estimate model
> mlogit occ i.marst grade i.race
>
> // fix values of explanatory variables
> preserve  // so we can later recover original data
> replace grade = 12 // finished highschool
> replace race = 1   // white
>
> // predict probability
> predict pr* if e(sample), pr
>
> // expected count is sum of probabilities
> collapse (sum) pr* if e(sample), by(marst)
> reshape long pr , i(marst) j(occ)
> label value occ occ
> tabdisp occ marst, cellvar(pr)
>
> restore
> *------------- end example ------------------------
> (For more on examples I sent to the Statalist see:
> http://www.maartenbuis.nl/example_faq )
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
>
> http://www.maartenbuis.nl
> --------------------------
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>



-- 
*************************************
Julie Lima, MPH, PhD
Senior Research Analyst
Brown University
Center for Gerontology and Health Care Research
Providence, RI

Mailing Address
1316 Old Oak Trail
Flower Mound, TX 75028
p: 972-355-7814

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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