Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: visualize -svy : tab x y-
From
Stas Kolenikov <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: visualize -svy : tab x y-
Date
Wed, 15 Jan 2014 13:10:43 -0600
Folks,
Suppose I want to visualize something like
webuse nhanes2, clear
svy : tab race hlthstat, se row
in a way similar to what -marginsplot- does.
The first natural idea that I thought of was to run
svy: proportion hlthstat, over(race)
only to discover that -margins- does not support -proportion-
(although this seems like a no-brainer for -margins- to work on --
just redisplay verbatim what -proportion- did).
My next step was to try
svy : mlogit hlthstat i.race
which essentially is a weird way to compute the log odds ratios
against a given category. Now, -margins- does work, but it only gives
the proportions for a single outcome, like hlthstat==1, and I cannot
seem to find a way to produce several margins over several equations
(although that makes perfect sense for -mlogit-), and hence plot them
with -marginsplot- afterwards. In -marginsplot- terms, this could be
something like a dimension to plot over, so may be another possible
-dimlist- could be equations in a multi-equation command. (Consider
this a feature request!)
I am sure the question of how to visualize the cross-tabs is not that
far-fetched, so there should be something Phil Enders or Michael
Mitchell have produced... that I am missing here. There was a
discussion as far back as 2006
(http://www.stata.com/statalist/archive/2006-09/msg00506.html), but
-margins- is a much later development, as far as I can recall, so the
ways to adapt -margins- may have been discovered since then.
-- Stas Kolenikov, PhD, PStat (ASA, SSC)
-- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name
*
* 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/