I am looking for a way to compare the results from two lmRob() functions statistically.
Would that be a possible option for me:
lmrob_female <- robust::lmRob(Y ~ X_binary + covariate1 + covariate2 + covariate3, data = df_original, subset=sex==0)
lmrob_male <- robust::lmRob(Y ~ X_binary + covariate1 + covariate2 + covariate3, data = df_original, subset=sex==1)
predicted_lmrob_female <- predict(lmrob_female) predicted_lmrob_male <- predict(lmrob_male)
predicted_lmrob_data <- data.frame( predicted_values = c(predicted_lmrob_female, predicted_lmrob_male), sex = factor(rep(c("female", "male"), times = c(length(predicted_lmrob_female), length(predicted_lmrob_male))) ))
comparison <- aov(predicted_values ~ sex, data = predicted_lmrob_data) summary(comparison)
Here is an explanation what I am trying to do: My professor wants me to compare the results of two ancovas (one for each sex) in another anova with each other. But based on my assumptions for the ancovas, I need to use a robust model -> lmRob()