Announcement

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

  • Weighted regression with fixed and random effects

    I am trying to run a meta-regression analysis so my dependent variable is an effect size/elasticity and explanatory variables are the number of observations, area of study, among others. A single paper can report multiple elasticities, so my panel unit is the Study ID from which I can have more than one observation.
    As is the convention in meta-regression analysis, I must weight each observation by the inverse of the variance using a random effects or fixed effects specification. However, when I try to use either xtreg, re or xtreg, fe I get an error message because the weight must be constant within panel. My weight varies within the panel as a study may report more than one coefficient and each has a different standard error.
    I found that areg allows assigning weights that vary within panel and I could potentially estimate Fixed effects weighted least squares. For example: areg dependvar independvar [aweight=(standard_error^(-2))], absorb(StudyID). However, areg does not work for random effects estimation. Is there any solution for this?

    Thank you!
    Last edited by Eliana Chavarria; 28 Apr 2024, 14:09.

  • #2
    -xtreg- command in Stata does not allow weights that vary within the panel for random effects or fixed effects estimation. However, there are a couple of alternative approaches you can consider:

    1. Two-stage approach using -areg- (fixed effects only):
    - In the first stage, use -areg- with the study-level fixed effects and the inverse variance weights, as you mentioned: -areg dependvar independvar [aweight=(standard_error^(-2))], absorb(StudyID)-.
    - In the second stage, regress the study-level fixed effects estimated from the first stage on the study-level variables (e.g., area of study) using weighted least squares, with weights proportional to the number of estimates per study.

    2. Use -gllamm- (Generalized Linear Latent and Mixed Models) for random effects estimation:
    - Install the -gllamm- package if you haven't already: -ssc install gllamm-.
    - Estimate a random effects model with weights using -gllamm-. For example:
    Code:
    gllamm dependvar independvar [aweight=(standard_error^(-2))], i(StudyID)
    3. Use -mixed- (multilevel mixed-effects linear regression) for random effects estimation:
    - Stata's -mixed- command allows for weights at different levels of the model. For example:
    Code:
    mixed dependvar independvar [aweight=(standard_error^(-2)) at level(_all_)] || StudyID:, reml
    Among these options, the -gllamm- and -mixed- approaches allow for random effects estimation with weights that vary within the panel. The two-stage approach with -areg- can be used for fixed effects estimation.

    Note that these approaches assume that the weights are inversely proportional to the variances of the effect sizes. Make sure this assumption is appropriate for your meta-regression analysis.

    Comment

    Working...
    X