I have data indicating quality of life (QOL) as a percentage score from questionnaire data. The data is longitudinal (collected at baseline, 3, 6, 9 and 12 months) and there are other covariates such as site and cancer type. To model these percentage scores I used a glm with binomial family and logit link. In R this was done by:

f1 <- glm(score_prop ~ time_fac + site + cancer, data=df, family = binomial(link="logit"))

where score_prop was the percentage score divided by 100 to convert to a proportion and time_fac was a categorical variable with 0 as the reference level and the other levels being the followup months. After fitting the model, cluster robust estimation was performed (subject id as a cluster).

As I understand it, the exponents of the model coefficients for time_fac are odds ratios. However, their interpretation is somewhat different to, say, a binary logistic regression. I would interpret the exponentiated coefficients as a multiplicative change in the "odds" of the QOL score relative to baseline (time_fac = 0). However, I am not so sure this kind "odds" (i.e. factional score / 1-fractional score) can be meaningfully interpreted.

In order to attempt at something more meaningful, I used the emmeans R package to compute contrasts of the estimated marginal mean proportions (percentages) as opposed to odds using:

em <- emmeans(f1, specs = "time_fac", type="response")

contrast(regrid(em), method="trt.vs.ctrl")

enter image description here

As I understand this, the absolute difference in marginal mean QOL % score at 3 months vs. baseline (top row) is 0.4% and this difference is not significant.

I wondered, however, if there is a way to get contrasts for the relative change? For example, the ratio of estimated marginal mean percentage score at each month compared to that at baseline. Or a contrast for the percentage change in the marginal mean percentage scores between time points (if that makes sense?)? I guess these would be ratio measures if they can be computed...?


1 Answer 1


Preface: There is another initial issue here, which is that your outcome looks like a continuous-style measure expressed as a proportion rather than a truly categorical outcome per se. So it may be that you can analyse these data treating the outcome as continuous, for example using a linear mixed model with a linear link: for estimating differences in means it seems unlikely that you'd be pushing the assumptions of such a model. I have addressed the question as written about estimating ratios from below.

Main answer:

For categorical outcomes, the answer is yes, you can take a logistic regression model and calculate absolute marginal differences (as you have here using emmeans) or relative marginal differences (the ratio of the two proportions).

Calculating these ratios (where sensible) might be possible using emmeans, but the package marginaleffects in my opinion wraps up some of these marginal estimation methods a bit more succinctly. The function in question is comparisons, and you can request ratio-type estimates using the comparison = "ratioavg" option.

https://vincentarelbundock.github.io/marginaleffects/ https://vincentarelbundock.github.io/marginaleffects/reference/comparisons.html

Addendum on emmeans

There is some discussion of how this can be achieved in emmeans on the GitHub issues tracking page as follows: https://github.com/rvlenth/emmeans/issues/48

  • 1
    $\begingroup$ Thank you James. The reason I chose glm with binomial family, logit link and robust standard errors was following suggestions of @Nick Cox et al e.g. stats.stackexchange.com/questions/585302/…, and stats.stackexchange.com/questions/62679/… (I hope I didnt misinterpret their recommendations). I believe the model I used is a fractional logit. $\endgroup$
    – user167591
    Commented Jun 20, 2023 at 9:21
  • 1
    $\begingroup$ A linear model did not seem sensible due to the response variable (% score) being bounded at 0 and 100%; giving predictions above and below these bounds which would be illogical. $\endgroup$
    – user167591
    Commented Jun 20, 2023 at 9:22
  • $\begingroup$ Also thanks James for suggesting marginaleffects package. Nevertheless, I would greatly appreciate @Russ Lenth opinion on this and whether such ratio contrasts can be performed in emmeans too :) $\endgroup$
    – user167591
    Commented Jun 20, 2023 at 10:45
  • $\begingroup$ Those are all good considerations. The question of whether a continuous-type model will work ok does depend on the bounding issue and sample size (e.g. whether confidence intervals will stick out over 0/1) which is also worth considering as a ceiling/floor effect issue (e.g. if responses tend to stick closer to the 100% end of the scale). I am in favour of simpler-while-sufficient models in general, so you are in the best position to make a call on this. $\endgroup$ Commented Jun 20, 2023 at 21:43
  • $\begingroup$ Also on emmeans: there is some discussion on the GitHub pages for emmeans, which may be useful (I didn't have the time to read it in detail). I'll add that as an addendum to the answer (easier for other people to see). $\endgroup$ Commented Jun 20, 2023 at 21:45

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.