I am running an analysis with one predictor of interest and several categorical covariates. As the tutorial said, for the reference parameter, “semi-colon delimited for multiple variables”.
My current code goes like this:
Maaslin2(input_data, input_metadata,‘demo_output’, transform = “AST”,
max_significance = 0.1,
fixed_effects = c(“sex”,“age_group”,“BMI_g”,“smoking”,
“alcohol”,“MET_g”,“red_meat”),
normalization = ‘NONE’,
reference = c(“age_group,50plus”,“BMI_g,24minus”,“smoking,non-smoker”,
“alcohol,no”,“MET_g,A”,“red_meat,1pw_minus”))
but it doesn’t work well for the covariates. So I wonder how to set the reference parameter for multiple variables.
Apologies for not being clearer in the tutorial! We should add an example where we set multiple references for different variables - I will add that to our improvements list.
I haven’t tried @nickp60 method, thank you for offering that one! Adding more parentheses should also work (e.g. -
Error in Maaslin2(input_data = otus.r, input_metadata = metadat.sub, output = “16S_output.trt”, :
Please provide the reference for the variable ‘Treatmentmod’ which includes more than 2 levels: Bare, Radish, Mustard.