Need help with generating a line graph using means

I'm new to Stata and using Stata's plotting function. I am in a fast hurry to generate a line graph as shown below.

I have 6 time vars (numkidsintime1 ... numkidsintime6) and a var for agecategory (to be used as the by var). I need to generate:

-- mean, sd, min max of each numkidsintimeX variable (--by agecategory--)
-- and then produce a line graph, showing mean numkidsintimeX, at each value of X (agecategory) using one line for each age category.

Here's a rough example (for one agecategory line):

| --------------ETC. <---one line for each agecategory
| -----------/
1 ... 2 ... 3 ... 4 ... 5 ... 6

Any help with this would be appreciated.


Use -collapse- or -statsby- to generate a dataset containing the summary statistics for each combination of the variables of interest. eg:
gen n=_n
reshape long numkidsintime, i(n) j(time)
statsby, by(time agecategory) clear: summarize numkidsintime