Over the last decades, analysis of longitudinal data has been in the center of attention in a widespread research fields such as economy, medicine and social sciences. In this regard, mixed effects models aim to control the between- and within-subjects variability among observations by introducing random effects in the structure of regression models. In longitudinal studies, there is a possibility that some subjects show unusual behavior which makes them distinguishable from the other subjects. Detecting such subjects and introducing flexible models to analyze these types of data sets are important issues. To this aim, in this thesis, by the use of the semi-parametric approach of Dirichlet processes, besides proposing a flexible modeling structure, the clustering issue of subjects with longitudinal observations is also fulfilled. Specifically, subjects with unusual behavior can be detected by clustering longitudinal data. Indeed, a Dirichlet process introduces an unknown distribution G over the space of all possible distribution functions. A Dirichlet process has two parameters, a base distribution, G 0 , stating our guess about the true non-parametric shape of G , and a precision parameter, M , reflecting our belief about how similar G is to G 0 . Discreteness nature of the Dirichlet process enables us to cluster subjects in groups with some shared features. However, the Dirichlet process has the restriction of being almost surely discrete which makes it inapplicable in situations where continuous distributions are needed. Thus, the Dirichlet process mixture model is introduced to relax this restriction by adding a hierarchy level to the model. In Chapter 3, as an application of Dirichlet processes in modeling and clustering longitudinal data, the problem of analyzing longitudinal count data with missing values is considered. In such data sets, serial correlation and overdispersion make the analysis of longitudinal data more complicated. To handle these issues, auto-regressive time-varying random effects are considered in the structure of generalized linear models. Also, by modeling missingness mechanism, all the observations are used to analyze the underlying data. Moreover, to make the model capable to cluster subjects, the Dirichlet process is used as a prior for the random effects distribution. As another application of the semi-parametric approach of the Dirichlet process in fitting models to longitudinal data, the joint analysis of longitudinal and survival data is considered. In this regard, it is assumed that dependence between longitudinal data and time to event data could be due to the effects of same subjects. Thus, a shared-parameter model is used. Furthermore, to having a flexible modeling structure together with being able to cluster subjects, the semi-parametric approach of the Dirichlet process is used to analyze a real data example.