Bookmark and Share

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]

Re: st: is something wrong with fvvarlist "i(3 4).role"?


From   László Sándor <[email protected]>
To   [email protected]
Subject   Re: st: is something wrong with fvvarlist "i(3 4).role"?
Date   Wed, 14 Jul 2010 12:02:53 +0200

Thanks, Jeff, this is really helpful.

I still must note that this behavior is not exactly what -help
fvvarlist- seems to imply (e.g. i(3 4). is said to include two
dummies...), nor what many (most?) users would use i#. operators for.
If I want to include two dummies, why would I lose one of them? Of
course, if the sample would be limited to include only these two
groups, and then use one as the base level, that would make sense. But
that is not what this operator does anyway.

Many thanks, still, and it is still quite easy to do what I needed,
once I know how to!

Laszlo

On Tue, Jul 13, 2010 at 5:09 PM, Jeff Pitblado, StataCorp LP
<[email protected]> wrote:
>
> Laszlo Sandor <[email protected]> is using the new factor variables notation,
> specifically the 'i.' operator with a numlist:
>
> > I think I have a straightforward question in the subject line.
> >
> > I use the up-to-date Stata on a mac. The factor variable handling does
> > not work as promised in the manual (cf. -h fvvarlist-). See the most
> > striking, simple example below. Or am I missing the obvious?
> >
> > Laszlo
> >
> >
> >
> > . sum i(3 4).role
> >
> >     Variable |       Obs        Mean    Std. Dev.       Min        Max
> > -------------+--------------------------------------------------------
> >       4.role |       747    .2503347     .433496          0          1
> >
> > . sum i(3/4).role
> >
> >     Variable |       Obs        Mean    Std. Dev.       Min        Max
> > -------------+--------------------------------------------------------
> >       4.role |       747    .2503347     .433496          0          1
>
> Michael Mitchell <[email protected]> replied explaining that
> level 3 of the 'role' variable is being treated as a reference level.
>
> By default, Stata suppresses the reference level from the output.  Here are a
> couple ways that Laszlo can change this behavior.
>
> 1.  Use the -baselevels- option to get -summarize- to report the reference
>    level.
>
>        . sum i(3 4).role, baselevels
>
>    Since the reference level pseudo variable '3b.role' will only take on the
>    values 0 or missing, the only useful information for -summarize- to report
>    is the number of non-missing values in the 'role' variable.
>
> 2.  Use the 'b.' operator to turn off the reference level logic:
>
>        . sum i(3 4)bn.role
>
>    This will summarize the indicators for both levels of 'role'.
>
> --Jeff
> [email protected]
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index