Open csthiago opened 4 days ago
datagrid()
sets all unnamed variables to their mean or mode. That could be a difference, but I don't know what the ate()
function does.
the ate calculates the average treatment effect using g-formula (or ipw or double robust). I have redone using dt > mutate and the PE is equal (silly me). The CI is different, but the riskRegression uses influence function instead delta. Just to confirm one point. To calculate risk difference for cox regression (in each time), the sytanx would be:
avg_comparisons(fit, variables = "rx",by="time",
type="survival")
and for risk ratio would be type="lp" ?
Thanks
As always, this function computes a difference on the specified scale. Here, type="lp"
means a difference between the two groups on the linear probability scale.
You can compute ratios instead of differences on any scale, by specifying type
with avg_comparisons(fit, variables = "rx", comparison = "ratio")
Hi Vincent,
I was testing the marginaleffects with cox regression. I get slightly different results that using predict from survival (point estimate).
The value I get from avg_comparisons is
The point estimate using predict is 0.1034387 and the values from riskRegression ATE is:
Do you have any idea why the difference?
Thank you very much