[CLASSO] predict —— Predict group membership and fitted values after classifylasso.

Syntax

predict newvar
[if] [in] [, statistic]

statistic

gid group membership; the default

xb xb fitted values

xbd xb + d_absorbvars

d d_absorbvars

residuals residuals

stdp standard error of the prediction (of the xb component)

Description

predict calculates group membership and linear fitted values. It allows for both in-sample and out-sample prediction, with either C-Lasso or post-Lasso coefficients.

Options

gid calculates the group membership.
Both in-sample or out-of-sampe predictions are allowed.
In-sample prediction is obtained directly from estimation;
out-sample prediction is calculated by choosing the group membership whose coefficient vector minimizes the sum square error of certain individual unit.

xb, xbd, d, residuals, and stdp calculate the various fitted results from the model.
It applies similarly to the predict command for reghdfe, only that it assigns different coefficients according to the group membership.
Note that you do not need to predict membership before generating the fitted values.