Skip to contents

This calculates stablised inverse probability weights. Currently only works with a binary outcome variable.

Usage

dh.stablisedWeights(
  glm_object = NULL,
  responder_df = NULL,
  responder_var = NULL,
  non_responder_level,
  responder_level,
  new_obj = NULL,
  conns = NULL
)

Arguments

glm_object

A fitted ds.glmSLMA object.

responder_df

A serverside data frame containing the responder variable.

responder_var

Character vector of outcome variable within responder_df.

non_responder_level

Character vector indicating level of responder_var corresponding to non-responders.

responder_level

Character vector indicating level of responder_var corresponding to responders.

new_obj

A character string for the name of the new object to store stabilized weights.

conns

DataSHIELD connections object.

Value

Stabilized weights assigned as serverside object new_obj

Details

The function performs the following steps:

  1. Generate predicted values from the GLM model.

  2. Calculate proportions of a binary outcome using the outcome data.

  3. Format the proportions data for analysis.

  4. Create stabilized weights using the formatted proportions and GLM predictions.

Note

Currently only works with binary outcome variable.