Researchers have found that those children who have begun potty training at 18 months are generally not fully trained until 4. Whereas those kids who have begun training at 2 years are generally fully trained till 3 years. Many kids may not be fully trained until 4 years.
You can wait for a few more months and then consult a doctor. But there is no real deadline; different kids may take different time. Most kids are potty trained by 5 or 6 years. If it worries you, then consult a paediatrician.