# ANCOMBC analysis Pairwise comparison

**URL:** https://forum.qiime2.org/t/ancombc-analysis-pairwise-comparison/28972
**Category:** Other Bioinformatics Tools
**Tags:** ancom-bc
**Created:** [January 19, 2024, 4:13pm UTC](https://forum.qiime2.org/t/ancombc-analysis-pairwise-comparison/28972 "2024-01-19T16:13:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Chiara\_D](https://forum.qiime2.org/user_avatar/forum.qiime2.org/chiara_d/32/17576_2.png) [@Chiara\_D](https://forum.qiime2.org/u/Chiara_D)
#### Post date: [January 19, 2024, 4:13pm UTC](https://forum.qiime2.org/t/ancombc-analysis-pairwise-comparison/28972/1 "2024-01-19T16:13:59Z")

</div>

Hey,  
I've been trying to get the ancombc2 to run for me, i am new to using ancombc. I have 3 study groups that i would like to compare with pairwise but I keep running into an error:  
Error in names(x) \<- value :  
'names' attribute [3] must be the same length as the vector [2]

the pairwise works fine if it have pseudo\_sense = FALSE but once im setting it to TRUE, it doesnt work anymore.  
I used debug to see where the error occurs and found its from this line:  
`colnames(ss_flag_pair) = pair_col_name` and they do indeed not match up, however, i have no idea how to fix this issue.  
the ss\_flag\_pair only contains two of the studyarms, whereas pair\_col\_name has all three. when i looked at how they are both made, it seems that its only the 2 study arms as the it is the refernce group, but im not sure if thats the right conclusion/reason.

`output_pw1 <- ancombc2( data = ancom_phyl, tax_level = "Species", fix_formula = "studyarm", group = "studyarm", p_adj_method = "BH", pseudo_sens = TRUE, prv_cut = 0.10, struc_zero = TRUE, neg_lb = FALSE, global = TRUE, pairwise = TRUE, mdfdr_control = list(fwer_ctrl_method = "holm", B = 100) )`

I would greatly appreciate any insights or suggestions on how to resolve this issue. Thanks in advance for your help!

---

<div class="post-metadata">

### Author: ![gregcaporaso](https://forum.qiime2.org/user_avatar/forum.qiime2.org/gregcaporaso/32/17769_2.png) [@gregcaporaso](https://forum.qiime2.org/u/gregcaporaso)
#### Post date: [January 22, 2024, 5:24pm UTC](https://forum.qiime2.org/t/ancombc-analysis-pairwise-comparison/28972/2 "2024-01-22T17:24:38Z")

</div>

Hi @Chiara_D,  
Because this isn't a question about QIIME 2 specifically, you may or may not get a reply here. We'll leave your post and someone may jump in and help, but you also may wish to contact the developers of the R package that you're using through whatever means they provide for getting technical support.

Good luck!

---

<div class="post-metadata">

### Author: ![andresarroyo](https://forum.qiime2.org/user_avatar/forum.qiime2.org/andresarroyo/32/15245_2.png) [@andresarroyo](https://forum.qiime2.org/u/andresarroyo)
#### Post date: [January 23, 2024, 12:36pm UTC](https://forum.qiime2.org/t/ancombc-analysis-pairwise-comparison/28972/3 "2024-01-23T12:36:05Z")

</div>

Hi @Chiara_D,

I experienced a similar error when I used _pseudo\_sense = TRUE_ two months ago. The ANCOMBC2 paper was under revision and the developer was updating the code according to reviewer's suggestions. At that moment, they recommeded a fresh ANCOMBC2 installing from GitHub. Maybe, you could try it and also you could check the official GitHub page to check the issues.

Good luck!
