[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: RE: graph bar, over() total?-- how do I get a bar with total over categories? --> Thank you!
Thank you for your quick response.
This helped tremendously.
I have weighted categorical data so I collapsed to
sums and followed the procedure with generating an
additional category for total in the over() variable.
Thank you! This is a wonderful resource.
Do you mean something like this?
sysuse educ99gdp, clear
set obs 11
replace country = "Total" in 11
qui sum pub
replace pub = r(sum) in 11
qui sum priv
replace priv = r(sum) in 11
generate total = private + public
graph hbar (asis) public private, ///
over(country, sort(total) descending) stack percent
title("Spending on tertiary education, by public and
span pos(11)) subtitle(" ") ///
note("Source: OECD, Education at a Glance
> -----Original Message-----
> From: email@example.com
> firstname.lastname@example.org] On Behalf Of Anna
> Sent: Thursday, April 20, 2006 8:41 AM
> To: email@example.com
> Subject: st: graph bar, over() total?-- how do I get
a bar with total over
> Dear all,
> I am trying to construct a bar graph over a
> categorical variable with a bar for total over the
> E.g. in the following example, I want an extra
> category called "Total" (over the countries listed)
> sysuse educ99gdp, clear
> generate total = private + public
> #delimit ;
> graph hbar (asis) public private,
> over(country, sort(total) descending) stack
> title("Spending on tertiary education, by public
> span pos(11))
> subtitle(" ")
> note("Source: OECD, Education at a Glance 2002",
> span) ;
> #delimit cr
> Thank you in advance!
> PS. Using Stat8/SE
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
* For searches and help try: