Announcement

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

  • Producing coefficients for all levels of outcome variable using mlogit and margins

    Hello.

    I am running an mlogit command to generate coefficients and standard errors for all levels of a categorical outcome variable, intention; the only predictor variable is year (continuous). I only have two values for year, and ultimately need to interpolate coefficients for a year between them (hence the use of margins below). The coefficients and standard errors for every level of intention will subsequently be run through a simulation for significance testing of a larger model. We need the log odds and log standard errors for each level, rather than just the proportions and standard errors for each, to feed into the simulation.

    However, when I run the margins command I can only get coefficients for N-1 outcome levels, where N is the number of levels in the outcome variable. From my understanding, all coefficients produced are a ratio of a baseline level, that is empty. I can get the predicted proportions for each level, so the issue is just that I can’t figure out how to get the coefficients and log standard errors specifically. Do you know how we can get the coefficients for all five values of my outcome variable, intention?

    I am using Stata version 16.1. Thank you in advance!
    Rachel

    Code:
    * Set sample design
    svyset idfac [pw=weight3], strata(strata) singleunit(scaled)
    
    * Run regression of year on intention
    svy: mlogit intention year  
    
    * Predict proportions (interpolate) of intention variable for year 5
    margins, at(year = 5)
    
    * Predict coefficients and log SEs of intention variable for year 5
    margins, at(year = 5) predict(xb outcome(1)) predict(xb outcome(2))            ///
                                      predict(xb outcome(3)) predict(xb outcome(4))            ///
                                      predict(xb outcome(5))
Working...
X