Simulations and data analysis code for the paper Estimation of the Number Needed to Treat, the Number Needed to Expose, and the Exposure Impact Number with Instrumental Variables by Valentin Vancak & Arvid Sjölander. The repository consists of five folders: logit model simulations setting I and II - code for the simulations of the double logistic model for setting I and II. Probit model simulations - code for the simulations of the double probit model for settings I and II. Vitamin D - code for the Vitamin D data example. Each logit and probit model folder contains five files and subdirectories: (1) G-estimators functions. (2) Probability & Indices functions. (3) Sandwich formula for the covariance matrix. (4) Main simulation file. (5) Plots generating code, and a subdirectory named datasets contain all the simulation's generated files. The Vitamin D file contains two files with (1) double logit model analysis and (2) double probit model analysis.
Vancak, Valentin and Sjölander, Arvid. "Estimation of the number needed to treat, the number needed to be exposed, and the exposure impact number with instrumental variables" Epidemiologic Methods, vol. 13, no. 1, 2024, pp. 20230034.