Hey there,
I try to create a new conditional variable. It also worked great until I noticed that one and the same condition gives me once the right and once a NA.
# The analysis should be done for each 4ISS category
# 1. 4ISS = 0 = no stroke, 2. 4ISS = 1 - 7 = IVT, 3. 4ISS >= 3 = IVT and EVT
stroke_angel_data %>%
# give the 4ISS Scores a meaning in a new column
mutate(classification_according_to_4ISS = case_when(
ly_rd4iss == "0" ~ "no Stroke",
ly_rd4iss == c("1", "2") ~ "IVT",
ly_rd4iss >= "3" ~ "IVT and EVT")) %>%
# remove NA´s from 4ISS column
select(ly_rd4iss, classification_according_to_4ISS) %>%
View()
And the result is this table:
In line 26 the value "2" was correctly rewritten to "IVT".
In line 29 however, the value "2" was rewritten as "NA".
Has anyone had a problem like this before?
I also tried it with different data types.
By the way:
Why has the new mutated column a new variable label. This is one of another variable which has nothing to do with the calculation
The variable label of ly_rd4iss is wrong as well, although its correct in the original dataset.
Thank you and cheers,
Oli