finding mean scores of students tests compared to rest of class
3 次查看(过去 30 天)
显示 更早的评论
Hello, I am working on this problem. To give you some context, there is an 150x10 array of test scores ranging from 1-10. sNum is the student number.
Assign to the variable curveBusters an S-by-1 array (S may be 0) of the student numbers whose average score (across all tests) was strictly higher than average score of the student indicated by sNum.
Here is my code
curveBusters = find(mean(Grades(sNum,:)) < mean(Grades(:,:)));
There was a previous problem
Assign to the variable betteredBy an S-by-1 array (S may be 0) of the student numbers that got a strictly higher score than the student indicated by sNum on the test indicated by testNum.
and this was my code that is correct
betteredBy = find((Grades(sNum,testNum) < (Grades(:,testNum))));
So I can't figure out what is wrong with my code for the means.
0 个评论
采纳的回答
Image Analyst
2014-6-18
I think you need to read that more carefully than you did. This is what I get. Speak up if you don't understand why I did any of the operations:
Grades = randi(10, [150, 10]) % Sample data.
% Row = student number
% Columns = grades for the student in that row.
% Assign to the variable curveBusters an S-by-1 array (S may be 0)
% of the student numbers whose average score (across all tests) was
% strictly higher than average score of the student indicated by sNum.
studentAverages = mean(Grades, 2)
studentMins = min(Grades, [], 2)
allScoresHigherThanMean = studentMins > studentAverages;
curveBusters = find(allScoresHigherThanMean)
% Assign to the variable betteredBy an S-by-1 array (S may be 0)
% of the student numbers that got a strictly higher score than
% the student indicated by sNum on the test indicated by testNum.
% Note: that is unclear since score does not refer to what score --
% it could be the mean of student 6 or all scores of student 6.
sNum = 6;
allScoresHigherThanSNum = studentMins > studentAverages(sNum);
betteredBy = find(allScoresHigherThanSNum);
更多回答(1 个)
Joseph Cheng
2014-6-18
well in your curve busters equation you have the find() function looking for the students that are performing less than (<) the mean of the grades. They wouldn't be curve busting right? Those would be curve helpers.
5 个评论
Joseph Cheng
2014-6-18
I got confuses with the line sNum is the student number so i was thinking sNum was 1:150 not a specific student. if sNum was 1:150 which would then be which students score better than average as they would be curve busters.
is the sNum specified in the question someone in the middle of the curve?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hypothesis Tests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!