How to determine number of patients in the category
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to determine how many patients fall into each BMI class and each blood pressure class. Like how many patients are "Normal", how many are "Overweight", etc. and how many have normal bp or high bp, etc. Here is the table I have formulated. It is named data_table. I am stuck on how to count the patients.
0 commentaires
Réponses (2)
Voss
le 17 Mar 2025
data_table = table([1;2;3;4;5;6],[24;26;25;28;27;26],["Underweight";"Optimal";"Obese";"Obese";"Obese";"Optimal"],["Low";"Normal";"Normal";"Pre Hypertension";"Stage 1 Hypertension";"Normal"],'VariableNames',{'ID','Age','BMI Class','Blood Pressure Class'})
result = groupcounts(data_table,{'BMI Class','Blood Pressure Class'})
Reference:
These may also be useful:
0 commentaires
Star Strider
le 17 Mar 2025
Try something like this —
imshow(imread('Screenshot 202....55.14 PM.png'))
BMIC = ["Underweight","Optimal","Obese"];
T = table(Size =[10,1], VariableTypes={'string'}, VariableNames={'BMI Class'});
T.('BMI Class') = BMIC(randi(3,10,1)).'
[Cu,~,idx] = unique(T.('BMI Class'))
Tally = accumarray(idx, ones(size(idx)))
Result = table(Cu,Tally)
.
0 commentaires
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
