Dear Stata users,
I have a panel data set consisting of municipalities in my country from 2000-2020, I have three variables which tells what percentage of land is currently used for. So Built_area is one variable, Agricultural_area is the second variable and third variable is NaturalForest_area. So what I want to do is I create 3 variables indicating low_dev,high_dev and med_dev and then each municipality will be in one of these categories. The problem I am facing is that some of my municipalites are not captured in one of these categories. I am not sure but I might think the range is not set properly, hopefully someone could address me the issue and what the solution to this problem is.
These are my commands:
gen med_dev=1 if (Built_area<=32.71& Built_area>10.13 & Agri_area>33.03 & Agri_area<56.32 & NaturalForest_area<15.18) & !missing(Built_area,Agri_area,NaturalForest_area)
gen high_dev=1 if (Built_area>32.71 & Agri_area<=33.03 & NaturalForest_area<11.11) & !missing(Built_area, Agri_area, NaturalForest_area)
gen low_dev=1 if (Built_area<10.13 & Agri_area>=56.32 & NaturalForest_area>=15.18) & !missing(Built_area,Agri_area,NaturalForest_area)
I thank everyone for taking the time to read and hopefully helps me with the solution.
Br,
Adam
Related Posts with dummy variable conditional not working for all panel IDs
Instrumental variable analysis for binary dependent and independent variables and binary instrumentHello, I am relatively new to STATA and I am working on a research study investigating medical outc…
Codes of unit root tests with multiple structural breakHi, I am looking for the Stata code of the Lee & Strazicich unit root test from the following pa…
eventstudy2 longer event windowHello, I am currently working with eventwindow2 and tried to estimate an event period larger than +…
Need help with homework!!!Hey, My professor has asked us to work with stata. However, I have no idea about stata at all, I en…
Estimating marginal effects for interactions in the second hurdle of double hurdle modelsHi there, I am running double hurdle models with data from a multi-round modified dictator game, us…
Subscribe to:
Post Comments (Atom)
0 Response to dummy variable conditional not working for all panel IDs
Post a Comment