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)
Error: Option Dynamic Not Allowed in the Command PredictHi, I am doing ex-ante out of sample forecasting for rail freight. Based on the results of the ADF …
Combining Datasets and Reformatting DataHello everyone. I have a number of datasets (excel files) with data formatted as SheetName: Year1,…
Line graphsHi STATALIST, Using line cp50_CTDI cp50_CTDI_withIR cp50_CTDI_withoutIR p50_CTDI I produced …
"Outcome does not vary" errorHi everyone I am trying to run a logit regression: logit employed firmsize and I receive this erro…
Need help on the Margins and marginsplotDear experts, I am a beginner of Stata and I need your help desperately. I have the panel data from…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variable out of conditional values in another one (GDELT)
Post a Comment