Announcement

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

  • deciles by group

    I have created an income decile variable out of my income variable. I also have a variable of crime frequency which shows how many crimes occurred in a specific district (my data is at the district level). The crime data ranges from 0 to 17. I would like to see what percentage of crime rate took place by which income decile. I used this command egen crime_decile =xtile( income_neighborhood ), n(10) by( crime_freq) but didn't work. I wonder if someone can help me here. Thank you.

  • #2
    ...but didn't work..
    is something you should never say here without explaining exactly what went wrong. There are many ways something might fail to work. Did Stata crash? Did it hang? Did you get an error message? If so, what was the error message? Did it run without error messages but produce results you weren't expecting? If so, how did it differ and what were you expecting?

    If you want someone to help you, you'll have to be more clear about what went wrong. Show the exact command you run (perhaps it is, indeed, what you show in #1) but also show exactly what results it produced, if any, and what messages you got, if any. If it did produce results that you didn't want, show at least an example of those results and explain what you were hoping to get instead. It's almost always a good idea also to show example data that illustrates the same problem when you run the code with it.

    Comment

    Working...
    X