Hello!
I am conducting an honors thesis in sociology and need help with creating categories within a nominal variable. I have a nominal variable (called primarybc), which includes a list of about 20 birth control options (ex: abstinence, withdrawal, condoms, spermicide, IUD, patch, etc). I am trying to run analyses, however, I do not have enough observations in each option to give meaningful results. As such, I am trying to create classes, or categories, within primarybc to group some of the birth control options. For example, I want to create a subgroup called "barrier methods" which would include condoms and spermicides, and another subgroup called "hormonal self-administered methods" which would include pills and the patch.
How do I go about doing this? I have tried to do the following: gen classbc = 4 if primarybc == 7 | primarybc == 10 | primarybc == 13 |
No luck. Any thoughts?
Related Posts with Creating categories within a nominal variable
A dates conversion questionI have a variable of type integer. It contains years as YYYY. I wish to convert it to double type an…
Users' Written Command update and Stata versionIs there a way to make Stata not update the commands to a version higher than that of Stata. Some c…
Panel bootstrap after Wooldridge (1995) two-step estimatorDear Statalisters, I have a panel data set which suffers from sample selection bias. I am following…
Special characters issue PC to MacHello all, I am working on a survey project where the variable and value labels are in French, mean…
Mean Table by two subgroups and transfer to latexDear all, I'm currently trying to generate a output table of the mean values of accumulated labour …
Subscribe to:
Post Comments (Atom)
0 Response to Creating categories within a nominal variable
Post a Comment