Announcement

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

  • Topic: Generating Rival Indicator Variable Based on Number of Wives in DHS Dataset

    I am working with the DHS dataset and would like assistance with creating a variable to indicate whether there are rival wives in a household. The dataset includes information about the number of wives in a household, and I would like to generate a variable called rival based on the following logic:
    • If the husband has only one wife (i.e., v025 == 1), then the rival variable should be set to 0 (indicating no rivals).
    • If the husband has more than one wife (i.e., v025 > 1), then the rival variable should be set to 1 (indicating rivals).
    Could anyone provide guidance on how to generate this rival variable in Stata based on the number of wives (v025)?

    Thank you for your assistance.

  • #2
    Code:
    gen rival = (v025 > 1) if !missing(v025)

    Comment

    Working...
    X