Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How Do I Conduct Marginal Effects at the Means Analysis Given a Zero-Inflated Beta Regression?

    I am running a zero-inflated beta regression with the DV as anti-Francophone sentiment (from 0 to 1). Let's say I want to analyze the marginal impact on average anti-Francophone sentiment given a change in my social network dummy variable (0 = no close friends of visible minority status/no close friends, 1 = at least one close friend of visible minority status). I want this in proportion-wise terms (impact on the 0-1 proportion scale of the DV). Here is the distribution of my DV:
    Click image for larger version

Name:	Anti Francophone Frequency.png
Views:	1
Size:	66.3 KB
ID:	1656335




    There are a lot of zero observations, and considering my sample is about 15% Francophone, that is probably one reason why, hence why I am using a zero-inflated beta model. Then why I try running this code:
    Code:
    mfx, predict(pr) at(soc_net_vis_status = 0)
    marginsplot
    I get the following error:

    predict() expression pr unsuitable for marginal-effect calculation

    or if I run this code:

    Code:
    margins, dydx(immigrant_status francophone_status region gender_status age_group education_status religious_status income_group urban_status party_id_status soc_net_vis_status ideology_index) atmeans
    
    margins, at(soc_net_vis_status=(0/1))
    marginsplot
    I get the following error:

    invalid dydx() option;
    variable francophone_status may not be present in model as factor and continuous predictor

    This process worked fine with my other regressions under a glm specification. Just as an example of one:
    Click image for larger version

Name:	Marginal Impact of Social Network on Anti Muslim Sentiment.png
Views:	1
Size:	74.0 KB
ID:	1656336




    So why does it not work here? Here is my zoib regression code:
    Code:
    zoib franc_support_index i.immigrant_status i.francophone_status i.region i.gender_status i.age_group i.education_status i.religious_status i.income_group i.urban_status i.party_id_status i.soc_net_vis_status c.ideology_index, zeroinflate(francophone_status) vce(robust)
    Last edited by MD Mubtasim-Fuad; 25 Mar 2022, 20:39.

  • #2
    A discrete change at the means is probably not as meaningful when you have that many categorical variables. I would either use an average discrete change or a discrete change at specific realistic values of your other explanatory variables. Below is an example of an average discrete change, and it works.

    Code:
    use "http://fmwww.bc.edu/repec/bocode/k/k401.dta", clear
    
    replace totemp = totemp/100
    
    zoib prate mrate totemp age i.sole,       ///
         oneinflate( mrate totemp age i.sole)
    
    margins, dydx(sole)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X