rje42 / causl

Methods for Specifying, Simulating from and Fitting Causal Models
12 stars 3 forks source link

Clear demonstration on how parameters (beta, phi) are used in data generation for each family? #15

Open linyingyang opened 3 months ago

linyingyang commented 3 months ago

It seems hard to find how the parameters specified / input by users will be used in data generation for a particular family. For example, suppose I have $A$ (binary treatment indicator) ~ $I_1+I_2+I_3+X_1$ where $I_j$ denotes instrumental variables, $X_j$ denotes confounders. The family specified for this fomula is 'Bernoulli', where I want the propensity score / the parameter for the bernoulli distribution to be $expit(\beta_0 + \beta_1I_1 + \beta_2I_2 + \beta_3I_3 + \beta_4I_4)$. I specify $beta = (\beta_0, ... \beta_4)$ for argument pars, but I couldn't find documentation that the propensity score is exactly the form that I was expecting.

rje42 commented 3 months ago

This can be checked easily enough by fitting a GLM with the logistic regression. What you've done sounds correct to me. What do you suggest?

linyingyang commented 3 months ago

I checked by fitting a GLM with logistic regression, and it worked just like I expected.

I think the documentation could be clearer. Maybe we could add a section (or simply just a table) that lists all the families and shows example parameter specifications, including where each parameter goes (like which position we should put coefficients or constants). It would make it easier for users to find the right info quickly?