Parse a parameter name variable in a parmest resultsset
parmparse varname [if] [in] [ , omit(newvarname) type(newvarname) name(newvarname) base(newvarname) level(newvarname) op(newvarname) tsop(newvarname) delimiter(string) fast ]
Description
parmparse is intended for use in output datasets (or resultssets) created by the programs parmest or parmby. These are part of the parmest package, which can be downloaded from SSC, and which create output datasets (or resultssets), with one observation per estimated parameter of a model fitted to an original dataset. parmparse inputs a string variable containing parameter names, usually named parm in a parmest resultsset, and outputs one or more variables, containing parameter attributes which can be inferred from the parameter name. These attributes include the parameter omit status, the parameter type, a list of the variable names for the factors and other variables whose effects are measured by the parameter, and lists of the corresponding base statuses, factor levels, full operator portions, and time series operator portions. These lists can be delimited by a user-specified delimiter string, allowing the output list variables to be input to the split command for further processing.
Options
omit(newvarname) specifies an output numeric variable, indicating, in each observation, the omit status of the corresponding parameter. Parameters may be omitted because of collinearity, or because they correspond to base levels of factor variables.
type(newvarname) specifies an output string variable, containing, in each observation, the matrix stripe element type of the corresponding parameter. This type may be variable, error, factor, interaction, or product.
name(newvarname) specifies an output string variable, containing, in each observation, a delimited list of the names of the variables whose effects are measured by the corresponding parameter.
base(newvarname) specifies an output string variable, containing, in each observation, a delimited list of the baseline statuses of the corresponding parameter, with respect to the corresponding variables whose names are listed in the name() output variable. These statuses are string representations of numeric values. These numeric values can be 0 if the parameter represents a non-baseline level of the corresponding variable, 1 if the parameter represents a baseline level of the corresponding variable, or the missing value . if the parameter does not represent a level of the corresponding variable.
level(newvarname) specifies an output string variable, containing, in each observation, a delimited list of the factor levels represented by the corresponding parameter, with respect to the corresponding variables whose names are listed in the name() output variable. These levels are string representations of numeric values, equal, in each case, to the value of the corresponding variable represented by the parameter, or to the missing value . if the parameter does not represent a level of the corresponding variable.
op(newvarname) specifies an output string variable, containing, in each observation, a delimited list of the full operator portions represented by the corresponding parameter, with respect to the corresponding variables whose names are listed in the name() output variable. These operator portions are described in the documentation for factor variables and varlists.
tsop(newvarname) specifies an output string variable, containing, in each observation, a delimited list of the time series operator portions represented by the corresponding parameter, with respect to the corresponding variables whose names are listed in the name() output variable. These time series operator portions are described in the documentation for varlists.
delimiter(string) specifies a delimiter string, to be used in the output string variables containing delimited lists. If delimiter() is not specified, then the blank space delimiter string " " is used. Other delimiter strings can be useful, if the user intends to input the output string list variables to split, which outputs a list of new string variables, containing the individual list elements, which can in turn be input to further processing steps.
fast is an option for programmers. It specifies that parmparse will not restore the original data in memory in the event of failure, or if the user presses Break.
Remarks
parmparse is a front end for the undocumented Stata command _ms_parse_parts. This undocumented command is also used by the fvregen package, downloadable from SSC, which reconstructs the factor variables in a parmest resultsset..
Examples
The following examples will work with the auto data if the SSC package parmest is installed.
Set-up:
. sysuse auto, clear . describe . regress mpg i.foreign##i.rep78 . parmest, norestore . describe . list
Simple example:
. parmparse parm, omit(omitstat) type(ptype) name(names) base(basestat) level(flevels) op(oppor) tsop(tsoppor) . describe . list parm estimate p omitstat ptype names basestat flevels oppor tsoppor
The following example illustrates the use of parmparse, with a non-default delimiter() option, to produce ampersand-delimited string output variables. These output variables can then processed further, using split, to produce additional output variables, containing the individual list elements.
. parmparse parm, omit(omitstat) type(ptype) name(names) base(basestat) level(flevels) op(oppor) tsop(tsoppor) delimiter(&) . describe . list parm estimate p omitstat ptype names basestat flevels oppor tsoppor . split names, parse(&) gene(S_) . list parm estimate p omitstat ptype basestat flevels oppor tsoppor S_*
Author
Roger Newson, National Heart and Lung Institute, Imperial College London, UK. Email: r.newson@imperial.ac.uk
Also see
Manual: [U] 11.4.3 Factor variables, [P] fvexpand, [D] split
Help: [U] 11.4.3 Factor variables, [P] fvexpand, [D] split parmest, fvregen if installed