Closed Generalized closed 10 months ago
Ahhh, I'm sorry - my fault! I didn't put the entire formula into qdrg
> (lord_grid <- qdrg(formula = ODIPain ~ Visit_nOrd * Arm + Age_centered + Age_centered : Visit_nOrd,
+ data=data,
+ coef = fitmod$coefficients,
+ vcov = fitmod$robust.variance,
+ df = Inf,
+ ordinal.dim =length(levels(data$ODIPain)),
+ link = fitmod$link))
'emmGrid' object with variables:
Visit_nOrd = Month 6, Month 12, Month 20
Arm = A, B
Age_centered = -2.4336e-15
Transformation: “Cumulative logit”
>
> (lord_em <- emmeans(lord_grid, specs = ~Arm * Visit_nOrd , data=data))
Arm Visit_nOrd emmean SE df asymp.LCL asymp.UCL
A Month 6 -1.050 0.243 Inf -1.53 -0.574
B Month 6 -1.091 0.513 Inf -2.10 -0.085
A Month 12 -1.481 0.417 Inf -2.30 -0.664
B Month 12 -0.927 0.523 Inf -1.95 0.098
A Month 20 -1.602 0.419 Inf -2.42 -0.781
B Month 20 -0.782 0.520 Inf -1.80 0.237
Results are given on the Cumulative logit (not the response) scale.
Confidence level used: 0.95
> update(contrast(lord_em,
+ list("Month 6 : SoC vs. HD" = c(-1, 1, 0, 0, 0, 0),
+ "Month 12 : SoC vs. HD" = c( 0, 0,-1, 1, 0, 0),
+ "Month 20 : SoC vs. HD" = c( 0, 0, 0, 0,-1, 1))),
+ adjust="none", level = 0.95, infer = c(TRUE, TRUE))
contrast estimate SE df asymp.LCL asymp.UCL z.ratio p.value
Month 6 : SoC vs. HD -0.041 0.321 Inf -0.671 0.589 -0.127 0.8990
Month 12 : SoC vs. HD 0.555 0.360 Inf -0.152 1.261 1.538 0.1240
Month 20 : SoC vs. HD 0.820 0.351 Inf 0.132 1.507 2.335 0.0200
Note: contrasts are still on the Cumulative logit scale
Confidence level used: 0.95
I apologize for the confusion and close the issue.
Dear @rvlenth ,
I'm not sure if this is a bug (I'm reporting as such but it may be my fault), but I encountered the following behaviour.
The data: data from a 3-visit longitudinal study, where I analyse the Pain components of the ODI questionnaire (Oswestry Disability Index) between two treatment arms, A and B. The data are available at the end of this post.
Preview of the data
We have the PatientId (cluster), ODIPain score, baseline ODI pain, centered Age and Visit. ODIPain is ordered, so is Visit_nOrd
Let's fit the "naive" analysis, treating levels as equidistant, so the conditional means make sense:
OK, now let's move to the GEE-estimated ordinal logistic regression:
then emmeans
The data used for the analysis (secret parts removed or obfuscated).
R 4.2.0