# Maaslin2 not recognizing reference group

**URL:** <https://forum.biobakery.org/t/maaslin2-not-recognizing-reference-group/6227>\
**Category:** MaAsLin\
**Created:** [November 21, 2023, 3:32pm UTC](https://forum.biobakery.org/t/maaslin2-not-recognizing-reference-group/6227 "2023-11-21T15:32:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![herm98](https://avatars.discourse-cdn.com/v4/letter/h/b5e925/32.png) [@herm98](https://forum.biobakery.org/u/herm98)\
**Post date:** [November 21, 2023, 3:32pm UTC](https://forum.biobakery.org/t/maaslin2-not-recognizing-reference-group/6227/1 "2023-11-21T15:32:12Z")

</div>

Maaslin2 v 1.16.0

Hello, I have relative abundance data across 6 different groups and I am trying to set the reference as the “a\_LF” group:

fit\_data4 ← Maaslin2(input\_data = input\_data4,  
input\_metadata = input\_metadata4,  
fixed\_effects = c(“Diet”),  
reference = c(“a\_LF”),  
output = “output”)

and I am getting the following error:

Error in Maaslin2(input\_data = input\_data4, input\_metadata = input\_metadata4, : Please provide the reference for the variable ‘Diet’ which includes more than 2 levels: a\_LF, b\_LFHC, c\_LFVHC, d\_HF, e\_HFHC, f\_HFVHC

Here is some of my metadata:

![Screenshot 2023-11-21 at 9.29.08 AM](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/7/7330a738c3066fd5d31e12f4b1d58b9454478739.png)

I’ve tried renaming the different groups with and without the “a\_” or as numbers but nothing seems to be working. Any ideas? Thank you!

---

<div class="post-metadata">

**Author:** ![himel.mallick](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/himel.mallick/32/1757_2.png) [@himel.mallick](https://forum.biobakery.org/u/himel.mallick)\
**Post date:** [December 11, 2023, 3:22pm UTC](https://forum.biobakery.org/t/maaslin2-not-recognizing-reference-group/6227/2 "2023-12-11T15:22:03Z")

</div>

Hi @herm98 - as mentioned in the manual, you need to specify the reference as follows:

`The factor to use as a reference for a variable with more than two levels provided as a string of 'variable,reference' semi-colon delimited for multiple variables. `

Thanks,  
Himel
