How to determine number of patients in the category
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Voss
am 17 Mär. 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 Kommentare
Star Strider
am 17 Mär. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
