Continuing the discussion from Error in paste(lvl_batch[ind_exposure & !ind_exposure_cat], collapse = ", ") : object 'lvl_batch' not found:
Hi BioBakery Team -
I am running into the same issue as @fconstancias from the linked discussion. I have multiple studies which I am attempting to use MMUPHin to normalize and combine to identify possible micobial composition differences between levels of biological variables.
When running the code:
> fit_lm_meta <- lm_meta(feature_abd = abd_adj,
> batch = "study_name",
> exposure = "tc_cat",
> covariates = c("sex", "bmi_cat"),
> data = meta,
> control = list(verbose = FALSE))
I am getting a similar error:
> "Error in check_exposure(df_meta[[exposure]], var_batch) :
> object 'lvl_batch' not found"
In the thread, @fconstancias noted that the error arose due to having more than two levels in the exposure argument. Similarly, I am interested in variables such as total cholesterol and blood pressure, which have more than two categories. For instance: desireable, borderline high, and high for total cholesterol; normal, elevated, stage 1, and stage 2 for blood pressure.
Of course, I could always collapse the variables of interest into two categories, such as normal or abnormal total cholesterol. However, this oversimplifies the data and does not help answer my question of whether there are differences in microbial composition between each level.
From reading the previous thread, @fconstancias question of “Is it possible to run pairwise test to compare Treatment A, B and C? And not just Treatment vs/ Control” was never answered. I am following up to see if this is possible in the MMUPHin workflow.
Thanks for any guidance you can provide.