10-12-2017 10:55 AM - edited 10-12-2017 10:55 AM
I have a problem that probebly requires matrices. To simplify the problem I'll say I want to divide dataset A by dataset B. Dataset A contains demographic data of a population and has the following structre:
Country Year Age-group Sex population.size
USA 1995 1 male 10,000
USA 1995 2 male 20,000
.. .. .. .. ..
Dataset B contains the number of disease cases by each country, year, age group and sex.
Country Year Age-group Sex Nr.cases
USA 1995 1 male 500
USA 1995 2 male 400
.. .. .. .. ..
and what I would like to calculate is the disease incidence, i.e. the number of case in that population in that year. For age group 1 it will be 500/10000=0.2.
Now this is all simple and can be done by merging the two datasets, but what I have is way bigger, which is what making everything complicated. I have many countries, 6 years, almost 25 age-groups, two sexes, number of cases, deaths and most importantly several diseases. This means I have different population sizes for each country by each year as well.
What I am thinking about is having each table saved a matrix, and then grouping similar matrices as an array. I can run the arthmetic operations then on a number of matrices.
However I have no experince in matrics. I do not know if they exist in SAS, and I'm not sure if this is the best way to do this analysis. What do you think? How would you do it?
thanks in forward
10-14-2017 05:42 AM
Sounds to me like something which could be solved with a rather simple SQL - but I probably misunderstand something.
What would really help: Provide sample data which illustrates the problem (working SAS data step code creating the sample data). Then show us how the desired result should look like.
10-22-2017 07:41 AM - edited 10-22-2017 07:42 AM