__Title__

**[P] _score_spec** -- Parsing tool for generating scores

__Syntax__

**_score_spec** *new_var_spec* [*if*] [*in*] [**,** **b(***matname***)** __sc__**ores**
__eq__**uation(***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