11.07.2015 Views

[U] User's Guide

[U] User's Guide

[U] User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

106 [ U ] 11 Language syntaxor you can type. regress y i.sex ib3.group sex#group age sex#c.ageThat is, you only have to set the base once. If you specify the base level more than once, it must bethe same base level. You will get an error if you attempt to change base levels in midsentence.If you type ib3.group, the virtual variables become 1.group, 2.group, and b3.group.Were you to type ib(freq).group, the virtual variables might be b1.group, 2.group, and3.group; 1.group, b2.group, and 3.group; or 1.group, 2.group, and b3.group, depending onthe most frequent group in the data.11.4.3.3 Setting base levels permanentlyYou can permanently set the base level by using the fvset command; see [R] fvset. For example,. fvset base 3 groupsets the base for group to be 3. The setting is recorded in the data, and if the dataset is resaved, thebase level will be remembered in future sessions.If you want to set the base group back to the default, type. fvset base default groupIf you want to set the base levels for a group of variables to be the largest value, you can type. fvset base last group sex armSee [R] fvset for details.Base levels can be temporarily overridden by using the ib. operator regardless of whether theyare set explicitly.11.4.3.4 Selecting levelsTyping i.group specifies virtual variables b1.group, 2.group, and 3.group. Regardless ofwhether you type i.group, you can access those virtual variables. You can, for instance, use themin expressions and if statements:. list if 3.group(output omitted ). generate over_age = cond(3.group, age-21, 0)Although throughout this section we have been typing #.group such as 3.group as if it issomehow distinctly different from i.group, the complete, formal syntax is i3.group. You areallowed to omit the i. The point is that i3.group is just a special case of i.group; i3.groupspecifies an indicator for the third level of group, and i.group specifies the indicators for all thelevels of group. Anyway, the above commands could be typed as. list if i3.group(output omitted ). generate over_age = cond(i3.group, age-21, 0)Similarly, the virtual variables b1.group, 2.group, and 3.group more formally would be referredto as ib1.group, i2.group, and i3.group. You are allowed to omit the leading i whenever whatappears after is a number or a b followed by a base specification.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!