简体   繁体   中英

Error during rm ANOVA (Matlab) with random factor

I am trying to run a repeated measures ANOVA in Matlab with 4 factors including one factor representing my subjects which I want as a random factor. The code I have is as follows:

[p,table,stats] = anovan(COORDS_SUBJ_II,{group_hand,group_stim,group_time,group_subs},'random',4,'varnames',{'HAND','STIM','TIME','SUBS'});

Here, all variables have the same dimension, which is 1350x1(all types are 'double'). I checked my code with some proposed code on the net and it matches, yet I keep getting the following error...

Error using chi2inv (line 3)
P and V must be of common size or scalars
Error in anovan>varcompest (line 838)
   L = msTerm .* dfTerm ./ chi2inv(1-alpha/2,dfTerm);
Error in anovan>getRandomInfo (line 811)
[varest,varci] = varcompest(ems,randomterms,msTerm,dfTerm,alpha);
Error in anovan (line 296)
                getRandomInfo(msterm,dfterm,mse,dfe,emsMat,randomterm,...

My dependent variable ( COORDS_SUBJ_II ) has a couple of NaN's in it, although I ran the code once where I replaced those NaN's with random numbers and it still gives me the same error. I am kind of lost right now and would appreciate any help.

Best

ty

Found it out. A toolbox I downloaded a while ago also had the chi2inv command and this prompted the error =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM