Hello everyone,
I am having some trouble with a data set, which shows mass demonstrations in the last 30 years. The way the data is set up, is that there is an observation for each protest (so for example there are 7 observations of protests in Canada in 1990). If there are no mass demonstrations in a country in a year it is also coded but then the variable "protest" is just coded 0 instead of the value 1, which all of the observations with protests have.
What I want to do is make a count-variable that measures how many protests there have been for each year in each countries, and then do a command where I am only left with one observation per country per year, creating panel data.
Ideally I would like to have a count-variable for two different measures of mass protest, which are both dummys (protest100 and protest1000)
I hope I have made myself reasonably clear.
Related Posts with Creating a count variable for data with many observations per year/country
Two-level Logistic Regression with Complex Survey Design - QueryHello, I am relatively new to Stata (and Multilevel Modelling more broadly), and would be grateful …
Label two Y axis with Xtline codeI am using an xtline to graph two variables with very different scales. I am using the code below x…
Help on using coded variables to run the mincer wage equation?Hi, I'm trying to run the mincer wage equation using ols regression with a random effect model. In …
Counting year and company-wise string observationsHi everyone, I have a dataset of governance data, listing each company's directors and whether they…
MHTEXP*Theorem 3.1 Adjusted Values ExtractionHi everyone, I have been trying to create a matrix of List's MHT adjusted p-values that I get after…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a count variable for data with many observations per year/country
Post a Comment