Announcement

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

  • Weighted Least Squares Regression

    Dear Statalisters,

    I am currently working on a project with cross-country data. In order to examine my research question, I initially intented to use a regular OLS regression. However, since the number of observations by country vary substantially (e.g. U.S.: over 10,000 obs. and Mexico less than 100 obs.), I think that the weighted least squares approach would be more appropriate. I already familiarized myself with some possible Stata commands (wls0; regwls; aweights). In order to ensure that each country receives equal weight in the estimation, I want to conduct WLS, where the weight of each observation is the inverse of the number of observations in each country.

    However, I am currently struggling with finding a way to do this with the given Stata commands. Has anyone conducted a similar analysis and can help me? Or does this kind of analysis makes even sense in your opinion?

    Comments or suggestions are highly appreciated :-)
    TM

  • #2
    Weighted least squares, in the usual sense of the term, is definitely not going to do what you want--in fact it would do the opposite.

    What you want can be accomplished as follows:

    Code:
    count
    local total_obs `r(N)'
    by country, sort: gen iwt = `total_obs'/_N
    
    regress whatever [iweight = iwt]
    Whether it makes sense to do this I can't say. If the nature of your data and your research questions is such that it makes sense to have every country equally influential in the regression, then this approach might be sensible. It really depends on what your data represents and what your research questions are, and you have said little about the former, and nothing about the latter.

    Comment

    Working...
    X