R-square and the F statistic... error
Mostra commenti meno recenti
Hi everyone, I am getting this error for the each line (Warning: R-square and the F statistic are not well-defined unless X has a column of ones.).
I have looked up other similar questions but couldn't use the solutions for my case. Help if you can please. Thanks.
for r=1:size(Sun,1)
[~,~,~,~,STATNm(r,:)]=regress(Sun(r,:)',MHL(r,:)');
[~,~,~,~,STATNc(r,:)]=regress(Sun(r,:)',LComb(r,:)');
[~,~,~,~,STATSm(r,:)]=regress(Ssun(r,:)',Sm(r,:)');
[~,~,~,~,STATSc(r,:)]=regress(Ssun(r,:)',CLS2(r,:)');
[~,~,~,~,STATSml(r,:)]=regress(Nsun(r,:)',Nml(r,:)');
[~,~,~,~,STATSlc(r,:)]=regress(Nsun(r,:)',Nlc(r,:)');
end
Rsq=[STATNm(:,1) STATNc(:,1) STATSm(:,1) STATSc(:,1) STATSml(:,1) STATSlc(:,1)]';
Risposta accettata
Più risposte (1)
Asliddin Komilov
il 4 Mag 2022
Modificato: Asliddin Komilov
il 4 Mag 2022
3 Commenti
Walter Roberson
il 4 Mag 2022
Do you have duplicate entries in rows of one of the matrices?
Asliddin Komilov
il 5 Mag 2022
Walter Roberson
il 5 Mag 2022
I do not think 0 itself is a problem, but I think you could have a problem if you you had duplicate rows. If that can happen then I would suggest using unique() by rows, recording the second output as well, and using that second output to index the rows of the other array, using that along with the first output of unique()
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!