I am working on an database for statistics collection and I have the following problem.

I need to be able do the following:
1. User Decides Data disaggregation factors (such as gender/location/time etc)
2. Then one can store data according to disaggregation factors, so if the factor is gender, data should be entered for males and females (say if we are studying number of patients treated, at the point of data entry one would enter number of male patients and number of female patient. In the case of location disaggregation factor, user would enter any number of locations (could be towns), and data would be entered/stored accordingly. So instead of male and female data as in the first example, data would be stored for all patients, location wise. To complicate matters a bit further, the disaggregation factors can be combined. This means a user can decide a certain piece of data is to be aggregated by both gender and location, and one should be able to store/query the records accordingly (i.e. store male patients from a certain location). The disaggregation factors could be anything a user decides them to me.

Can you advise how to best model this using E-R?