Stata 15 help for _score_spec

Title

[P] _score_spec -- Parsing tool for generating scores

Syntax

_score_spec new_var_spec [if] [in] [, b(matname) scores equation(eqname) ]

where new_var_spec is either newvarlist or stub*; see newvarlist.

Description

_score_spec is a programmer's tool that helps with parsing the standard syntax for generating score variables after a model fit.

_score_spec looks at the column names in e(b) to determine how many score variables are to be generated, and parses new_var_spec using _stubstar2names (see _stubstar2names).

Options

b(matname) specifies an alternative matrix to look at for determining the number of score variables to generate. The default is equivalent to specifying b(e(b)).

scores is the default, and indicates that one score variable from each equation is going to be generated.

equation(eqname) indicates that one score variable is to be generated, and identifies the equation that the observation score values are to come from.

Examples

. sysuse auto, clear (1978 Automobile Data) . quietly regress mpg turn displ . _score_spec sc* . sreturn list macros: s(typlist) : "float" s(varlist) : "sc1" . _score_spec res, equation(#1) . sreturn list macros: s(typlist) : "float" s(varlist) : "res" s(eqspec) : "#1" . _score_spec res, equation(#2) equation [#2] not found r(303); . quietly mlogit rep turn trunk . _score_spec double sc* . sreturn list macros: s(typlist) : "double double double double" s(varlist) : "sc1 sc2 sc3 sc4" s(coleq) : "1 2 4 5" . _score_spec sc, equation(#3) . sreturn list macros: s(typlist) : "float" s(varlist) : "sc" s(coleq) : "1 2 4 5" s(eqname) : "4" s(eqspec) : "#3"

Stored results

_score_spec stores the following in s():

Macros: s(varlist) list of new variable names s(typlist) list of types for the new variables s(coleq) equation names from e(b) matrix s(eqname) equation name for equation identified in the equation() option s(eqspec) ## for equation identified in the equation() option


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