필터 지우기
필터 지우기

how to restrict sample for data analysis?

조회 수: 1 (최근 30일)
mathxaz
mathxaz 2019년 1월 23일
댓글: mathxaz 2019년 1월 23일
Hello everyone!
I have to following problem: I use a .mat file for my data analysis and only want to include observations of males. I have a dummy variable that codes observation of males by 0, but I cannot find a solution to restrict my sample to males only.
My data set contains approximately 20 variables for each observation (=person).
I hope this information is sufficient.
Thanks for your help!

채택된 답변

Walter Roberson
Walter Roberson 2019년 1월 23일
mask = YourData(:, index_of_dummy_variable) == 0;
MaleData = YourData(mask, :);
The above assumes that the dummy variable is coded as a column of the data and that index_of_dummy_variable is the column number it is in.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by