Announcement

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

  • variable distribution respect others

    Dear all, it is the first time to me in statalist. I would ask you if aanyone of you can help me with an intuition and then with codes. I am working with a variable the will be my regressor of interest. This variable varies on country, gender, year. I think that I have to produce some descriptive statistics to understand how its distribution varies accordingly to the other variables and what is the main source of variation in this variable. What should I do? So ideally I would like to show if this variable varies more on country-level or gender-level. Thank you very much for your attention.

  • #2
    As you don't show example data, I will illustrate an approach with the auto.dta
    Code:
    sysuse auto, clear
    xtile price_cate = price, nq(3)
    table (rep78) (foreign price_cat), statistic(mean weight) statistic(sd weight) sformat("(%s)" sd)
    Her rep78, foreign and price_cat play the roles of country, gender, and year, with weight playing the role of your regressor of interest. The table shows you a three-way cross classification of the means of the regressor of interest in each category, so you can visually see the roles country, gender, and year play in its variation. Then you additional get the standard deviation of the regressor within each of those cross-classifications.

    Note: if you are not using version 17, the syntax of the -table- command is slightly different:
    Code:
    table rep78 foreign price_cat, c(mean weight sd weight)
    The resulting table has a slightly different appearance, though the contents are actually the same.

    Comment

    Working...
    X