Help with student grades categorization for ANOVA-n
1 view (last 30 days)
Show older comments
Douglas Leaffer
on 28 Jun 2023
Answered: Sulaymon Eshkabilov
on 28 Jun 2023
Hello. I need some help formatting a table (attached) of student grades for an ANOVA-n analysis. I want to perform the ANOVA-n with outcome (y) as PHS_Grades, which are letter categorical currently, based on multiple factors, such as MAT_Grade (also letter categorical), SEX, ETHNICITY, and AGE (which falls into one of 5 ranges: 0-17; 18-21; 22-25; etc.). I have converted SEX and ETHNICITY to binary variables, but not sure how to code the AGE groups, nor the letter grades from PHS_Grade (outcome) nor MAT_Grade (one factor). Thanks for any help
load Grades.mat; % loads a table named PHS131
p = anovan(PHS131.PHS_Grade, {'SEX'}) % an example category factor
% ERROR OUTPUT:
%Check for incorrect argument data type or missing argument in call to
%function 'isnan'.
%Error in anovan>removenans (line 1183)
%nanrow = isnan(y);
%Error in anovan (line 190)
%[y,allgrps,nanrow,varinfo] = removenans(y,group,continuous);
0 Comments
Accepted Answer
Sulaymon Eshkabilov
on 28 Jun 2023
The variable Grade needs to be numerical values - double or single, then it should work. Also, a small syntax correction with the variable names is needed, e.g.:
load Grades.mat; % loads a table named PHS131
Grade = randi([60, 100], numel(PHS131.SEX), 1); % Grade is a numerical data
p1 = anovan(Grade, PHS131.SEX)
p2 = anovan(Grade, {PHS131.SEX, PHS131.PREREQ})
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!