Consider a classical data analysis problem where you have an outcome $Y_{i}$ and how it is related to a number of predictors $X_{i1}, ..., X_{ip}$. The basic type of application in mind here is that
$Y_{i}$ is some group-level outcome such as the crime rate in city $i$.
The predictors are group level characteristics such as demographic features of city $i$.
The basic goal is to fit a regression model (perhaps with random effects but forget that for now):
$$ E(Y_{i} | {\bf X}_{i} ) = \beta_0 + \beta_1 X_{i1} + ... + \beta_p X_{ip} $$
Does some technical difficulty arise when one (or more) of the predictors are the result of a survey that has different sample sizes for each unit? For example, suppose $X_{i1}$ is a summary score for city $i$ that is the average response from a sample of individuals from city $i$ but the sample sizes these averages were based on are wildly different:
\begin{array}{c|c} {\rm City} & {\rm Sample \ size} \\ \hline 1 & 20 \\ 2 & 100 \\ 3 & 300 \\ 4 & 5 \\ 5 & 3 \\ \vdots & \vdots \\ \end{array}
Since the predictor variables do not all have the same meaning, in some sense, for each city, I'm afraid that conditioning on these variables in a regression model as though they are all "created equal" could cause some misleading inferences.
Is there a name for this type of problem? If so, is there research on how to handle this?
My thought is to treat it as a predictor variable measured with error and do something along these lines but there is heteroskedasticity in the measurement errors, so that would be very complicated. I could be thinking of this the wrong way or may be making this more complicated than it is but any discussion here would be helpful.