Announcement

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

  • Fixed Effects: ologit vs. feologit

    Hello community,

    I am using an ordered logit model to estimate the effect of a continuous variable on a survey response where respondents choose one of three answers. My dataset is a repeated cross section. I need to include both geographic and time fixed effects.

    I have been working with the command ologit using “i.” where needed for the fixed effects, but have also been experimenting with the user-written command feologit (see paper here). When I run both commands back-to-back, I get very different results (where coefficients differ in both magnitude and direction). I’ve included code below that illustrates this scenario.

    Code:
    * Create sample dataset
    clear
    set more off
    
    * Set seed for replicability
    set seed 123
    
    * Number of observations
    local N = 1000
    
    * Number of groups
    local G = 20
    
    * Generate id variable
    set obs `N'
    gen id = _n
    
    * Generate group variable
    gen group = ceil(`G' * _n / `N')
    
    * Generate random independent variables
    gen x1 = rnormal()
    gen time = floor(uniform()*5) // Generating a discrete variable ranging from 0 to 4
    
    * Generate random error term
    gen u = rnormal()
    
    * Generate discrete dependent variable
    gen y = .
    replace y = 1 if u > 0.5
    replace y = 2 if u <= 0.5 & u > -0.5
    replace y = 3 if u <= -0.5
    
    * Ordered Logit
    ologit y x1 i.time i.group
    
    * Fixed Effects Ordered Logit
    feologit y x1 i.time, group(group)
    The discrepancy leaves me with multiple questions as I am not sure which results to trust:

    How does ologit treat categorical variables? Is there a reason I shouldn’t use “i.”?

    Can feologit handle multiple fixed effects? If not, is using “i.” an effective way to introduce the second fixed effect variable?

    From my vantage point, the two models compared above should produce identical results. I’d like to understand why they don’t. Any help is much appreciated!

  • #2
    You appear to be confusing different types of "fixed effects". -felogit- fit models to longitudinal data; the "fixed effect" refers to time-invariant observation level 'effects'. You have (repeated) cross-sectional data.

    Comment

    Working...
    X