Home · Command reference

RainbowStats™ · Regression commands

IV_REGRESSION

Estimate instrumental-variables regression.

Syntax

IV_REGRESSION(list,instruments)
IV_REGRESSION(y,x,instruments)

Returned object

IVRegressionOperator

Example

iv=IV_REGRESSION(LIST(Y,X),LIST(Z1,Z2))
EXTRACT(iv,"first_stage_f")
EXTRACT(iv,"beta:1")

Interpretation and limitations

The first list contains y followed by endogenous regressors. Supply a defensible instrument design; a syntax example is not evidence of valid instruments. Coefficient index 0 is the intercept; first-stage numbering starts at 1. The published command description reports conventional homoskedastic 2SLS standard errors, not HAC or weak-instrument-robust inference. Indexed extract patterns require replacing n with an actual index.

Available extracts

Save the command result in a variable, then use EXTRACT(result, "key"). Availability can depend on the input form and fitted model.

In indexed patterns such as beta:n, replace n with the required index.

Learn more

Detailed guide and examples