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
2sls regression with interaction between endogenous and exogenous variablesHi All, My question is like this: I am having an endogenous variable X1 and an exogenous variable X…
Counting number of categories in a variable by groupDear all, Please take a look at the attached dummy dataset screenshot. How do I generate a variable…
Linking a personal identifier (ID) to specific characteristicsHi, I'm working with South African survey data called NIDS wave 5. There's a household decision maki…
Limiting panel data regression to groups with at least 10 consecutive observationDear all, The following is my sample data. Could you please help how I can run panel data regressio…
Block bootstrapping panel: Unable to generate new variable using each bootstrap replicationtsset firm wave xtabond2 y L LL K LK Ly dum2 dum3 wood1 textile1 metal1 anystat anyfor capcity, gmm …
Subscribe to:
Post Comments (Atom)
0 Response to dummy variable conditional not working for all panel IDs
Post a Comment