data MaTab;
input Sexe $ age $ a $ b $ c $ ;
datalines;
F [2-10] fort1 fort2 fort1
H [10-20] fort2 fort1 fort3
F [2-10] fort1 fort1 fort1
F [30-40] fort3 fort1 fort2
H [10-20] fort2 fort1 fort1
H [30-40] fort2 fort3 fort2
H [30-40] fort1 fort3 fort1
F [2-10] fort3 fort3 fort3
;
run;
/*I would like to have a table like:*/
data want;
input Variable $ Mod $ a $ b $ c $ ;
datalines;
Sexe F somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
Sexe H somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
age [2-10] somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
age [10-20] somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
age [30-40] somme(fort1,fort2,fort3) somme(fort1,fort2,fort3) somme(fort1,fort2,fort3)
;
run;
Hi,
Note that in the final "Want" table, the sum of the strong is the percentage sum of the crossing sex and a, sex and b, sex and c. I actually get the percentage to create this table. Same approach with age.
Can someone suggest an approach or a program allowing me to have this table (want).
Thanks for your help.
Best regards, Gick.
... View more