Stata 15 help for _unab

Title

[P] _unab -- Unabbreviate variable list from matrix stripe elements

Syntax

_unab varlist [, matrix(name) row needbase]

varlist may contain factor variables; see fvvarlist. varlist may contain time-series operators; see tsvarlist.

Description

_unab expands and unabbreviates varlist using the variable names in the column stripe of a matrix instead of the current dataset.

_unab expands factor variables to the levels present in the matrix stripe. Level values not present in the matrix stripe will cause an error.

Options

matrix(name) specifies that variable names present on the column stripe of matrix name be used. The default is matrix(e(b)). If e(b) does not exist, then _unab uses the variable names in the current dataset.

row specifies that the variable names come from the row stripe. The default is the column stripe.

needbase specifies that the bn. factor-variables operator is not allowed.

Examples

. sysuse auto . regress mpg for#rep

. _unab * . di r(varlist) foreign rep78

. _unab i.for . di r(varlist) 0b.foreign 1.foreign

. _unab 1.rep#for . di r(varlist) 1b.rep78#0b.foreign 1.brep78#1.foreign

. _unab 2.for level 2 of factor foreign not found in list of covariates r(111);

Stored results

_unab stores the following in r():

Macros r(varlist) the expanded, specific variable list


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