*! version 1.1.9 15dec2022

Title

confound -- Modelling confounding in Linear, Logistic and Cox Regression

Syntax

Syntax for Linear or Logistic regression

confound depvar exposition indepvars [if] [in] [weight], linear | logistic [options]

Syntax for Cox regression

confound exposition indepvars [if] [in], cox [options]

linear Linear regression; see regress

logistic Logistic regression; see logit

cox Cox regression; see stcox. You must stset your data before using cox; see [ST] stset

change(real) percentage of change that is considered important; by default change(10)

minimum use minimum model as reference

values(values_list) list of values for continuous interactions; by default values(p5 p50 p95)

Literal values or percentiles p1 p5 p10 p25 p50 p75 p90 p96 p99 may be used

level(#) confidence level (%); by default level(95)

fixed(varlist) fixed variables

using(filename) filename to store the results dataset; by default a dataset named
confound_results is saved in the current (working) directory

noreplace if filename exists, do not replace; by default existing datasets are replaced

nst(string) name of the study (label)

pweight is allowed for linear and logistic regression; see weight.

You may use stset to weight your data before using cox; see [ST] stset.

Description

This command helps the assessment of confounding for Linear, Logistic and Cox regression according with
the rules proposed by Kleinbaum, Kupper, Nizam & Muller (2008, pp. 198-202).

For logistic regression, the Hosmer-Lemeshow goodness-of-fit test (variable pfitHL) is computed using 10 quantiles to group
data: estat gof, group(10).

The results are stored in a new dataset named by default confound_results and saved in the current (working)
directory. Existing datasets are replaced by default.

You can click here to pop up a dialog or type db confound.

Execute net from http://metodo.uab.cat/stata for install.

It is important to keep the commands updated. Execute adoupdate confound, update to update the confound command.

Execute confound, update to update all the user-written commands.

This command uses the regress, logit, logistic estat gof, stcox and _rmcoll Stata commands.

If you find any bugs or want to suggest any improvements, please send an e-mail to: leam@uab.cat.

Examples

The zip file available for download on http://metodo.uab.cat/stata/Ejemplo_confound.zip contains a pdf file with an
example of use of the confound command (in spanish). The zip file also contains example data. If
the direct download fails, copy the download link (http://metodo.uab.cat/stata/Ejemplo_confound.zip) and paste in the
address bar of your web browser.

Linear regression

. use http://metodo.uab.cat/stata/Datatest_confound_MR.dta

. confound y x1 z1 z2 z3 i.z4, linear

. confound y i.x2 z1 z3, linear

. confound y x1 z1 z2 z3 c.x1#c.z2, linear values(p5 p50 p95 60 75) using(results_lr_cont.dta)

. confound y x1 z2 z3 i.z4r c.x1#i.z4r, linear

Logistic regression

. use http://metodo.uab.cat/stata/Datatest_confound_LR.dta

. confound y x1 z1 z2 z3 c.x1#c.z3, logistic values(p5 p50 p95 90 104)

Cox regression

. use http://metodo.uab.cat/stata/Datatest_confound_Cox.dta

. stset tr, failure(estado==1)

. confound x1 z1 z2 z3 i.z4 c.x1#c.z2, cox

Version

Version 1.1.9 -- 15 December 2022

Authors

JM.Doménech & JB.Navarro

Programmer: R.Sesma

Laboratori d'Estadística Aplicada

Universitat Autònoma de Barcelona

leam@uab.cat

Vancouver reference

Doménech JM, Navarro JB. Find the best subset for Linear, Logistic and Cox Regression:

User-written command confound for Stata [computer program].

V1.1.9. Bellaterra: Universitat Autònoma de Barcelona; 2022.

Available executing from Stata: net from http://metodo.uab.cat/stata

References

Doménech JM, Navarro JB. Regresión múltiple con predictores categóricos y cuantitativos. 7ª ed. Barcelona: Signo; 2014.

Doménech JM, Navarro JB. Regresión logística binaria, multinomial, de Poisson y binomial negativa. 7ª ed. Barcelona: Signo; 2014.

Doménech JM, Navarro JB. Análisis de la supervivencia y modelo de riesgos proporcionales de Cox. 7ª ed. Barcelona: Signo; 2014.

Kleinbaum DG, Kupper LL, Morgenstern H. Epidemiologic research.
Principles and quantitative methods. New York: Van Nostrand Reinhold Company; 1983.

Kleinbaum DG, Kupper LL, Nizam A, Muller K. Applied Regression Analysis and
other Multivariable Methods. (4ª ed.). Belmont (CA): Thomson Learning, Inc; 2008.

Maldonado G, Greenland S. Simulation study of confounder-selection strategies. Am J Epidemiol. 1993;138:923-36.