The fix to Richard's problem is probably to exit Stata after installing
the -somersd- package (which includes -cendif-) and then launch Stata
again. The -somersd- package (including -cendif-) should then work.

The reason for this is that the -somersd- package includes a Mata
library -lsomersd.mlib-. In general. Stata looks for Mata routines in a
list of libraries, which can be found by typing, in Stata

mata: mata mlib query

This list is constructed when Stata is launched. In some versions of
Stata (but not others), Stata does not update its list of Mata libraries
to be searched when a new package (such as -somersd-) is installed. This
has the consequence that, if the user then tries to use the -somersd-
package, then Stata looks for the Mata procedure -tidottree()- in its
old list of libraries, and does not find -tidottree()-, and therefore
gives the error message

tidotforsomersd(): 3499 tidottree() not found

that James has received. If James exits Stata and then launches Stata
again, then Stata should re-initialize its list of Mata libraries to be
searched, and this list should then include the Mata library
-lsomersd.mlib-, which contains -tidottree()- and other Mata procedures
used by the -somersd- package.