second_stage | R Documentation |
Estimates the second of a sorting model
second_stage(s1.results, data, endog = NULL, instr = NULL)
s1.results |
Indicates the (maxLik) object estimation results of the first stage of the sorting model |
data |
Dataset to be used |
endog |
Indicates the endogenous variable(s) to be instrumented (from the dataset in parentheses) |
instr |
indicates the intrument(s) for the endogenous variable |
This function estimates an OLS or an instrument variable. if an instrument variable procedure is needed both the instrument and the endogenous variables should be given
An estimation object
data <- municipality s1.results <- first_stage(code_name = "mun_code", X_names = c("lnprice","kindergardens_1km","p_mig_west","nature","monuments","cafes_1km"), Z_names = c("income","double_earner_hh","hh_kids","age", "migskill"), data = data, print_detail = 1) endog <- ("lnprice") phat <- sorting_inst(s1.results, "lnprice", data, stepsize = 0.02) s2.results <- second_stage(s1.results, data) s2.results <- second_stage(s1.results, data, "lnprice", phat$sorting_inst)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.