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   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: is something wrong with fvvarlist "i(3 4).role"?
Date   Tue, 13 Jul 2010 10:09:49 -0500

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index