| Libgretl Reference Manual |
|---|
tslstsls — |
double* tsls_get_Xi (const MODEL *pmod, double **Z, int i); void tsls_free_data (const MODEL *pmod); int* tsls_list_omit (const int *orig, const int *drop, gretlopt opt, int *err); int* tsls_list_add (const int *orig, const int *add, gretlopt opt, int *err); MODEL tsls_func (const int *list, int ci, double ***pZ, DATAINFO *pdinfo, gretlopt opt);
int* tsls_list_omit (const int *orig,
const int *drop,
gretlopt opt,
int *err);
Creates a new TSLS specification list, by first copying orig
then deleting from the copy the variables found in drop.
orig : |
list specifying original TSLS model. |
drop : |
list of variables to be omitted. |
opt : |
may include OPT_T (omit variable only as instrument)
or OPT_B (omit both as regressor and instrument). The default
is to omit (only) as regressor.
|
err : |
pointer to receive error code. |
| Returns : | the new, reduced list or NULL on error.
|
int* tsls_list_add (const int *orig,
const int *add,
gretlopt opt,
int *err);
Creates a new TSLS specification list, by copying orig
and adding the variables found in add.
orig : |
list specifying original TSLS model. |
add : |
list of variables to be added. |
opt : |
may include OPT_T (add variable only as instrument)
or OPT_B (add both as regressor and instrument). The default
is to add as an endogenous regressor.
|
err : |
pointer to receive error code. |
| Returns : | the new, augmented list or NULL on error.
|
MODEL tsls_func (const int *list, int ci, double ***pZ, DATAINFO *pdinfo, gretlopt opt);
Estimate the model given in list by means of Two-Stage Least
Squares. If ci is SYSTEM, fitted values from the first-stage
regressions are saved with the model: see tsls_get_Xi().
list : |
dependent variable plus list of regressors. |
ci : |
TSLS for regular two-stage least squares, or
SYSTEM if the 2SLS estimates are wanted in the context of
estimation of a system of equations.
|
pZ : |
pointer to data matrix. |
pdinfo : |
information on the data set. |
opt : |
may contain OPT_O for printing covariance matrix,
OPT_R for robust VCV, OPT_N for no df correction.
|
| Returns : | a MODEL struct, containing the estimates. |
| << modelspec | nls >> |