フィルターのクリア

Help with student grades categorization for ANOVA-n

1 回表示 (過去 30 日間)
Douglas Leaffer
Douglas Leaffer 2023 年 6 月 28 日
回答済み: Sulaymon Eshkabilov 2023 年 6 月 28 日
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);

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 6 月 28 日
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)
p1 = 0.9555
p2 = anovan(Grade, {PHS131.SEX, PHS131.PREREQ})
p2 = 2×1
0.9443 0.8672

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnalysis of Variance and Covariance についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by