Let's say I want to perform a logistic regression (binomial) as :

X ~ P1 + P2 + P3 + P4 + P5

where X is binary variable (0 or 1) and P1, P2, P3, P4, P5 are proportion of cell type ( e.g. P1 = proportion of T-cells ; P2 = proportion of B-Cells, etc..). The sum of P1, P2, P3, P4 and P5 is 1 for each observation.

Can I perform a univariate regression for each Px variable e.g X ~ P1 and a multivariate regression with all Px variables knowing that the sum of all Px is always 1 ?

  • 4
    $\begingroup$ Multivariate regression means multiple responses, not multiple predictors. The fashion for calling a regression with one predictor univariate seems bizarre to me: I can think of nothing more intrinsically bivariate than the relationship between two variables.. That said, it is common to omit one predictor in these circumstances. $\endgroup$
    – Nick Cox
    Dec 6, 2022 at 12:04
  • 4
    $\begingroup$ All of the $P_i$ summing to 1 implies that the design matrix with an intercept is rank-deficient. Excluding the intercept or one of the $P_i$ will fix that. $\endgroup$
    – Sycorax
    Dec 6, 2022 at 12:35
  • $\begingroup$ ... or regularize, e.g., using GLMNet. $\endgroup$ Dec 6, 2022 at 12:55

1 Answer 1


Variables representing parts of a total, like your proportion of cell type, are called , for more information you can peruse that tag.

But in your case the solution is simple. Your design matrix will be rank-deficient, since the sum P1 + P2 + P3 + P4 + P5 will equal the intercept. That way the intercept is included in the design matrix in two different ways. The most practical (that is, interpretable) solution is to omit the intercept from the model. In R that would be something like

glm(X ~ 0 + P1 + P2 + P3 + P4 + P5, family=binomial, 

The ~ 0 + part of the formula means omit the intercept.

User whuber points to another sort of analysis, using logratio transformation. See How to perform isometric log-ratio transformation

  • 1
    $\begingroup$ This can also be accomplished by using -1 instead of 0 right? $\endgroup$ Dec 6, 2022 at 13:18
  • 2
    $\begingroup$ @ShawnHemelstrand: Correct. $\endgroup$ Dec 6, 2022 at 13:23
  • $\begingroup$ Thank you for the tip. Other question regarding P1, P2, P3, etc.. One of the regressor has a much higher value than the other ones i.e. P1 has on average 0.90 and the other P2, P3, P4 and P5 sums to the remaing 0.10. Should I scale each Px ( e.g. using R scale() function ) prior the regression ? Thanks $\endgroup$ Dec 6, 2022 at 13:48
  • 1
    $\begingroup$ @NicolasRosewick: I cannot see any reason to do so. For the future, please ask new questions as formally new questions and not as follow-up comments. The include more information such as sample size. $\endgroup$ Dec 6, 2022 at 13:52
  • 3
    $\begingroup$ @NicolasRosewick When your variables tend to be at extreme values (near 0 or 1), sometimes (often?) a suitable transformation will improve your model. See stats.stackexchange.com/a/259223/919 for details. The family of transformations discussed there will automatically solve your rank-deficiency problem, because your five variables will be transformed into four variables containing all the relevant information. $\endgroup$
    – whuber
    Dec 6, 2022 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.