How to determine number of patients in the category
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Voss
el 17 de Mzo. de 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 comentarios
Star Strider
el 17 de Mzo. de 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 comentarios
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
