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
Stata doesn't perform function. Do i have to change stata to another program?Dear statalist. I have data 2,000,000 observation. My stata version is 14 MP 8 core. My labtop Intel…
WHEN to delete missing/negative values?Hello, I was wondering when it is best to clean the data (i.e. delete missing or negative values) w…
Amemiya-Lee-NeweyI having problems using Amemiya-Lee-Newey test after ivprobit with in regression with 2 instruments.…
How can i convert a *.dsv file into a *.dta file?Hi I would like to work with a dataset of the recent president's election in Argentina. But I could…
how to generate sequence integer starting from 0 (by group)Hi, I have a panel data set and try to generate sequence numbers by group but the numbers starting f…
Subscribe to:
Post Comments (Atom)
0 Response to Creating categories within a nominal variable
Post a Comment