Hello everyone and thank you for accepting me to the forum. I am working on an assignment based on the data set attached (ps3-prio.dta) and I've been asked to discuss the distribution of the dependent variable (conflict) across two independent variables, year and country. Specifically, I am supposed to use histograms to discuss the distribution and the prevalence of conflicts across countries and years. I understand that I need to use the egen command to group the number of observed conflicts by year and by country, but I am unsure about the syntax. I have the following:
egen conflictyear = total(conflict), by(year)
tab conflictyear
histogram conflictyear
egen conflictcountry = total(conflict), by(cname)
tab conflictcountry
histogram conflictcountry
Thank you for your kind help.
egen conflictyear = total(conflict), by(year)
tab conflictyear
histogram conflictyear
egen conflictcountry = total(conflict), by(cname)
tab conflictcountry
histogram conflictcountry
Thank you for your kind help.
Comment