Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

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

 From László Sándor To statalist@hsphsun2.harvard.edu 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
>
> Laszlo Sandor <sandorl@gmail.com> 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 <Michael.Normal.Mitchell@gmail.com> 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
> *
> *   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/
```