Pivot table using grpstats
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
Let us I want to calculate the sum and mean of wealth for men and women.
I set Type ={men, women} and have created a pivot table using
summarytable = grpstats(dsa,'Type',{'sum','mean'})
Now I want to have sum and mean for everyone in the sample (without grouping for men and women). Please advise the next step.
댓글 수: 0
답변 (1개)
Prasanth Sunkara
2018년 1월 23일
편집: Prasanth Sunkara
2018년 1월 23일
Hi, I understand that you want to compute the stats without using any grouping variable. It could be done as follows:
>>summarytable = grpstats(dsa, [],{'sum','mean'})
>>openExample('stats/SummaryStatisticsforaDatasetArrayWithoutGroupingExample')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!