Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: imposing parametric constraints in a two-stage procedure

From   Jia Li <>
To   "''" <>
Subject   st: imposing parametric constraints in a two-stage procedure
Date   Tue, 6 Jul 2010 21:55:45 -0400

Dear statlisters:
I’d like to get some advice on the following problem I am trying to solve:
I have a system of equations that I am implementing in two stages. The first stage involves estimating a system of nonlinear equations. I have used the –nlsur- command to execute the estimation. For the second stage, I am estimating two separate conditional logit models using –asclogit- and would like to impose certain parametric constraints based on estimates from stage 1.  The flow of the program is roughly as the follow: 
use fuel, clear
nlsur (eq1 = exp) (eq2 = exp),ifgnls
gen X0 =1+2*_b[B1]*B1+2*_b[B2]*B2…. 
gen X1=_b[a1]+2*_b[b11]*B1+…. (full expression omitted)
save, replace
use fuel
gen origorder=_n
expand 2
save fuel_choice, replace
constraint 1 [ln_incCW]=X0
constraint 2 [ln_oCostCW]=X1
asclogit cwchoice ln_incCW ln_oCostCW, casevars(own hh_size sqft_a builtyr cdd_mean hdd_mean) case(id) alternatives(cw) constraints(1-2) vce(robust)
Here are my questions:
1. The way I imposed constraints in the code above didn’t work. I think one reason is the “X0” and “X1” variables generated in “fuel.dta” post –nlsur- estimation are not carried to the expanded long-form data in “fuel_choice.dta”.  What would be the proper way to impose constraints in this case? 
2. My ultimate goal is to have iteration between the two stages to achieve convergence of parameters and I will need to write a loop do that. In this case, what would be the best way to impose parametric constraints that will also adjust the standard errors of the predicted values? 
I appreciate any suggestion you may have! 

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index