Disclosed is a method for preparing a compound of formula I, or a pharmaceutically acceptable salt thereof, comprising the steps of: (a) providing a compound of formula II (such as those obtained from plant extracts of black cohosh), and (b) converting the compound of formula II to the compound of formula I by an intramolecular dehydration reaction in the presence of a suitable acid (such as a carboxylic acid, a sulfonic acid, or a phosphoric acid) and wherein the substituents are as defined herein.