Announcement

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

  • Collapsing time series data by geography

    I have some data about social movements and it includes when social movements occurred. I'm trying to aggregate the data into a bar chart that shows time differences between violent and nonviolent social movements. I have tried using:
    collapse(sum) violent nonviolent by(CountryCode)
    but get error messages that I cannot use time-series operators on string variables. Does anyone have advice on this? Thanks in advance!

  • #2
    The error message is a guess at the problem, but wrong in your case. The syntax correction needed is a comma before the option.

    Code:
    collapse(sum) violent nonviolent,  by(CountryCode)
    That said, you shouldn't need to collapse to get a bar chart. graph bar or ​​​​​​​ graph hbar will do the calculations for you on the fly.

    Comment

    Working...
    X