# How to select fixed\_effects

**URL:** <https://forum.biobakery.org/t/how-to-select-fixed-effects/5768>\
**Category:** MaAsLin\
**Created:** [August 14, 2023, 9:22am UTC](https://forum.biobakery.org/t/how-to-select-fixed-effects/5768 "2023-08-14T09:22:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user1](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/user1/32/1131_2.png) [@user1](https://forum.biobakery.org/u/user1)\
**Post date:** [August 14, 2023, 9:22am UTC](https://forum.biobakery.org/t/how-to-select-fixed-effects/5768/1 "2023-08-14T09:22:46Z")

</div>

Hi,  
I am a newbie to the Maaslin2 package. I used my data and have this error:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/c/c9a061aad58ef65646d301494cd858aa9e925ce3.png)

```auto
AGP_fit_data <- Maaslin2(
  mpse2_4groups_keep.Phylum.heatmap_Phylum.data_aggregate_t_sel, 
  sampleda_select_F_sub, 
  'AGP_Family_output3',
  normalization = "NONE",
  fixed_effects = c("Group","bmi"),
  random_effects = c("sex"),
  reference = c("Group,Normal"))

```

If i change `fixed_effects = c("Group","bmi")` to `fixed_effects = c("Group")`, everything goes smoothly  
Here is my question : compare to [demo data](https://github.com/biobakery/biobakery/wiki/maaslin2#32-running-maaslin2), `Group` equeal to `diagnosis` and `bmi` equal to `dysbiosis`, but why things go wrong when i run in my data?  
Could you tell me how to fix it and draw the plot down below(correlation between bacterial abundance and bmi)

Much appreciate.  
Rainjie  
[subset\_data.csv](https://forum.biobakery.org/uploads/short-url/9SwKj0BDwfGZMfpcR57HAdSe3Ua.csv) (11.0 KB)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/0/0c63c979ed297779e25cc2b6547fefbb42c357a2.jpeg)

---

<div class="post-metadata">

**Author:** ![nearinj](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nearinj/32/2135_2.png) [@nearinj](https://forum.biobakery.org/u/nearinj)\
**Post date:** [August 14, 2023, 6:10pm UTC](https://forum.biobakery.org/t/how-to-select-fixed-effects/5768/2 "2023-08-14T18:10:16Z")

</div>

Hi @user1,

Hope your are doing well!

The issue seems to be that you have BMI coded as a factor and not a numeric. When coded as a factor Maaslin2 will treat it as if it’s a categorical variable and not a numeric variable. I would check what type of variable BMI is and then change it to a numeric with:

```auto
as.numeric(BMI)

```

Cheers,  
Jacob Nearing

---

<div class="post-metadata">

**Author:** ![user1](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/user1/32/1131_2.png) [@user1](https://forum.biobakery.org/u/user1)\
**Post date:** [August 15, 2023, 6:55am UTC](https://forum.biobakery.org/t/how-to-select-fixed-effects/5768/3 "2023-08-15T06:55:08Z")

</div>

You are right!, I should double-check this, sorry to bother you 😀
