nicoballarini / SubgrPlots

Graphical displays for subgroup analysis in clinical trials
Other
2 stars 0 forks source link

The variables for defining subgroups are not categorical #1

Open hao203 opened 2 years ago

hao203 commented 2 years ago

Hi, How are you

I used the package. and the variables are all factors. However, there is an error.

The variables for defining subgroups are not categorical.

library(SubgrPlots)
subtar <- select(tar_ldl, -TG,-TC,-LDL,-HDL,-t_TG,-t_TC,-t_LDL,-t_HDL) %>% 
  filter(group == "statin"|group == "statin_EZ")
subtar <- mutate(subtar,sex=factor(sex), group= factor(ifelse(group == "statin",0,1)),hbp=factor(hbp))
plot_forest(subtar,
            covari.sel = c(2,4),#vars
            trt.sel = 1,
            resp.sel = 8,
            outcome.type = "binary")

image

image