Today, I was looking at the National Census data in my country. In my country, we have something very similar to "States" (Divisions) and "ZIP Codes" (Subdivisions).

During the Census, data is collected from each Subdivision and - for example, based on a 20% random sample in each Subdivision, information is collected such income, employment rate, age, etc. However, when this data is published, we can only see the average and median value for each of these variables within each Subdivision. We also know the number of people within each Subdivision. The data would look something like this:

  Division Subdivision Average_Income Median_Income Average_Age Median_Age Subdivision_Population
1        A           1       51265.41      48585.45          52         42                  10698
2        A           2       51067.56      49606.41          46         62                   9781
3        A           3       48662.40      49297.64          34         37                  10217
4        B           1       50097.79      49819.19          53         40                  10257
5        B           2       50855.28      49005.76          70         53                   9912
6        C           1       51002.73      49697.60          67         50                  10225
7        C           2       48742.88      50573.90          49         52                   9871
8        C           3       50831.21      50410.04          38         40                   9945
9        C           4       50649.13      46939.21          71         63                  11214

I was interested in learning about if Regression Models can still be applied in such a context (i.e. when individual subject-level data is not provided and only the aggregate level data is provided). As an example, study the impact of income on age.

Initially, I had thought that perhaps I could just "get away with" using a standard Linear Regression Model as if I had access to the individual subject-level data. However, when reading more about this topic, I learned of a new topic called "Ecological Statistics" (the name was a bit misleading - I thought "Ecological Statistics" was about Statistics applied in the Environment). I found some interesting references which show why a standard Linear Regression Model can NOT be used in such a context:

In general, I was interested in learning more about what types of Statistical and Regression Models can be used for problems such as mine. For example, in the problem I described, I do NOT have access to the Standard Errors - is it still possible to create a Regression Model for this problem and generate meaningful estimates for the beta-coefficients? Or could I still fit a regression model to the entire data and find the mean effect of income on age?


Note : I just realized - with this approach, it is likely impossible to create a random-effects nodel because we only have one observation per group!

  • $\begingroup$ You might be interested to read about ecological fallacy as well. $\endgroup$
    – dipetkov
    Commented Jan 12, 2023 at 9:42
  • $\begingroup$ It might also be worth asking yourself: If I did have data about age and income at the household level, would I be able to say something meaningful about "what is the effect of Age on Income"? $\endgroup$
    – dipetkov
    Commented Jan 12, 2023 at 10:01
  • $\begingroup$ You might also be interested in the atomistic fallacy. $\endgroup$
    – Alexis
    Commented Jan 14, 2023 at 7:20
  • $\begingroup$ Technically, we can create (a regression) model for any tabular data or data frame within mean rates better on the data sequences. Apart from Note, I found some workaround over Census Data Analysis, which could make sense for your question and reach meaningful outputs. $\endgroup$
    – Mario
    Commented Jan 14, 2023 at 10:52
  • $\begingroup$ "if Regression Models can still be applied ... as an example, study the impact of income on age." You can always apply a regression model, but the interpretation of the model may differ. Regression models are not the same as causal models and your data sample is not the same as a direct relationship. What do you mean with 'the impact'? $\endgroup$ Commented Jan 20, 2023 at 11:32

1 Answer 1


Yes, it is possible to do regression on your data. Your question is quite broad, do I will try to answer it in bullet points:

  • It's a pity that st. errors for your data are not known, but for the sake of your analysis you may as well consider them negligible and ignore any possible variability in the accuracy of the data.
  • It's very important that you are aware of the shortcomings of doing regression on aggregated data. @dipetkov rightly cited ecological fallacies, the most infamous of which is Simpson's paradox, you should study them very carefully. Take for instance the association between age and income that you were talking about: it's known to everyone that these are indeed associated, and that older workers are in average better payed, however, you may conduct a regression on your data and find an opposite correlation, this is totally possible and may be explained by the fact that wealthier districts have a bigger share of young immigrants, or other factors. It's also possible that younger populations are associated to higher age-adjusted per-capita income, but because you don't have atomic data and older workers do take higher salaries, you aren't able to see that. So you must be extra careful about your conclusions and also warn your readers from getting wrong ideas from your analysis.
  • The purpose of spacial models that you seem to be looking into, is to get away with not including into your model factors that are shared between closer disricts. In other words, using models that consider spacially correlated residuals may un-bias your results. Of course you got to have spatial data to feed models like the ones you linked (in R).
  • You can create a random effect model grouping your data in divisions. In fact, in analogy as the last bullet point, this seems like a good idea.
  • The models you can use on your data depend on the data you have. If you have spacial data you can create a spacial model, if you have graphical data (representing infrastructure, for instance), you can use the graph to model the correlation of your residuals, if you just what you have showed us, you can do a random effects model and not much more.
  • $\begingroup$ Citing the ecological fallacy without also citing the atomistic fallacy is irresponsible. $\endgroup$
    – Alexis
    Commented Jan 14, 2023 at 16:59
  • 1
    $\begingroup$ Interesting points (+1), esp. the second one which is about confounding. You already mention some possible confounders; here are other relevant covariates that occur to me: cost of living, industries [what kind of jobs are available], race, education, work experience. A person's age is also is confounded with the time they were born in, which is related to the economic crises & opportunities that people encounter in life; this seems important too. So without adjusting for covariates, it will be challenging to interpret the association of age with income in a meaningful way. $\endgroup$
    – dipetkov
    Commented Jan 15, 2023 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.