| Libgretl Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
void tsls_free_data (const MODEL *pmod); int ivreg_process_lists (const int *list, int **reglist, int **instlist); int * ivreg_list_omit (const int *orig, const int *drop, gretlopt opt, int *err); int * ivreg_list_add (const int *orig, const int *add, gretlopt opt, int *err); int * tsls_make_endolist (const int *reglist, int **instlist, int *addconst, int *err); MODEL tsls (const int *list, double ***pZ, DATAINFO *pdinfo, gretlopt opt);
int ivreg_process_lists (const int *list,
int **reglist,
int **instlist);
Split the incoming list into its two components and perform some basic checks; if the checks fail the two created lists are destroyed.
list : |
original specification list. |
reglist : |
location to receive regression list. |
instlist : |
location to receive list of instruments. |
| Returns : | 0, on success, non-zero error code on failure. |
int * ivreg_list_omit (const int *orig,
const int *drop,
gretlopt opt,
int *err);
Creates a new IVREG specification list, by first copying orig
then deleting from the copy the variables found in drop.
orig : |
list specifying original IV 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 * ivreg_list_add (const int *orig,
const int *add,
gretlopt opt,
int *err);
Creates a new IVREG specification list, by copying orig
and adding the variables found in add.
orig : |
list specifying original IV 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.
|
int * tsls_make_endolist (const int *reglist,
int **instlist,
int *addconst,
int *err);
reglist : |
|
instlist : |
|
addconst : |
|
err : |
|
| Returns : |
MODEL tsls (const int *list, double ***pZ, DATAINFO *pdinfo, gretlopt opt);
Estimate the model given in list by means of Two-Stage Least
Squares. If OPT_E is given, fitted values from the first-stage
regressions are saved with the model.
list : |
dependent variable plus list of regressors. |
pZ : |
pointer to data matrix. |
pdinfo : |
information on the data set. |
opt : |
may contain OPT_R for robust VCV, OPT_N for no df correction,
OPT_A if this is an auxiliary reression, OPT_E is we're
estimating one equation within a system; and OPT_H to
add "hatlist" to model even under OPT_E.
|
| Returns : | a MODEL struct, containing the estimates. |