Dear Statalist,
I have currently created four variables about family status: 1) Parents living together 2) Shared custody 3) Lonley parent 4) Living with a step parent/new family. They act as four dummys where 0 = different status 1 = actual status. My challenge is to combine these together.
Talking to my advisor she told me it would be more wise to group them together and use one of them as a reference category. I assume the best way to do this is to run the final, combined categorical variable as a factor variable and write b1.familystatus in the regression.After much googling and Statalisting I do not manage to find exactly what I look for.
So far I have tried the egen group-function (egen newvar = group (var1 var2 var3 var4)) but this gives me more categories than expected/a combination of the combinations I guess.
Has anyone come across this dilemma before?
Thanks a lot in advance.
Best regards,
Jonas.
If it was unclear: I have 4 pie charts where each just show 0 or 1 (50,50 split), while I want a more nuanced pie chart with all the combinations (25% split).
Related Posts with Combining a newly constructed dummy variables to one categorical variable for analysis/refcat
Factor calculation based on dual variable namesHi, I am trying to calculate a currency value factor based on currency spot and lagged exchange rat…
GLM - Offset termHi, I am running a GLM - Poisson Family Identity Link model to show the impact of various predictor …
same code, same data, different results (sort isn't working)I am dropping observations based on the if statement (drop if entryyear~=entryyear_surv) written in …
IV approach flips the signs of exogenous covariates' coefficient estimatesAfter implementing an IV probit model, the signs of many exogenous covariates' coefficient estimates…
egen command related to count based on a conditionDear All Code: input str1 firm float(sales) int year "a" . 2010 "a" . 2011 "a" 5 2012 "b" 6 2010 "b…
Subscribe to:
Post Comments (Atom)
0 Response to Combining a newly constructed dummy variables to one categorical variable for analysis/refcat
Post a Comment