Hello,

I am looking to generate a counterfactual polynomial fit for some data. Essentially, I have finishing times of a race and need to generate a counterfactual for certain times.

Let me give an example. I have frequencies of race finishers between 30mins and 90mins. I want to generate a polynomial between 50mins and 70mins and compare this to the actual frequencies by looking at the excess mass around the 60min mark. I am using this to see if there is unusual behaviour and results around this area. In the methodology of a paper I'm reading they do this but I don't know how to apply this in Stata... Can anyone help me?

Best,
Cal