Statalist


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

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


From   Richard Palmer-Jones <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: Useing e(over_labels)
Date   Sat, 11 Jul 2009 18:10:56 +0100

Well, it now works for me after some fiddling. Thanks.

The original code from Austin works fine for small sets of "over"
variables, but seems to be limited by the limitations of macros; so no
more than 32 items and 244 characters, if I read the limitations
correctly. Thus Austin's .ado "matnames" truncates the list of
rownames if the equation name is long, and, or there are a lot of
"over" combinations - which there are in my example.

Labels are apparently not so restricted as macros, nor seemingly is
the macro e(over_labels). This seems strange to me - ereturn macros
having different limits to local or  global macros. Or, is there
something I have missed (again)?


Richard







On Fri, Jul 10, 2009 at 7:42 PM, Richard
Palmer-Jones<[email protected]> wrote:
> I am sorry about my inability to explain myself - but you seem to have
> understood what I want!
>
> Your code looks like what I am after, but I will have to see if I can
> get it to work with the real data.
>
> Thanks again, really
>
> Richard
>
>
> On Fri, Jul 10, 2009 at 7:12 PM, Austin Nichols<[email protected]> wrote:
>> 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/
>>
>

*
*   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