Dear all, David Roodman
I need help regarding the plotting of the first equation of my cmp routine, developed by Roodman (2011). After performing the cmp routine I experience ssome problems with plotting the first equation (purchase yes/no), which is conditional on the second equation of add_to_cart (yes/no). I read online that the margins command might be unable to calculate the marginal effects for equation 1. However, I was wondering if there is a possible workaround or that I am missing something. I need to plot the relations as the interaction effects I use are quite complex to explain in words (thesis). Please help me further understand this routine. I already tried options such as condition(0 ., eq(cart_use) but I just ccant' get Stata to get marginal effects. See below my cmp command and 1 of the margins/marginsplot I try to run (simplified version):
Code:
// Full model with interaction and quadratic effects (all effects)
cmp (purchased_eq: purchased = i.availability_desired_size category_variety_log_mean ///
i.collection#c.category_variety_log_mean ///
i.size_range_width_cat#c.category_variety_log_mean ///
i.collection_ind##c.category_variety_squared ///
i.size_range_width_cat##c.category_variety_squared ///
i.review_category selling_price_c i.sale_cat i.day_of_week ///
back_in_stock precipitation sales_promo platform top_brand) ///
(cart_use: add_to_cart = category_variety_log_mean size_range_availability_log_medi ///
size_range_availability_squared ///
i.size_range_width_cat#c.category_variety_log_mean ///
i.collection#c.category_variety_log_mean ///
i.size_range_width_cat##c.category_variety_squared ///
i.collection_ind##c.category_variety_squared ///
i.review_category selling_price_c i.sale_cat i.day_of_week ///
back_in_stock precipitation sales_promo platform top_brand) ///
, ind($cmp_probit*add_to_cart $cmp_probit) qui
estimates store model5
estat ic
/// loading the output of the full model
estimates restore model5
margins, at(category_variety_log_mean=(-0.9848438(0.1)0.5584728)) predict(pr equation(purchased_eq)) post
marginsplot, recast(line) xline(0) xtitle("category_variety_log_mean")
Thanks in advance!!
I need help regarding the plotting of the first equation of my cmp routine, developed by Roodman (2011). After performing the cmp routine I experience ssome problems with plotting the first equation (purchase yes/no), which is conditional on the second equation of add_to_cart (yes/no). I read online that the margins command might be unable to calculate the marginal effects for equation 1. However, I was wondering if there is a possible workaround or that I am missing something. I need to plot the relations as the interaction effects I use are quite complex to explain in words (thesis). Please help me further understand this routine. I already tried options such as condition(0 ., eq(cart_use) but I just ccant' get Stata to get marginal effects. See below my cmp command and 1 of the margins/marginsplot I try to run (simplified version):
Code:
// Full model with interaction and quadratic effects (all effects)
cmp (purchased_eq: purchased = i.availability_desired_size category_variety_log_mean ///
i.collection#c.category_variety_log_mean ///
i.size_range_width_cat#c.category_variety_log_mean ///
i.collection_ind##c.category_variety_squared ///
i.size_range_width_cat##c.category_variety_squared ///
i.review_category selling_price_c i.sale_cat i.day_of_week ///
back_in_stock precipitation sales_promo platform top_brand) ///
(cart_use: add_to_cart = category_variety_log_mean size_range_availability_log_medi ///
size_range_availability_squared ///
i.size_range_width_cat#c.category_variety_log_mean ///
i.collection#c.category_variety_log_mean ///
i.size_range_width_cat##c.category_variety_squared ///
i.collection_ind##c.category_variety_squared ///
i.review_category selling_price_c i.sale_cat i.day_of_week ///
back_in_stock precipitation sales_promo platform top_brand) ///
, ind($cmp_probit*add_to_cart $cmp_probit) qui
estimates store model5
estat ic
/// loading the output of the full model
estimates restore model5
margins, at(category_variety_log_mean=(-0.9848438(0.1)0.5584728)) predict(pr equation(purchased_eq)) post
marginsplot, recast(line) xline(0) xtitle("category_variety_log_mean")
Thanks in advance!!
Comment