OHDSI Home | Forums | Wiki | Github

fitOutcomeModel with inversePtWeighting = TRUE


(cyanover) #1

Hello,

I am fitting an outcome model with IPTW as follows:

outcomeModel <- fitOutcomeModel(population = ps, modelType = “cox”, inversePtWeighting = TRUE)

and it seems that the estimated effect remains unchanged for various ps$propensityScore values. Looking at fitOutcomeModel’s code, it seems that informativePopulation$weight is calculated, but never used … or perhaps I’m missing something?

Thanks!


(Martijn Schuemie) #2

Hmmm, the weights do get used:

  • Set as a property of informativePopulation here
  • Which is transformed to outcomes here
  • Which is used to create cyclopsData here
  • Which is used to fit the outcome model here

Are the results exactly the same with and without IPTW?


(cyanover) #3

Thanks, @schuemie. I may be missing something, but weight does not seem to be one of the columns used in transforming informativePopulation to outcomes (here).

And, as far as I can tell, outcome models (coefficients, estimated effects) setting inversePtWeighting to either TRUE or FALSE are identical.


(Martijn Schuemie) #4

Hmmm, you’re right! Good catch.

I created a fix in the develop branch. I’ve tested it, and it seems to work. You can install this version using:

devtools::install_github("ohdsi/CohortMethod", ref = "develop")

(cyanover) #5

Great, thanks @schuemie for the quick fix! I am wondering, can plotKaplanMeier draw a ps-weighted KM plot?

Thanks!


(Martijn Schuemie) #6

No, sorry, plotKaplanMeier currently does not support per-person PS weighting, although it does support weighting in PS strata and matched sets. Although… given that some form of weighting is already implemented, it should be easy to add. You might actually already achieve it just by putting every person in a unique stratum (add a stratumId column to the population object with a unique number per row)

Just so you know, in general we don’t use IPTW because it’s performance is pretty bad compared to PS stratification and matching (yes, even with the bug fixed). See this paper.


t