Dynamic treatment regimens (DTRs) are sequential decision rules tailored at each stage by time-varying subject-specific features and intermediate outcomes observed in previous stages. This package implements three methods: O-learning (Zhao et. al. 2012,2014), Q-learning (Murphy et. al. 2007; Zhao et.al. 2009) and P-learning (Liu et. al. 2014, 2015) to estimate the optimal DTRs.