Elf

One Christmas Eve, an orphaned infant boy stows away on Santa Claus' sack. When discovered back at the North Pole, he is adopted by Papa Elf. Papa Elf names his son William, but for short he calls him Buddy.
Buddy grows up at the North Pole believing he is an elf, but due to his human size is unable to perform elf tasks. When Buddy accidentally learns that he is human, Papa Elf explains that he was born to Walter Hobbs and Susan Wells, and was given up for adoption without Walter knowing. Susan died and Walter works at a children's book publisher in New York City. Buddy travels to find him, whom Santa indicates is on the naughty list due to his greed and selfishness.
Buddy has trouble acclimating to the customs of the human world. Buddy finds his father's office, but Walter has him ejected after Buddy mentions Susan Wells. After following a security guard's sarcastic suggestion to go "back to Gimbels" due to his elf outfit, the manager mistakes him for an employee at Santa Land. He meets Jovie, an unenthused employee to whom he is attracted. Knowing that Santa will arrive the next day, Buddy stays behind and spends the night decorating Santa Land.
The next day, Buddy is appalled that the store's Santa is not real. He rips off the man's fake beard, causing them to fight. Buddy is arrested and Walter bails him out of prison. Walter takes him to the family's pediatrician for a DNA test, which confirms that Buddy is Walter's son. The doctor convinces him to take Buddy home to meet his stepmother, Emily, and 12-year-old half-brother, Michael. Walter and Michael are annoyed by Buddy's childlike behaviour, but Emily insists that they take care of him until he "recovers".
Buddy helps Michael defeat a gang of bullies in a snowball fight, and Michael encourages Buddy to ask Jovie out. Walter learns from his boss Fulton Greenway that his company is in financial trouble. Greenway organizes a book pitch for Christmas Eve, which Walter and his associates, Eugene and Morris, arrange a meeting with best-selling children's author Miles Finch to hire him.
On Christmas Eve, Buddy goes on a date with Jovie and wins her over. Buddy bursts into Walter's office to tell him about his love, interrupting a meeting with Finch. Buddy accidentally offends Finch, who has dwarfism, by mistaking him for an elf. Finch loses his temper and attacks Buddy before storming out, causing Walter to disown Buddy.
Eugene and Morris find a notebook Finch left that is filled with ideas for children's books. Walter pitches these ideas to Greenway, but Michael bursts in to tell Walter that Buddy ran away. Greenway refuses to reschedule, so Walter lets Greenway fire him.
Santa's sleigh crashes in Central Park, which attracts a large crowd. Buddy finds him and discovers that the sleigh's engine had broken off, meaning that it cannot fly without Christmas spirit. Walter and Michael find Buddy and apologize, and Buddy then takes them to meet Santa. Michael steals Santa's list and reads it in front of the gathered TV news cameras, while the Central Park Rangers, who never forgave Santa for putting them on the naughty list, chase his sleigh as Buddy tries to reattach the engine.
Jovie leads the gathered people in singing "Santa Claus Is Coming to Town", helping raise enough Christmas spirit to partially power the sleigh. Walter is convinced by Michael to start singing, which restores enough Christmas spirit to allow it to fly.
By next Christmas, Walter has started his own publishing company with the first best-selling book titled Elf, an account of Buddy's adventures. Buddy and Jovie have a daughter named Susie, named after his biological mother. During the film's closure, the family visits Papa Elf at the North Pole.

Question: For what does Walter take Buddy to the family's pediatrician?
Answer: DNA test