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
margins not estimableHi all, I run a panel data fixed effect regression. There is an interaction term in the model. Thro…
Joinby two variablesDear statalisters, I am trying to merge two datasets and I have some problems. I started yesterday …
Generate multiple variables from a variable containing symbols and numbers Code: * Example generated by -dataex-. To install: ssc install dataex clear input str29 salary_tod…
Convert string to time including millisecondsI have a variable containing strings in the following format StringVar "2018-12-27 14:28:41.4861930…
Concatenate of a string and a numberDear statalister, I am trying to merge to database, I would like to try using a concatenate of coun…
Subscribe to:
Post Comments (Atom)
0 Response to Combining a newly constructed dummy variables to one categorical variable for analysis/refcat
Post a Comment