The specific question can't be answered in the abstract--without representative data and an algebraic notion of the model to be applied.
In general, it helps to think of R as school algebra writ large, f(x) = y, involving three objects -- the function f itself, the argument(s) x and the result(s), y. A problem in R` programming comes down to designing x and y and then finding or writing one or more functions f to make the transformation.
This is facilitated by tidy data in which each observation is a row and each column is an observation. In your case, each row could be an individual or an age cohort and one or more other variables from which the model f is calculated. The data object then yields a table of results for each individual that must be summarized somehow to be stratified by cohort.