Announcement

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

  • Non-mutually exclusive categorical variable?

    Hi all!

    I am working with some data describing how schools operated during the pandemic, specifically looking at the type of curriculum provided to virtual students. Districts could provide online, electronic, or physical curriculum, or any combination of the above. My existing format variable is a categorical variable with all possible combinations, and I have already created dummies for each of the three curriculum types.

    I am not currently interested in the combination of curriculum options, only whether or not each was provided, and I was wondering if anyone had any ideas on how to create a categorical variable (or something similar) that would accomplish this task? Ideally it would take on some value if a district provided online curriculum, regardless of if they provided curriculum only online, or in conjunction with another format. Similarly I would want to know whether or not a district ever provided electronic or physical curriculum. Eventually I want to be able to make summary tables (recognizing that my totals would be greater than 100%) that compare the formats to different characteristics, and I am finding that very difficult with the dummy variables.

    Below is a snippet of my code. Any help, suggestions, or confirmation that this isn't possible would be greatly appreciated!

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long format float(online electronic physical)
    1 1 1 1
    4 0 0 0
    5 1 0 0
    6 1 1 0
    1 1 1 1
    1 1 1 1
    5 1 0 0
    1 1 1 1
    6 1 1 0
    5 1 0 0
    4 0 0 0
    1 1 1 1
    5 1 0 0
    6 1 1 0
    6 1 1 0
    end
    label values format format
    label def format 1 "all three formats", modify
    label def format 4 "no information", modify
    label def format 5 "online", modify
    label def format 6 "online and electronic", modify
    label values online dummy
    label values electronic dummy
    label values physical dummy
    label def dummy 0 "No", modify
    label def dummy 1 "Yes", modify
Working...
X