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: RE: Graphing Stacked Likert Scale With Neutral in Middle


From   Joerg Luedicke <joerg.luedicke@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Graphing Stacked Likert Scale With Neutral in Middle
Date   Fri, 20 Jul 2012 19:46:42 -0500

I am not quite sure if I understand what exactly you want. How about this one?

*-----Example---------------
//Plot health status by gender
webuse nhanes2

replace hlthstat=. if hlthstat==8

gen freq=1
gen freq_m=1 if sex==1
gen freq_f=1 if sex==2
label def empty 1"-", replace
label val freq empty

loc size="huge"

catplot hlthstat freq, over(sex, gap(50) label(labsize(`size')))
percent(freq_m freq_f) stack ///
blabel(bar,pos(center) format(%2.0f) size(`size') box)  ///
legend(label(1 "excellent") label(5 "poor") textwidth(50) cols(1)
position(3) size(`size') ///
region(fcolor(gs16) margin(`size')) rowgap(20) symxsize(10)
symysize(20)) ytitle(" ") ///
bar(1, color(blue)) bar(2, color(midblue)) bar(3, color(green)) bar(4,
color(midgreen)) bar(5, color(maroon)) ///
ysize(1) xsize(4) title("Health status, by gender", size(`size'))  ///
ylabel(none) ytick(0(20)100) ylabel(0(20)100, labsize(`size'))
ymlabel(10(20)90, labsize(large)) ///
name(hst1, replace)
*---------------------------


On Fri, Jul 20, 2012 at 7:17 PM, Nick Cox <njcoxstata@gmail.com> wrote:
> David gives good advice.
>
> I never got round to implementing splitting of a middle category in
> -slideplot- (SSC).
>
> I'd commend instead -tabplot- (SSC). For some flavours, try
>
> sysuse auto
> tabplot foreign rep78
> tabplot foreign rep78, percent(foreign) showval
> tabplot rep78 foreign , percent(foreign) showval
> tabplot rep78 foreign , percent(foreign) showval horizontal
>
> -tabplot- conveys in a different way variations in distributions
> relative to the middle category.
>
> Nick
>
> On Fri, Jul 20, 2012 at 11:44 PM, David Radwin <dradwin@mprinc.com> wrote:
>
>> As described by the FAQ, Statalist members are admonished to provide the
>> author(s) and location of user-written programs. Although it may seem to
>> be an official Stata command, -catplot- is written by Nick Cox and is
>> available from SSC. (Members are also admonished to read the FAQ before
>> posting.)
>>
>> If you are willing to forgo showing the middle (neutral) category, you
>> might try -slideplot- (also by Nick Cox and available at SSC). If you must
>> show the middle category, the positives and negatives won't line up anyway
>> except in the rare instance when the two groups have exactly the same
>> proportion of neutral responses. Also, you may need to manipulate the data
>> first (as with -collapse- or -contract-) to get percentages or
>> proportions.
>
> Miles Witthaus
>
>>> I am attempting to display the answers to several survey questions based
>>> on 5-point Likert scales.  Currently, I am using catplot which nicely
>>> displays the different categories and what percent lies in each:
>>>
>>> catplot rate_contract, over(gender) asyvars stack perc(hire_charge)
>>> blabel(bar, position(center) format(%3.1f))
>>>
>>> However, this does not allow for a good comparison of the distribution
>> by
>>> gender.  I would like to try to make the median of the neutral category
>> 3
>>> be in the center of the graph and then have positives stacked on the
>> right
>>> and negatives to the left to allow for better comparison by gender.  Is
>>> there anyway to do this with catplot or other graphing means?
> *
> *   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/
*
*   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