I am looking for a way to subset a data frame by multiple conditions. My data set is comprised of respondents with at least one and a maximum of 4 children who are either biological children or stepchildren, which I am looking to filter for each child respectively.
Thus, I am currently filter the data like so: SUBSET03 <- subset( SUBSET02, (ehc9k1 == 1 | ehc9k1 == 3) | (ehc9k1 == 1 | ehc9k1 == 3) & (ehc9k2 == 1 | ehc9k2 == 3) | (ehc9k1 == 1 | ehc9k1 == 3) & (ehc9k2 == 1 | ehc9k2 == 3) & (ehc9k3 == 1 | ehc9k3 == 3) | (ehc9k1 == 1 | ehc9k1 == 3) & (ehc9k2 == 1 | ehc9k2 == 3) & (ehc9k3 == 1 | ehc9k3 == 3) & (ehc9k4 == 1 | ehc9k4 == 3) ) #S
This doesn't work out - any tip on how to 'replace' the brackets?