I am doing for subgroup analysis of early mortality (Outcome) based on Transfusion(WITH ADJUSTMENT for both Sex and RACE), I got the results showing that transfusion is associated with higher mortality, while in the un-adjusted model (after EXCLUSION of Sex and race from the adjustment) and doing subgroup based on sex and race, I got more reasonable results (shown below: Transfusion is associated with less risk of mortality).
I added collinearity results using vif and no-collinearity exist.
I need to know why the results flipped with adjustment as it doesn't make any clinical sense to get lower mortality in the entire cohort and higher mortality in each subgroup of sex.
Is it statistically wrong to adjust for sex and race then do subgroup based on them?
########## Figure 1. The HR < 1 for transfusion (un-adjusted), so I am wondering why HR > 1 after adjusting for sex and race
library(Publish)
Publish::publish(E<-glm(Outcome ~ Transfusion, family = "binomial", data =di ),digits = 3)
# Variable Units OddsRatio CI.95 p-value
# Transfusion 0 Ref
# 1 0.880 [0.786;0.985] 0.0263
sub_log <- subgroupAnalysis(E,di,treatment="Transfusion",
subgroups=~Sex+ RACE, factor.reference="inline"); sub_log ;plot(sub_log)
########## Figure 2. The HR > 1 after adjusting for sex and race for transfusion vs no transfusion in each subgroup
Publish::publish(E<-glm(Outcome ~ Sex+ RACE + Transfusion, family = "binomial", data =di ),digits = 3); car::vif(E)
sub_log <- subgroupAnalysis(E,di,treatment="Transfusion",
subgroups=~Sex+ RACE, factor.reference="inline"); sub_log ;plot(sub_log)
########## Figure 3.The details of my dataframe (big data)
table(di$Sex, di$RACE, di$Outcome, di$Transfusion)
Figure 1. The HR < 1 for transfusion, so I am wondering why HR > 1 after adjusting for sex and race
Figure 2. The HR > 1 after adjusting for sex and race for transfusion vs no transfusion in each subgroup

Figure 3. The details of my dataframe (big data) is as follow
Edits
I am adding the results of logistic regression after adding interaction term based on @Robert.Long's precious input that is showing a higher mortality among women without statistical difference based on transfusion. I believe that the use of subgroup analysis is essential if we want to show the odds ratio of transfusion in each sex subset with adjustment considering acknowledgement of the limitations.


