Background: Attention deficit hyperactivity disorder (ADHD) is one of the most common childhood mental health disorders. Stimulant drugs as the most commonly used treatment and first-line therapy for ADHD have side effects. One of the newest approaches to select the best choices and optimize dosages of medications is personalized medicine.Methods: This historical cohort study was carried out on the data taken from the period of 2008 to 2015. Eligible subjects were included in the study randomly. We used mixed-effects logistic regression models to personalize the dosage of Methylphenidate (MPH) in ADHD. The patients' heterogeneity was considered using subject-specific random effects, which are treated as the realizations of a stochastic process. To recommend a personalized dosage for a new patient, a two-step procedure was proposed. In the first step, we obtained estimates for population parameters. In the second step, the dosage of the drug for a new patient was updated at each follow-up. Results: Of the 221 children enrolled in the study, 169 (76.5%) were male and 52 (23.5%) were females. The overall mean age at the beginning of the study is 82.5 (± 26.5) months. In multivariable mixed logit model, three variables (severity of ADHD, time duration receiving MPH, and dosage of MPH) had a significant relationship with improvement. Based on this model the personalized dosage of MPH was obtained. Conclusions: To determine the dosage of MPH for a new patient, the more the severity of baseline is, the more of an initial dose is required. To recommend the dose in the next times, first, the estimation of random coefficient should be updated. The optimum dose increased when the severity of ADHD increased. Also, the results show that the optimum dose of MPH as one proceeds through the period of treatment will decreased.