# Linear regression on aggregate and missing data

I have data from a survey with $m$ quantitative questions (rating 0 to 100). There was $n$ participants. I want to apply linear regression to predict $X_m$ based on $X_1,\dots,X_{m-1}$.

There are, however, two problems:

• Some participants did not answer some questions.
• I have only aggregated data. Each aggregation is the average rating per a group of size $n_i$ where $n=\sum n_i$.

Thus, my data are like this:

• $n_{1,i}\dots n_{m,i}$ where $n_{j,i}\leq n_i$ is the number of respondents who did answer the $j$th question within the $i$th group.

• $\bar X_{1,i}\dots\bar X_{m,i}$ for each $i$ are the average ratings per group. Note that some of them are not defined (NaN) because the corresponding $n_{i,j}$ may be zero (no answers to that question).