[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: test for unimodality

From   "Nick Cox" <>
To   <>
Subject   st: RE: test for unimodality
Date   Thu, 20 Mar 2008 13:47:45 -0000

I assume an interest in continuous variables here. 

If such Stata programs exist, 

. findit mode


. findit modality 


. findit unimodal

should find them. However, in practice "mode" as search text catches too
(think about it) and the others miss stuff with some relevance. 

Searches aside, I don't think anyone has implemented the dip test you
refer to in Stata.
As it comes from a bimodal husband-wife collaboration, the name perhaps
should be
Hartigan-Hartigan dip test, but that does not seem to have caught on.
Some of my less 
statistical colleagues would sniff out the hegemony of patriarchy there,
although which 
Hartigan is being overlooked is not clear. 

-hsmode- from SSC and -shorth- from SSC are in neighbouring territory.
Kit Baum 
recently and kindly drew my attention to this work on "shorth plots"

It is my intention to write a Stata program for those. 


1. If you suspect that data might not be unimodal because of a mix of
different and known groups, 
then testing for that directly is possible using various comparisons of
location parameters 
across groups. 

2. As many people have argued, the absence of unimodality should make
itself evident by 
showing up consistently in kernel density estimates obtained with rather
different bandwidths. 
Simply, if I see two modes again and again and there is a story to
support, I don't miss not 
having a P-value from some test. 

That may not be much help if you are desperate for a P-value. 


Fabian Slonimczyk

I need to test whether the distribution of my data is unimodal. I
found a test (Hartigan's dip test) on line but it has been programmed
for R or matlab only. Do you know whether this or other tests have
been developed for STATA? Thanks

*   For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index