opensafely-core / r-docker

Docker image for running R scripts in OpenSAFELY
1 stars 3 forks source link

add R package: WeightIt #105

Closed JamesAFarrell closed 1 year ago

JamesAFarrell commented 2 years ago

Could the WeightIt package please be added? It has multiple methods for weighting observations. Thanks! https://cran.r-project.org/web/packages/WeightIt/index.html

ghickman commented 2 years ago

@JamesAFarrell – @wjchulme has helpfully pointed out that this will only work with packages hosted on CRAN for the purposes of our image, will that still be of use to you?

JamesAFarrell commented 2 years ago

Hi @ghickman and @wjchulme, I think so but not 100% sure.

My analysis is based on this example which only requires WeightIt and cobalt packages: https://cran.r-project.org/web/packages/cobalt/vignettes/cobalt.html#using-cobalt-with-multi-category-treatments

WeightIt::weightit(race ~ cov.mn, data = lalonde, method = "ps", use.mlogit = FALSE)

ghickman commented 2 years ago

Thanks @JamesAFarrell, that sounds like it should be fine for this then.