One Table from Multiple Univariate Analyses
In epidemiology research, it’s common to report odds ratios or risk-ratios and their p-values from logistic regression or other regression models. The asdocx
package provides two templates, reg1
and reg2
, to facilitate this process.
The reg1
template is designed to build tables with much-needed flexibility. It prepares a standard regression table that typically includes odds ratios or risk-ratios along with their corresponding p-values. The table is structured with one dependent variable and multiple independent variables. The template is free and is installed automatically when you install the asdocx
package.
On the other hand, the reg2
template serves a slightly different purpose. While it also creates a similar table, the key distinction lies in the treatment of variables. In the reg2
template, one independent variable is regressed individually on the multiple dependent variables, meaning the analysis is univariate. Despite this, the reg2
template compiles all the results into a single comprehensive table, providing a clear and concise overview of the univariate analyses conducted across various factors. This makes it a valuable tool for researchers conducting univariate analysis in epidemiology.
Syntax
asdocx reg indepvar depvars, title(text) dec(#) dect(#) template(reg2) reg_options
Syntax Details
The syntax starts with the keywords asdocx
. The word reg
can be any Stata command for regressions such reg
for ols, logistic
for logistic regressions, etc. After the regression command, you should input the treatment variable (independent), followed by a list of dependent variables. So, the syntax may appear counter-intuitive compared to the typical Stata syntax (depvar
followed by indepvars
). However, it aligns with the syntax of the table1
template, which you can refer to on this page.
Option template(reg2) invokes the reg1 template.
title(text)
: Used to specify the table title.
dec(#)
: To set decimal points for odd-ratios or other estimates, except the p-values. If left empty, three decimal points will be reported.
dect(#)
: To set decimal points of the p-values. If this option is not specified, its values is set equal to dec()
.
reg_options
: All other regression options such robust
, etc.
An Example
* Load example dataset
use http://fintechprofessor.com/asdocxAddins/reg2.dta, clear
* Make regression table using the template(reg2) option
asdocx logistic i.Robotic death returnor1 ///
cdarrest1 cdmi1 cnscva1, vce(cl new_ID) label ///
template(reg2) replace btp
In the above example, i.Robotic is the independent
variable, and all other variables are dependent
. After the comma, the template(reg2)
option instructs asdocx to use the reg2
template. vce(cl new_ID) is the logistic regression option. The aforementioned code generates a table that resembles the following structure.
Variable | OR [95% CI] | P-value |
---|---|---|
30 day mortality | 0.314 (0.133, 0.741) | 0.008 |
Returnor | 0.951 (0.613, 1.475) | 0.821 |
Cardiac arrest | 0.249 (0.053, 1.177) | 0.079 |
MI | 0.530 (0.231, 1.213) | 0.133 |
Stroke/CVA | 1.000 (0.249, 4.022) | 1.000 |
Notes: |
Order asdocx
Yearly license of asdocx is available at $9.99. Its life-time license is available at $49.99. With the asdocx membership, you get :
- Life-time license to use
- All future updates
- All premium templates / plugins.