You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few items have come up regarding IPTW. One additional diagnostic plot to add is a weighted histogram for continuous variables. This way it can be visually assessed whether the densities are similar between the weighted population by treatment. In the mean time this can be accomplished via:
ipw = IPTW(data, exposure="A", outcome="Y")
ipw.treatment_model("L")
# Extracting the estimated IPTW from the IPTW class
data['iptw'] = ipw.iptw
# Subset by treatment status
treat = data.loc[data["A"] == 1].copy()
nottr = data.loc[data["A"] == 0].copy()
# Weighted histogram
plt.hist(treat['L'], weights=treat['iptw'], color='blue', alpha=0.4)
plt.hist(nottr['L'], weights=nottr['iptw'], color='red', alpha=0.4)
plt.show()
Next, IPTW should allow access to the fitted statsmodels objects. This way proportions (and the correct CL) can be calculated for any combination of interest to users. It is easier to have the statsmodels objects directly changed rather than building my own wrapper to extract any combination correctly (since it requires manipulation of the variance-covariance matrix). But may consider depending on user feedback
The text was updated successfully, but these errors were encountered:
A few items have come up regarding
IPTW
. One additional diagnostic plot to add is a weighted histogram for continuous variables. This way it can be visually assessed whether the densities are similar between the weighted population by treatment. In the mean time this can be accomplished via:Next,
IPTW
should allow access to the fittedstatsmodels
objects. This way proportions (and the correct CL) can be calculated for any combination of interest to users. It is easier to have thestatsmodels
objects directly changed rather than building my own wrapper to extract any combination correctly (since it requires manipulation of the variance-covariance matrix). But may consider depending on user feedbackThe text was updated successfully, but these errors were encountered: