Stata 15 help for fvexpand

[P] fvexpand -- Expand factor varlists

Syntax

fvexpand [varlist] [if] [in]

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

Description

fvexpand expands a factor varlist to the corresponding expanded, specific varlist. varlist may be general or specific and even may already be expanded.

Remarks

An example of a general factor varlist is mpg i.foreign. The corresponding specific factor varlist would be mpg i(0 1)b0.foreign if foreign took on the values 0 and 1 in the data.

A specific factor varlist is specific with respect to a given problem, which is to say, a given dataset and subsample. The specific varlist identifies the values taken on by factor variables and the base.

Factor varlist mpg i(0 1)b0.foreign is specific. The same varlist could be written as mpg i0b.foreign i1.foreign, so that is specific, too. The first is unexpanded and specific. The second is expanded and specific.

fvexpand takes a general or specific (expanded or unexpanded) factor varlist, along with an optional if or in, and returns a fully expanded, specific varlist.

Stored results

fvexpand stores the following in r():

Macros r(varlist) the expanded, specific varlist r(fvops) true if varlist contains factor variables r(tsops) true if varlist contains time-series operators


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