Hello,
My name is Joway. I'm a college student in my last year taking my capstone course. I'm writing an econ paper on Chinese aid in Sub-Saharan Africa (SSA). I will probably be coming back here frequently because I am so new to Stata. For the past 3 days I have been trying to create a conflict dummy variable. In my regression, I look to assess for the affects of conflict on aid and for that I downloaded a conflict database and my objective was to create a dummy variable 1 if there is conflict and 2 if there's no conflict through a panel data set from 2000 to 2021 for 40+ African countries. Originally what I had in mind was to do a sort of cross-reference for the country in question and year. For example, for the year 2000, I wanted, originally Excel, but now Stata, to check if the country Angola is found in any of the five columns (location, side_a, side_a_2nd, side_b, side_b_2nd) and return a value of 1 if the country was mentioned in that year which would indicate it being involved in a conflict or return 0 which would mean it was not involved in a conflict. But I don't know anything about Stata, yet, and have been using ChatGPT to create a code to run, but to no avail. Attached is a code that ChatGPT came up with. I don't know anything about data analysis coding so I can't judge the merits of the code. Can anyone assist me with this?
I attached my conflict database (excel) and the ChatGPT do-file (not sure if you need it or not)
My name is Joway. I'm a college student in my last year taking my capstone course. I'm writing an econ paper on Chinese aid in Sub-Saharan Africa (SSA). I will probably be coming back here frequently because I am so new to Stata. For the past 3 days I have been trying to create a conflict dummy variable. In my regression, I look to assess for the affects of conflict on aid and for that I downloaded a conflict database and my objective was to create a dummy variable 1 if there is conflict and 2 if there's no conflict through a panel data set from 2000 to 2021 for 40+ African countries. Originally what I had in mind was to do a sort of cross-reference for the country in question and year. For example, for the year 2000, I wanted, originally Excel, but now Stata, to check if the country Angola is found in any of the five columns (location, side_a, side_a_2nd, side_b, side_b_2nd) and return a value of 1 if the country was mentioned in that year which would indicate it being involved in a conflict or return 0 which would mean it was not involved in a conflict. But I don't know anything about Stata, yet, and have been using ChatGPT to create a code to run, but to no avail. Attached is a code that ChatGPT came up with. I don't know anything about data analysis coding so I can't judge the merits of the code. Can anyone assist me with this?
I attached my conflict database (excel) and the ChatGPT do-file (not sure if you need it or not)

Comment