Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Categories - how to summarize

    Hi,
    I am brooding over this (for me) really complicated STATA problem. The dataset I have gave participants the options to tick multiple possibilities of diet type (Veggie, Vegan, Omnivore, Pescetarian, Low-calorie, Gluten-free). When imported STATA takes this as string data. I encoded this and created a new variable with the encode command.
    My aim is to simply summarize into the 3 categories Veggie, Vegan, Omnivore, however my problem is that I cannot recode the values e.g. Omnivore | Gluten-free into just "Omnivore" or a number, plus there are a lot combinations (e.g. Low-calorie| Gluten-free | Vegan) . Every attempt with the recode command did not work and showed error messages.

    Many thanks for your help in advance
    Best wishes,
    Lena

  • #2
    Your question is poorly posed. You complain about errors, yet you do not show your output or give details on the errors. I suggest that you provide a data example using the dataex command immediately after importing the data to Stata and explain what your intended output should look like. See FAQ Advice #12 for details. Also see https://www.statalist.org/forums/help#spelling on spelling Stata.

    Comment

    Working...
    X