Univariate table
unitab depvar [varlist1] [if exp] [in range]] [, level(#) format(%fmt) categorical(varlist2) exact]
Description
unitab displays a univariate table with the maximum-likelihood estimates of odds ratio and confidence intervals using logit command and some useful information using tabulate command.
depvar binary dependent variable that must be coded as depvar = 0 or depvar = # with # > 0
varlist1 covariates treated as continuous. varlist2 covariates treated as categorical.
You can specify the same variable as continuous and/or categorical. First results are displayed for continuous variables and then for categorical variables.
Explanation of the table
Continuous variable
1 column : summarize depvar if continuous_variable == #
2 column : total observations
3 column : point estimate of odds ratio using maximum likelihood estimators logit
4-5 columns : lower and upper bound for odds ratio at a certain level(#)
6 column : statistical significance of the odds ratio using a Wald test
Categorical variable
1 column : tabulate depvar categorical_variable (display only for depvar = # )
2 column : total observations for each category
3 column : point estimate of odds ratio using maximum likelihood estimators
4-5 columns : lower and upper bound for odds ratio at a certain level(#)
6 column : statistical significance of the Pearson's chi-squared test for the hypothesis that the rows and columns in a two-way table are independent
Options
level(#) specifies the confidence level, in percent, for calculation of con > fidence intervals of the odds ratios; see help level format(%fmt) specifies the display format for odds ratio and confidence int > ervals in the univariate table. format(%4.3f) is the default; format(%6.5f) is a popular al > ternative. categorical(varlist2) specifies the variables that you want treat as catego > rical. exact displays the significance calculated by Fisher's exact. We recommend specifying exact whenever samples are small.
Examples
. webuse lbw, clear . tab low . su age . su age if low == 1 . logistic low age . unitab low age . xtile ageq = age, nq(4) . tab ageq low, row nokey chi2 . tab ageq low, row nokey exact . xi: logistic low i.ageq . unitab low, c(ageq) . unitab low, c(ageq) exact . unitab low age, c(ageq) . tab race low, row nokey . xi:logistic low i.race . unitab low , c(race) . unitab low age ht ui, c(race smoke ageq) . unitab low age ht ui, c(race smoke ageq) l(90) f(%6.5f) Authors
Nicola Orsini, Institute of Environmental Medicine, Karolinska Institutet, Stockholm, Sweden and Institute of Information Science and Technology, National Research Council of Italy, Pisa, Italy.
Matteo Bottai, Arnold School of Public Health, University of South Carolina, Columbia, USA and Institute of Information Science and Technology, National Research Council of Italy, Pisa, Italy.
Support
Nicola Orsini, http://nicolaorsini.altervista.org, Karolinska Institutet, Sweden nicola.orsini@imm.ki.se
Also see
[R] logistic [R] tabulate
On-line: help for logit, logistic, table, tabulate, tabstat, tabodds, epitab