I need to generate a new categoric variable for a measured laboratory parameter. This variable should show whether the measured parameter is above or under the limit. Yet, the limits are dependent on age and gender:
Translation: Männer = Male, Frauen = Women, Alter = Age
I tried it with something like this:
data <- data %>%
mutate(cat_variable = ifelse(gender == "male" | age < 44,
c(0, 90.8, Inf),
ifelse(gender == "male" | age <.... and this is were i get lost as I don't know how to merge all these conditions
does anybody have a solution for this problem?
Thanks in advance!