Skip to main content

Research Repository

Advanced Search

Outputs (104)

Speaking Stata: Finding the denominator: Minimum sample size from percentages (2023)
Journal Article
Cox, N. J. (2023). Speaking Stata: Finding the denominator: Minimum sample size from percentages. The Stata Journal, 23(4), 1086-1095. https://doi.org/10.1177/1536867x231212453

Percentage breakdowns for a series of classes or categories are sometimes reported without a specification of class frequencies or even the total sample size. This column surveys the problem of estimating the minimum sample size and class frequencies... Read More about Speaking Stata: Finding the denominator: Minimum sample size from percentages.

Speaking Stata: Replacing missing values: The easiest problems (2023)
Journal Article
Cox, N. J. (2023). Speaking Stata: Replacing missing values: The easiest problems. The Stata Journal, 23(3), 884-896. https://doi.org/10.1177/1536867x231196519

Missing values are common in real datasets, and what to do about them is a large and challenging question. This column focuses on the easiest problems in which a researcher is clear, or at least highly confident, about what missing values should be i... Read More about Speaking Stata: Replacing missing values: The easiest problems.

Stata tip 151: Puzzling out some logical operators (2023)
Journal Article
Cox, N. J. (2023). Stata tip 151: Puzzling out some logical operators. The Stata Journal, 23(1), https://doi.org/10.1177/1536867x231162009

The logical operators & (“and”) and | (“or”) can sometimes be tricky in statistical software such as Stata. They are extremely useful, so you need to understand thoroughly how they work. Any trickiness arises mostly in translating from ordinary langu... Read More about Stata tip 151: Puzzling out some logical operators.

Speaking Stata: Automating axis labels: Nice numbers and transformed scales (2022)
Journal Article
Cox, N. J. (2022). Speaking Stata: Automating axis labels: Nice numbers and transformed scales. The Stata Journal, 22(4), 975-995. https://doi.org/10.1177/1536867x221141058

Two common problems with graph axis labels are to decide in advance on some “nice” numbers to use on one or both axes and to show particular labels on some transformed scale. In this column, I discuss the nicelabels and mylabels commands, which addre... Read More about Speaking Stata: Automating axis labels: Nice numbers and transformed scales.

Speaking Stata: The largest five - A tale of tail values (2022)
Journal Article
Cox, N. J. (2022). Speaking Stata: The largest five - A tale of tail values. The Stata Journal, 22(2), 446-459. https://doi.org/10.1177/1536867x221106436

How do you work with the largest five, or smallest five, or any other fixed number of values in a tail of a distribution? In this column, I give examples of problems and code for basic calculations as a prelude to graphics, tables, and more detailed... Read More about Speaking Stata: The largest five - A tale of tail values.

Speaking Stata: Ordering or ranking groups of observations (2021)
Journal Article
Cox, N. J. (2021). Speaking Stata: Ordering or ranking groups of observations. The Stata Journal, 21(3), 818-837. https://doi.org/10.1177/1536867x211045582

Results for categorical variables may often be clearer if those variables are reordered or reranked, say, according to some measure of absolute or relative frequency or according to summaries of some other variable. Some graphical and tabulation comm... Read More about Speaking Stata: Ordering or ranking groups of observations.