Suppose I have the following database where I have, for each age, the average years of experience and income of the group and the number of individuals observed for such age (but not the income/experience of each individual):
----------------------------------------------------------------------------
| Average income | Age | Average years of experience | number of individuals
----------------------------------------------------------------------------
| 105.40 | 18 | 2.1 | 23
----------------------------------------------------------------------------
| 205.50 | 19 | 3.4 | 12
----------------------------------------------------------------------------
| 465.40 | 20 | 4.5 | 33
----------------------------------------------------------------------------
| 678.40 | 21 | 5.1 | 57
----------------------------------------------------------------------------
| 815.40 | 22 | 6.6 | 11
----------------------------------------------------------------------------
| 902.56 | 23 | 6.7 | 20
----------------------------------------------------------------------------
| 997.13 | 24 | 7.3 | 13
I want to get a regression [not necessarily a linear one] of the form:
$(Avg\_income) = \beta_0 + \beta_1 * (age) + \beta_2 * (Avg\_years\_xp)$
or
$(Income) = \beta_0 + \beta_1 * (age) + \beta_2 * (Years\_xp)$
The first approach I thought of was ignoring the "number of individuals" column and doing the regression as if I had only 7 observations, but this seems to be a waste of information, right?
The second was replicating each row by "number of individuals", but is this approach really correct? Also, I'd like to have this work in a more generalized way such that I can work a non-integer "number of individuals" (ok, doesn't make any sense in this example, but it does in my real problem).
Obs.: I'm planning doing a Bayesian inference, but Frequentist approaches are welcomed too. R syntax is good too.