# Sensitivity Analysis of Regression Models using Stata

Let us see how we can conduct sensitivity analysis using Stata for regression models and coefficients from different types of regression models and also for various approaches to statistical analysis. **Enroll for a private and instructor led course to learn more about Econometrics using Stata.**

### What is sensitivity analysis?

Sensitivity Analysis is a tool used in regression modeling to analyze how the different values of a set of independent variables affect a specific dependent variable under certain specific conditions. We can see that if the regression model is estimated from a given data, then we change the values of the independent variables from lowest to highest in different ranges and look into the values of the coefficients, we can determine how sensitive is the value of coefficientIn general, Sensitivity Analysis is used in a wide range of fields, ranging from biology and geography to economics and engineering.

It is especially useful in the study and analysis of a “Black Box Processes” where the output is an opaque function of several inputs. An opaque function or process is one which for some reason can’t be studied and analyzed. For example, climate models in geography are usually very complex. As a result, the exact relationship between the inputs and outputs are not well understood. (Full article on CFI)

### Stata Commands for Sensitivity Analysis using Stata

Sensitivity Analysis using Stata can be conducted on various dimensions for various situations and analysis. This first code in Stata - senspec- provides sensitivity for quantitative classification variables.

'SENSPEC': module to compute sensitivity and specificity results saved in generated variables / senspec inputs a reference variable with two values and / a quantitative classification variable. It creates, as / output, a set of new variables, containing, in each / observation, the numbers

The second method for sensitivity analysis using Stata is for multiple imputation. The code for this objective in Stata is called -mimix-.

'MIMIX': module to perform reference based multiple imputation for sensitivity analysis of longitudinal clinical trials with protocol deviation / mimix imputes missing numerical outcomes for a longitudinal / trial with protocol deviation under distinct reference group / (typically

'MBSENS': module to compute Sensitivity metric for matched sample using McNemar's test / mbsens is used for calculating the binary sensitivity metric / (gamma) using McNemar's statistic using the matched sample as the / input. / KW: sensitivity / KW: matched samples / KW: Rosenbaum / KW:

'ISA': module to perform Imbens' (2003) sensitivity analysis / isa produces a figure for the sensitivity analysis developed by / Imbens (American Economic Review, 2003). Observational studies / cannot control for the bias due to the omission of unobservables. / The sensitivity

'GSA': module to perform generalized sensitivity analysis / gsa produces a figure for the sensitivity analysis similar to / Imbens (American Economic Review, 2003). Observational studies / cannot control for the bias due to the omission of unobservables. / The sensitivity analysis provides a

'EPISENS': module for basic sensitivity analysis of epidemiological results / episens provides basic sensitivity analysis of the observed / relative risks adjusting for unmeasured confounding and / misclassification of the exposure. episensi is the / immediate form of

'EPISENSRRI': module for basic sensitivity analysis for unmeasured confounders / episensrri provides basic sensitivity analysis of the apparent or / observed relative risks according to specified plausible / values of the prevalence of the unmeasured confounding / among exposed and

The above commands can be found in Stata by running the code:

findit sensitivity

I hope this simple Stata tutorial will be useful in learning more about Sensitivity Analysis.