Hello everyone. Let me first describe my data and purpose of analysis for the sake of context.
I have quite a large conflict dataset (71 mill obs) with many variables, and date (daily). This is from the GDELT project which I think is amazing, but comments aside, the way the dataset is structured is that for each day, there is a target country and a source country of aggression. Namely, the first of January of 2000, many countries engaged in aggressive behaviour against others or themselves, and this dataset tracks this.
It looks like this.
Array
Cameo code is a level of intensity of conflict measured with some algorithm that tracks the news in each language. Very insightful.
Now what I would like to do is to isolate this events per country. So for instance, I would like to create a variable for the US where, for each date, I have all the times that the US was either a target or a source, and their respective cameo code.
Obviously what I am going to write is horribly wrong and I apologise for it already, but I would like a logical statement similar to something like: generate new variable(USAconflict) If (source or target) =USA, extract cameo codes next to date.
I hope I have expressed myself correctly. I have tried to look in the forum as well as in stackoverflow but I have not found anything that really applies to my case.
Thanks in advance for any help.
Best regards,
Juana
Related Posts with Creating variable out of conditional values in another one (GDELT)
Confusion about how to keep one row of data for each student with the most number of classes taken in a programI am using Stata 15.1 for Windows. I would like to keep a certain student in the program that he co…
Weighting without knowing psuDear Stata users, I want to conduct some cross-sectional analysis with data from the South African …
Way to identify first successful loop iteration?Hi Stata, I have a loop: forv x = 1/100{ cap{ [stata_commands] [if first successful iteration, exe…
Geographic Regression discontinuityHello guys, I am comparing the economic well-being of some group of people residing on opposite side…
-mimrgns- and -marginsplot-The help file for mimrgns states that while "[i]n principle, marginsplot works after mimrgns […], th…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variable out of conditional values in another one (GDELT)
Post a Comment