Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: RE: Useing e(over_labels)


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: Useing e(over_labels)
Date   Fri, 10 Jul 2009 14:12:02 -0400

Richard Palmer-Jones<[email protected]> :
"9 panels with two lines each with their CIs" means nothing to me.
Do you mean you want to connect plotted means with line segments?
Just explain in plain English what you want, or show code producing
the graphs you want with real numbers in the example.
As it is, you are imposing a huge cost on the folks you want help
from, making them guess what you want.

clear all
ma drop _all
ssc inst matnames, replace
webuse nhanes2
la def smsa 1 "City" 2 "Noncity SMSA" 4 "NonSMSA"
la val smsa smsa
la def region 2 "NW", modify
egen subpop=group(smsa region), label
qui ta subpop, gen(i_) label
svy: mean bpsystol, over(subpop) nohe noleg
mat b=e(b)'
mat rownames b=`e(over_labels)'
mat v = vecdiag(e(V))'
mat rownames v=`e(over_labels)'
qui levelsof smsa, loc(levs1)
qui levelsof region, loc(levs2)
forv i=1/3 {
forv j=1/4 {
matnames b
loc w: word `=`i'*`j'' of `r(r)'
loc b=el(matrix(b),rownumb(matrix(b),"`w'"),1)
loc v=el(matrix(v),rownumb(matrix(v),"`w'"),1)
loc p`i' "`p`i'' `=`b'-invttail(e(N_psu)-e(N_strata),.025)*sqrt(`v')' `j' "
loc p`i' "`p`i'' `=`b'+invttail(e(N_psu)-e(N_strata),.025)*sqrt(`v')' `j' "
loc b`i' "`b`i'' `b' `j'"
loc xl`i' `"`xl`i'' `j' "`:lab (region) `:word `j' of `levs2'''""'
loc ti`i':lab (smsa) `:word `i' of `levs1''
}
tw pci `p`i'' || scatteri `b`i'', c(l) xla(`xl`i'') ti(`ti`i'')
leg(off) name(n`i')
}
gr combine n1 n2 n3, nocopies ycommon col(3) xsize(9)


On Fri, Jul 10, 2009 at 1:25 PM, Richard
Palmer-Jones<[email protected]> wrote:
> 9 panels with two lines each with their CIs -
>
> One can do what I want with lowess graphs, but in the end I need
> something parametric - and in the case at issue the .
>
> For further details I would prefer to take this off Statalist - if
> that is consistent with protocols. I am happy to put any further stata
> discussion back into the list, but not details of my work.
>
> Richard
>
>
>
> On Fri, Jul 10, 2009 at 6:08 PM, Austin Nichols<[email protected]> wrote:
>> So, you want 9 graphs with 50 "bars" each?
>>
>> On Fri, Jul 10, 2009 at 12:52 PM, Richard
>> Palmer-Jones<[email protected]> wrote:
>>> I should add that I want graphs for depvar on xvar for each region
>>> with CIs (in this hypothetical case) - and the actual design has many
>>> more values of X (50 or more) and 9 or thereabouts "regions".
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index