Bonjour,
Voila mon code mais le problème c'est lorsque la classe ne contient pas de fréquence, sas supprime la ligne et je me retrouve avec des classes désorganisé. Je voudrai que sas applique mes opérations même au valeurs nulles sans qu'il supprime ma classe. même avec une proc tabulate en debut de code à la place de la proc freq dans la prochaine étape data sas me supprime les classes ou il y a zéro obs.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106 DATA result; LENGTH classe_age_patient $ 20; SET recueil; label classe_age_patient = "Classe d'age du patient"; IF age < 15 THEN classe_age_patient = "0 à 14 ans"; ELSE IF age < 20 THEN classe_age_patient = "15 à 19 ans"; ELSE IF age < 25 THEN classe_age_patient = "20 à 24 ans"; ELSE IF age < 30 THEN classe_age_patient = "25 à 29 ans"; ELSE IF age < 35 THEN classe_age_patient = "30 à 34 ans"; ELSE IF age < 40 THEN classe_age_patient = "35 à 39 ans"; ELSE IF age < 45 THEN classe_age_patient = "40 à 44 ans"; ELSE IF age < 50 THEN classe_age_patient = "45 à 49 ans"; ELSE IF age < 55 THEN classe_age_patient = "50 à 54 ans"; ELSE IF age < 60 THEN classe_age_patient = "55 à 59 ans"; ELSE IF age < 65 THEN classe_age_patient = "60 à 64 ans"; ELSE IF age < 70 THEN classe_age_patient = "65 à 69 ans"; ELSE IF age < 75 THEN classe_age_patient = "70 à 74 ans"; ELSE IF age < 80 THEN classe_age_patient = "75 à 79 ans"; ELSE IF age < 85 THEN classe_age_patient = "80 à 84 ans"; ELSE if age => 80 then classe_age_patient = "85 ans et plus"; run; proc freq data=result; tables classe_age_patient / out=freq_classe; run; proc freq data=result; tables classe_age_patient*cancer / missing out=table; where SEXE="F"; run; data in_brute_f; set table; label classe_age_patient = "Classe d'age du patient"; if classe_age_patient="0 à 14 ans" then incidence_brute=COUNT/101525*100000; if classe_age_patient="15 à 19 ans" then incidence_brute=COUNT/34745*100000; if classe_age_patient="20 à 24 ans" then incidence_brute=COUNT/29034*100000; if classe_age_patient="25 à 29 ans" then incidence_brute=COUNT/28720*100000; if classe_age_patient="30 à 34 ans" then incidence_brute=COUNT/29680*100000; if classe_age_patient="35 à 39 ans" then incidence_brute=COUNT/32321*100000; if classe_age_patient="40 à 44 ans" then incidence_brute=COUNT/34616*100000; if classe_age_patient="45 à 49 ans" then incidence_brute=COUNT/30243*100000; if classe_age_patient="50 à 54 ans" then incidence_brute=COUNT/24925*100000; if classe_age_patient="55 à 59 ans" then incidence_brute=COUNT/20343*100000; if classe_age_patient="60 à 64 ans" then incidence_brute=COUNT/15143*100000; if classe_age_patient="65 à 69 ans" then incidence_brute=COUNT/12209*100000; if classe_age_patient="70 à 74 ans" then incidence_brute=COUNT/10156*100000; if classe_age_patient="75 à 79 ans" then incidence_brute=COUNT/7338*100000; if classe_age_patient="80 à 84 ans" then incidence_brute=COUNT/4980*100000; if classe_age_patient="85 ans et plus" then incidence_brute=COUNT/4624*100000; run; data stand_france_f; set in_brute_f; label classe_age_patient = "Classe d'age du patient"; if classe_age_patient="0 à 14 ans" then stand_fr=incidence_brute*(5583166/32219000); if classe_age_patient="15 à 19 ans" then stand_fr=incidence_brute*(1899875/32219000); if classe_age_patient="20 à 24 ans" then stand_fr=incidence_brute*(1929271/32219000); if classe_age_patient="25 à 29 ans" then stand_fr=incidence_brute*(1958535/32219000); if classe_age_patient="30 à 34 ans" then stand_fr=incidence_brute*(1968413/32219000); if classe_age_patient="35 à 39 ans" then stand_fr=incidence_brute*(2187713/32219000); if classe_age_patient="40 à 44 ans" then stand_fr=incidence_brute*(2216675/32219000); if classe_age_patient="45 à 49 ans" then stand_fr=incidence_brute*(2201885/32219000); if classe_age_patient="50 à 54 ans" then stand_fr=incidence_brute*(2139872/32219000); if classe_age_patient="55 à 59 ans" then stand_fr=incidence_brute*(2123814/32219000); if classe_age_patient="60 à 64 ans" then stand_fr=incidence_brute*(1837745/32219000); if classe_age_patient="65 à 69 ans" then stand_fr=incidence_brute*(1340981/32219000); if classe_age_patient="70 à 74 ans" then stand_fr=incidence_brute*(1348966/32219000); if classe_age_patient="75 à 79 ans" then stand_fr=incidence_brute*(1318217/32219000); if classe_age_patient="80 à 84 ans" then stand_fr=incidence_brute*(1099627/32219000); if classe_age_patient="85 ans et plus" then stand_fr=incidence_brute*(1064245/32219000); run; data stand_mond_f; set in_brute_f; label classe_age_patient = "Classe d'age du patient"; if classe_age_patient="0 à 14 ans" then stand_mond=incidence_brute*(31000/100000); if classe_age_patient="15 à 19 ans" then stand_mond=incidence_brute*(9000/100000); if classe_age_patient="20 à 24 ans" then stand_mond=incidence_brute*(8000/100000); if classe_age_patient="25 à 29 ans" then stand_mond=incidence_brute*(8000/100000); if classe_age_patient="30 à 34 ans" then stand_mond=incidence_brute*(6000/100000); if classe_age_patient="35 à 39 ans" then stand_mond=incidence_brute*(6000/100000); if classe_age_patient="40 à 44 ans" then stand_mond=incidence_brute*(6000/100000); if classe_age_patient="45 à 49 ans" then stand_mond=incidence_brute*(6000/100000); if classe_age_patient="50 à 54 ans" then stand_mond=incidence_brute*(5000/100000); if classe_age_patient="55 à 59 ans" then stand_mond=incidence_brute*(4000/100000); if classe_age_patient="60 à 64 ans" then stand_mond=incidence_brute*(4000/100000); if classe_age_patient="65 à 69 ans" then stand_mond=incidence_brute*(3000/100000); if classe_age_patient="70 à 74 ans" then stand_mond=incidence_brute*(2000/100000); if classe_age_patient="75 à 79 ans" then stand_mond=incidence_brute*(1000/100000); if classe_age_patient="80 à 84 ans" then stand_mond=incidence_brute*(500/100000); if classe_age_patient="85 ans et plus" then stand_mond=incidence_brute*(500/100000); run; proc sort data=stand_france_f; by incidence_brute; run; proc sort data=stand_mond_f; by incidence_brute; run; data incidence_femme; merge stand_france_f stand_mond_f; by incidence_brute; run;
Cordialement
Partager