R/get.weights.num.R

Defines functions get.weights.num

Documented in get.weights.num

get.weights.num <- function(iptw, fitList){
	hdWt <- rep(1, length(iptw$psList[[1]]$treat))
	for(i in 1:length(iptw$psList)){
		hdPred <- fitted(fitList[[i]]) * iptw$psList[[i]]$treat + (1-fitted(fitList[[i]])) * (1-iptw$psList[[i]]$treat)
		hdWt <- hdWt * hdPred
	}
	return(hdWt)
}

Try the twang package in your browser

Any scripts or data that you put into this service are public.

twang documentation built on May 2, 2019, 6:53 p.m.