How to deal with this grpstat error message
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
0 commentaires
Réponse acceptée
the cyclist
le 15 Mai 2022
I think you want to use "mean" instead of "average" for the summary statistic.
1 commentaire
Plus de réponses (1)
Image Analyst
le 15 Mai 2022
You need to have braces around the average and sum, not brackets
{"average", "sum"}
4 commentaires
the cyclist
le 15 Mai 2022
Modifié(e) : the cyclist
le 15 Mai 2022
It's easy to get muddled, because if you specify the input arguments as character arrays rather than strings, then you do need to use curly braces. (Notice the single quotes rather than the double quotes around the arguments.)
load patients
tbl = table(Gender,Age,Weight,Smoker);
tblstats = grpstats(tbl,{'Gender','Smoker'},{'mean','sum'},'DataVars','Weight')
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!