NEW FEATURES StataNow™ – May 2025

(StataNow) Power analysis for logistic regression. New command power logistic calculates power, sample size, and effect size for tests of one covariate in a logistic regression model. Logistic regression is used to examine the effect of continuous or discrete covariates on a binary outcome. When you are designing an experiment that will be analyzed using logistic regression and you are interested in testing whether a particular covariate of interest affects the outcome, look no further than power logistic. Up to 20 nuisance covariates, which are predictor variables included in the logistic regression model but whose coefficients are not tested, are allowed, as is correlation between the covariate of interest and nuisance covariates. Multiple values of parameters may be specified to perform a sensitivity analysis, with the result presented as a table or a graph.

 

Eleven covariate distributions are supported, with special syntaxes to facilitate use with one or two binary predictors. Suppose your outcome Y is binary and you have two binary covariates: covariate of interest X and nuisance covariate Z. To calculate the sample size needed to attain 80% power with type I error of 5%, type

 

. power logistic 1.5, px(0.3) pz(0.2) py(0.6) pycondx1z1(0.8)

 

To graph the power curve for a normally distributed covariate of interest and two nuisance covariates following uniform and binomial distributions, type

 

. power logistic, x(distribution(normal 0 1) oratio(1.5)) z1(distribution(uniform 1 8) oratio(1.2)) z2(distribution(binomial 8 0.3) oratio(1.4)) pycondxmzm(0.4) n(150(25)300) graph

 

© Copyright 1996–2026 StataCorp LLC. All rights reserved.