Question 1:

I am using two fertlity variables- age at first intercourse (var name: age1stsex) and age at first birth (var name: age1stbirth).

I need to drop observations if a woman reported having a child at a certain age, but not having their first sexual intercourse at that age or before. Can you help me how to drop those observations by matching the records?

Question 2:

I have another vaiable - total number of child births (var name: ch_birth).

I want to generate the total fertility (i.e total number of child births) by a given age [This will be my main dependent variable. I want to run my regressions using this variable created for different age. So I basically will have several dependent variable.]. Along with that I would like to restrict the sample to only include observations older than the age specified while calculating the variable. What is the easiest way to code this?