# ERROR::No fixed effects included in formula.NEED HELP! SOS!

**URL:** <https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208>\
**Category:** MaAsLin\
**Created:** [June 28, 2024, 9:25am UTC](https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208 "2024-06-28T09:25:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nnnpj0624](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nnnpj0624/32/2903_2.png) [@nnnpj0624](https://forum.biobakery.org/u/nnnpj0624)\
**Post date:** [June 28, 2024, 9:25am UTC](https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208/1 "2024-06-28T09:25:45Z")

</div>

WARNING::Feature name not found in metadata so not applied to formula as fixed effect: antibiotics , d90\_outcome  
2024-06-28 17:15:03.29544 ERROR::No fixed effects included in formula.  
Error in Maaslin2(input\_data = data, input\_metadata = DMI\_data, min\_abundance = 1e-04,

Hello, I am using MaAslin for data analysis. After correctly defining the input data and input metadata, and confirming that my fixed effect definitely exists in the input metadata, R always throws an error. I am not sure what the problem is and I hope to get help. Thank you very much.

---

<div class="post-metadata">

**Author:** ![Kelsey\_Thompson](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/kelsey_thompson/32/65_2.png) [@Kelsey\_Thompson](https://forum.biobakery.org/u/Kelsey_Thompson)\
**Post date:** [June 28, 2024, 3:02pm UTC](https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208/2 "2024-06-28T15:02:29Z")

</div>

Hi @nnnpj0624,

Thank you for raising this issue. Can you please give us some additional information? Are you running in R or on Galaxy (it looks like you may have commented on some Galaxy posts)?

If you are running in R can you provide us with your R version, MaAsLin version, and the code you used to run R?

Thank you!  
Best,  
Kelsey

---

<div class="post-metadata">

**Author:** ![nnnpj0624](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nnnpj0624/32/2903_2.png) [@nnnpj0624](https://forum.biobakery.org/u/nnnpj0624)\
**Post date:** [June 30, 2024, 7:15am UTC](https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208/3 "2024-06-30T07:15:21Z")

</div>

Subject: Issue with MaAslin2 Execution in R

Dear Developer,

I hope this message finds you well. I am encountering an issue while running MaAslin2 in R and would appreciate your assistance. Here are the details of my situation:

I am using the following R version and MaAslin2 package version:

```auto
**R version 4.3.3** (2024-02-29)
**MaAslin2 version：**
**[1] '1.16.0'**

```

The code I am executing is:

```r
library(MaAslin2)
fit_data_gender <- MaAslin2(
  input_data = data,
  input_metadata = DM_data,
  min_abundance = 0.0001,
  min_prevalence = 0.1,
  output = "DM_Group_outcome_antibio__CPLM_CSS",
  fixed_effects = c("d90_outcome", "Group", "antibiotics"),
  random_effects = c('studyID'),
  analysis_method = c("CPLM"),
  normalization = c("CSS"),
  standardize = FALSE,
  plot_heatmap = FALSE,
  plot_scatter = FALSE
)

```

The error message I receive is:

```auto
2024-06-30 15:03:05.18642 ERROR::No fixed effects included in formula.
Error in Maaslin2(input_data = data, input_metadata = DM_data, min_abundance = 1e-04, : 

```

Additionally, there are warnings indicating that feature names are not found in the metadata and thus not applied to the formula as fixed effects. Here is an excerpt from the warnings:

```auto
WARNING::Feature name not found in metadata so not applied to formula as fixed effect: d90_outcome, Group, antibiotics

```

I have checked the `DM_data` and the variables `antibiotics`, `d90_outcome`, and `Group` are indeed present, with values as follows:

```r
DM_data$antibiotics
# [1] N N N N Y Y N Y Y Y Y N Y Y N Y Y Y Y Y Y N N N N N N N N N N N N N N N N N N N N N N Y Y
 [46] Y Y N Y Y Y N N Y Y Y N Y Y N Y N N Y N Y Y N N Y Y N Y Y N N N N Y Y Y N Y Y N N N Y Y N
 [91] N Y N Y Y Y Y Y Y N N Y N Y Y N Y Y Y Y Y Y Y Y Y N N N N N N N N N N N N N N N N N N N N
[136] N N N N N N N N N N N
Levels: N Y

DM_data$d90_outcome
# [1] 2 2 2 2 1 2 2 1 1 2 2 1 2 2 1 2 1 1 1 1 1 2 1 1 2 1 1 1 1 2 1 1 1 1 1 1 2 2 2 1 2 2 2 1 1
 [46] 1 1 2 1 1 1 1 2 2 1 1 2 2 1 1 1 1 1 1 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 2 2 2 2 1 2 2 2 2 1 2
 [91] 1 1 1 2 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 2
[136] 1 1 1 1 2 2 2 2 2 1 1
Levels: 1 2

DM_data$Group
# [1] DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI
 [23] DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMI DMW DMW DMW DMW
 [45] DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW
 [67] DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW
 [89] DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW
[111] DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW
[133] DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW DMW
Levels: DMI DMW HC

```

I am unsure what the issue might be and would be grateful for any guidance you could provide. Thank you very much for your time and assistance.

Best regards

---

<div class="post-metadata">

**Author:** ![nnnpj0624](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/nnnpj0624/32/2903_2.png) [@nnnpj0624](https://forum.biobakery.org/u/nnnpj0624)\
**Post date:** [July 1, 2024, 12:26am UTC](https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208/4 "2024-07-01T00:26:27Z")

</div>

Previously, I never encountered this issue when using the MaAslin2 tool for analysis in R language. However, a few days ago, during the execution of a MaAslin analysis, it seemed to have frozen and crashed. As a result, I forcibly terminated the running code, and since then, I’ve been facing this bug. I have tried clearing the environment, restarting the R platform, and even rebooting my computer, but none of these actions have resolved this issue.

---

<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:** [July 3, 2024, 7:46pm UTC](https://forum.biobakery.org/t/error-no-fixed-effects-included-in-formula-need-help-sos/7208/5 "2024-07-03T19:46:02Z")

</div>

Hi @nnnpj0624,

What is the initial format of the feature table that you are inputting? Do you have a small sub sampling that you could provide? Additionally could you try running something like this:

```auto
fit_data <- Maaslin2(
  data, DM_data, 'test',
  fixed_effects = c('d90_outcome', 'Group','antibiotics'),
  random_effects = c('studyID'),
  standardize = FALSE, cores=1)

```

And let me know if that runs without error?

Thanks,  
Jacob Nearing
