# "error evaluating factor" with linear mixed effect model

**URL:** https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587
**Category:** User Support
**Created:** [July 8, 2019, 9:32pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587 "2019-07-08T21:32:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Lisa\_Crummett](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lisa_crummett/32/4280_2.png) [@Lisa\_Crummett](https://forum.qiime2.org/u/Lisa_Crummett)
#### Post date: [July 8, 2019, 9:32pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/1 "2019-07-08T21:32:53Z")

</div>

Hello. I would like to compare the relative abundance of a single taxon (feature ID is 0856ee30c4a451c9cac279adc5e34c24) over time ("Exper.Day") between two treatments. I would like to use a Linear Mixed Effects Model to do this. There are 3 replicates per treatment. The command that I used is pasted in below and the error message that I got is pasted in just below it.

qiime longitudinal linear-mixed-effects   
--i-table relativefrequencytable.qza   
--m-metadata-file metadata\_Day2onward.txt   
--p-metric 0856ee30c4a451c9cac279adc5e34c24   
--p-group-columns Treatment   
--p-state-column Exper.Day   
--p-individual-id-column Replicate   
--o-visualization linear-mixed-effects.qzv

I got this error message:Error evaluating factor: NameError: name 'Exper' is not defined  
f07f958c69e60461785756495e54f34b8 ~ Exper.Day \* Treatment

I have searched the forum to see if anyone else had this problem and I couldn't find anything. Please advise. I have attached the metadata text file. [metadata\_Day2onward.txt](https://forum.qiime2.org/uploads/short-url/58mBQnZ4xxIxYeYJfRrLYg2Vhmw.txt) (1.1 KB)

Thank you,

Lisa

---

<div class="post-metadata">

### Author: ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)
#### Post date: [July 8, 2019, 9:48pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/2 "2019-07-08T21:48:14Z")

</div>

Hi @Lisa_Crummett,  
I'm guessing here but I think the error is occurring because of the period between Exper and Day. Can you try putting quotes around it like "Exper.Day" and try again? You might have to use a different quoting, I can never remember which one to use in which plugin. Alternatively while someone corrects this you can also just rename your metadata column name to `ExperDay`

---

<div class="post-metadata">

### Author: ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)
#### Post date: [July 8, 2019, 9:49pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/3 "2019-07-08T21:49:40Z")

</div>

Welcome back to the forums Lisa,

I wonder if the `.` period in the middle of `Exper.Day` is causing a problem. Could you try renaming it to `ExperDay` and rerunning this command?

Let me know what you find,  
Colin

---

<div class="post-metadata">

### Author: ![Lisa\_Crummett](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lisa_crummett/32/4280_2.png) [@Lisa\_Crummett](https://forum.qiime2.org/u/Lisa_Crummett)
#### Post date: [July 8, 2019, 11:21pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/4 "2019-07-08T23:21:51Z")

</div>

Thank you for your quick reply Colin and also Mehrbod.  
I tried changing the name to "ExperDay" and now I am getting this error: **Cannot predict random effects from singular covariance structure.**

Not sure why I would get that because I have 2 treatments that were measured over multiple days?

What do you think?

Lisa

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [July 9, 2019, 12:55pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/5 "2019-07-09T12:55:23Z")

</div>



---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [July 9, 2019, 1:03pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/6 "2019-07-09T13:03:21Z")

</div>

> [@Lisa\_Crummett](#):
>
> I tried changing the name to “ExperDay” and now I am getting this error: **Cannot predict random effects from singular covariance structure.**

What is the command you are using now?

I recommend checking out the feature table — the issue may be with the abundance of that feature (e.g., all zero values?).

The issue is not one with the metadata... e.g., this command works (same as you used above but using a metadata value as the metric, rather than a feature):

```auto
qiime longitudinal linear-mixed-effects \
  --m-metadata-file metadata_Day2onward.txt \
  --p-metric MorningpH \
  --p-group-columns Treatment \
  --p-state-column ExperDay \
  --p-individual-id-column Replicate \
  --o-visualization linear-mixed-effects.qzv

```

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [July 9, 2019, 1:03pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/7 "2019-07-09T13:03:23Z")

</div>



---

<div class="post-metadata">

### Author: ![Lisa\_Crummett](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lisa_crummett/32/4280_2.png) [@Lisa\_Crummett](https://forum.qiime2.org/u/Lisa_Crummett)
#### Post date: [July 9, 2019, 9:09pm UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/8 "2019-07-09T21:09:27Z")

</div>

Thanks Nicholas. Maybe that was it. I tried using a different feature ID, one that I know didn't have all zeros, and it appears to be working because I haven't gotten any error messages... it is taking a surprisingly long time to process the command (given that it is analyzing only one feature ID). Fingers crossed though.

Thanks!  
Lisa

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [August 10, 2019, 3:09am UTC](https://forum.qiime2.org/t/error-evaluating-factor-with-linear-mixed-effect-model/10587/9 "2019-08-10T03:09:30Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
