Announcement

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

  • Collapsing by forming a new proportion

    Is there a way to use the collapse command to generate proportion? I have data from NYC sub-boroughs and it gives certain variables in percentage. For example, percent_black, percent_white, I need to collapse/aggregate certain sub-boroughs together. So for example the observations Astoria, Williamsbridge have to be aggregated. I have the population for each individual sub-borough I want to then form new percentage variables based on the sub-boroughs that need to be aggregated. So percent crime in Asotria/Williamsbridge, is there anyway the collapse command can help me? Sorry if this message makes no sense english is not my primary language

  • #2
    No, you can't do that directly with -collapse. What you need to do is first calculate the number of blacks, whites, etc. in each sub-borough (when I was growing up there we just called them neighborhoods, but, whatever) from the total population and the percentages. Then you can -collapse- summing up the populations and numbers of blacks, whites, etc. Then, you can calculate the percentages by the appropriate division (and multiplication by 100).

    Comment

    Working...
    X