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
"Michael N. Mitchell" <[email protected]>
To
[email protected]
Subject
Re: st: is something wrong with fvvarlist "i(3 4).role"?
Date
Mon, 12 Jul 2010 17:21:55 -0700
Greetings
The trick is that the -i.- is creating a reference group, so in your example group 3 is
the reference group. Here are some examples using the -auto- dataset.
. sysuse auto
(1978 Automobile Data)
* group 1 is the reference, groups 2-5 are shown
. summ i.rep78
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
rep78 |
2 | 69 .115942 .3225009 0 1
3 | 69 .4347826 .4993602 0 1
4 | 69 .2608696 .4423259 0 1
5 | 69 .1594203 .3687494 0 1
* group 1 is the reference, groups 2-5 are shown
. summ i(1/5).rep78
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
rep78 |
2 | 69 .115942 .3225009 0 1
3 | 69 .4347826 .4993602 0 1
4 | 69 .2608696 .4423259 0 1
5 | 69 .1594203 .3687494 0 1
* group 1 is the reference, groups 2-4 are shown
. summ i(1/4).rep78
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
rep78 |
2 | 69 .115942 .3225009 0 1
3 | 69 .4347826 .4993602 0 1
4 | 69 .2608696 .4423259 0 1
* group 1 is the reference, groups 2-3 are shown
. summ i(1/3).rep78
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
rep78 |
2 | 69 .115942 .3225009 0 1
3 | 69 .4347826 .4993602 0 1
* group 1 is the reference, group 2 is shown
. summ i(1/2).rep78
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
2.rep78 | 69 .115942 .3225009 0 1
I hope that helps.
Michael N. Mitchell
Data Management Using Stata - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week - http://www.MichaelNormanMitchell.com
On 2010-07-12 4.21 PM, László Sándor wrote:
Hi all,
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?
Thank you,
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
*
* 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/