# Negative binomial regression on numerical variables

**URL:** <https://discourse.scverse.org/t/negative-binomial-regression-on-numerical-variables/432>\
**Category:** scvi-tools\
**Tags:** scvi\
**Created:** [May 3, 2022, 2:47pm UTC](https://discourse.scverse.org/t/negative-binomial-regression-on-numerical-variables/432 "2022-05-03T14:47:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lijinbio](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@lijinbio](https://discourse.scverse.org/u/lijinbio)\
**Post date:** [May 3, 2022, 2:47pm UTC](https://discourse.scverse.org/t/negative-binomial-regression-on-numerical-variables/432/1 "2022-05-03T14:47:43Z")

</div>

Hi all,

I am trying to use scVI to do negative binomial regression on numerical variables as well as correcting sample batches. Say,

```auto
Full model: ~ pseudotime + sampleID
Reduced model: ~ sampleID

```

Here, the pseudotime is a numerical variable that has been estimated for single cells, and the sampleID is to correct the sample batches. The goal here is to detect pseudotime-correlated genes by excluding sample batches. I understand scVI implements an interface differential\_expression() to do the differential gene expression after batch correction, but it is used for categorical groups if I understand it correctly. Could you please help suggest how could I implement a negative binomial regression on continuous numerical variables using scVI? Thanks.

---

<div class="post-metadata">

**Author:** ![adamgayoso](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/adamgayoso/32/100_2.png) [@adamgayoso](https://discourse.scverse.org/u/adamgayoso)\
**Post date:** [October 5, 2022, 11:14pm UTC](https://discourse.scverse.org/t/negative-binomial-regression-on-numerical-variables/432/2 "2022-10-05T23:14:05Z")

</div>

Something like this is not possible at the moment, though we are thinking about this direction.
