필터 지우기
필터 지우기

Anovan random model with unbalanced data set

조회 수: 3 (최근 30일)
Jennifer
Jennifer 2011년 10월 19일
Hello, I'm running a 2-way random model anova with unbalanced data using anovan. I know anovan can deal with unbalanced data, but I'm confused as to how. When I run my code, the empty cells are replaced with '0', but those zeros are used in calculating that group mean. I therefore end up with an incorrect value for that group and wrong statistics. I have tried putting NaN in those empty cells but then none of the data for that subject is used. Thoughts? Thanks, Jen
data_ANOVA = data(:,col_1:col_2);
data_ANOVA = data_ANOVA(:);
% Factor A, Speed
numA = (col_2 - col_1)+1;
speed = repmat(1:numA, r,1);
speed = speed(:);
% Factor B, Subject (random factor)
numB = 10; % number of reps per subjects
subject = [ones(numB,numA); 2*ones(numB,numA); 3*ones(numB,numA); 4*ones(numB,numA); 5*ones(numB,numA); 6*ones(numB,numA); 7*ones(numB,numA); 8*ones(numB,numA); 9*ones(numB,numA); 10*ones(numB,numA); 11*ones(numB,numA); 12*ones(numB,numA); 13*ones(numB,numA); 14*ones(numB,numA); 15*ones(numB,numA); 16*ones(numB,numA); 17*ones(numB,numA)];
subject = subject(:);
[p, table, stats] = anovan(data_ANOVA,{speed subject},'model',2,'random',2,'varnames',{'Speed';'Subject'});

답변 (0개)

카테고리

Help CenterFile Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by