Closed Generalized closed 2 months ago
OK, it was trivial...
(imp_mod_em_direct <- emmeans(as.mira(imp_mod),
specs = ~ Visit | Arm, adjust="none",
vcov = pooled_coefficients$pooled_VC)) # <--- I can pass the pooled vcov matrix this way directly, when everything else is already established.
Background: I have a longitudinal study. I want to assess trend in LS-means. Variable "visit" is ordinal factor with
Levels: Month 6 < Month 12 < Month 20
I also want to use other than default estimator of covariance.Problem: emmeans(as.mira(...)) takes defaults and runs fine. But I want to provide my own settings. So I need the qdrg() to use pooled myself parameters and vcov (so I can use the one I need). But the qrdg() way misses some things and it doesn't work.
Examples:
Let's fit the model first:
So far the "L" and "Q" is recognized by the fitting procedure.
Now let's pool and use basic emmeans over as.mira(...):
and test the trends:
OK, it works well.
Now, I don't want the default sandwich estimator of covariance but rather the bias-corrected robust one. I need to pass somehow this parameter, so I need to use qdrg and some programming.
This function will be required. It adapts the code from emmeans to pool estimates:
Let's pool the coefficients:
Now the grid:
When passed to emmeans, all values are same:
and the trends are "empty":
Is it possible to obtain the estimates for trends in this setting? I need the qdrg() to use specific covariance estimator and there seems to be no other way where I can use it. But somehow the information about the ordering in visits is lost or something else happens...
The data: 2 imputed datasets in a list.