How to deal with this grpstat error message
1 回表示 (過去 30 日間)
古いコメントを表示
0 件のコメント
採用された回答
the cyclist
2022 年 5 月 15 日
I think you want to use "mean" instead of "average" for the summary statistic.
その他の回答 (1 件)
Image Analyst
2022 年 5 月 15 日
You need to have braces around the average and sum, not brackets
{"average", "sum"}
4 件のコメント
the cyclist
2022 年 5 月 15 日
編集済み: the cyclist
2022 年 5 月 15 日
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')
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!