-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference results marginaleffects vs riskRegression/predict (cox) #1237
Comments
|
the ate calculates the average treatment effect using g-formula (or ipw or double robust).
and for risk ratio would be type="lp" ? Thanks |
As always, this function computes a difference on the specified scale. Here, You can compute ratios instead of differences on any scale, by specifying |
To do g-computation using
Note that the predictions are on the survival probability scale when setting
To get the risk ratio, you again need to manually program the comparison because the usual method of setting
This uses a symmetric confidence interval around the ratio, which may not be accurate. Instead, we can compute the symmetric confidence interval around the log of the risk ratio and then exponentiate that:
The point estimate will be the same, and agrees with that of Note, to get the marginal risk predictions using
|
Thank you very much, @ngreifer ! |
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
The text was updated successfully, but these errors were encountered: