필터 지우기
필터 지우기

Using strcat within the fitrm function

조회 수: 1 (최근 30일)
Luis Eduardo Cofré Lizama
Luis Eduardo Cofré Lizama 2018년 9월 3일
댓글: Walter Roberson 2018년 9월 4일
Hi All. Just wondering why I cannot use strcat function to create the second inout for the fitrm function.
CoV = {'Patient','Gender','Dg'};
CoV2B = 3;
Var2BanalysedA = {'Perc_Aff_t0'}; % Assessment at time 1
Var2BanalysedB = {'Perc_Aff_t1'}; % Assessment at time 2
Var2BanalysedC = {'Perc_Aff_t2'}; % Assessment at time 3
t = [Table_RMA(:,CoV2B),Table_RMA(:,Var2Banalysed), Table_RMA(:,Var2Banalysed+30),Table_RMA(:,Var2Banalysed+60)];
model = strcat(VN(Var2BanalysedA),'-',VN(Var2BanalysedC),'~',CoV(CoV2B));
M = dataset([1 2 3]','VarNames',{'Measurements'});
rm = fitrm(t,'Perc_Aff_t0-Perc_Aff_t2~Dg','WithinDesign',M);
I want to replace 'Perc_Aff_t0-Perc_Aff_t2~Dg' with 'model', Is that possible?
  댓글 수: 4
Luis Eduardo Cofré Lizama
Luis Eduardo Cofré Lizama 2018년 9월 3일
Same error if I use
rm = fitrm(t,strcat(VN(Var2BanalysedA),'-',VN(Var2BanalysedC),'~',CoV(CoV2B)),'WithinDesign',M);
Walter Roberson
Walter Roberson 2018년 9월 4일
What is your function VN?

댓글을 달려면 로그인하십시오.

답변 (1개)

Luis Eduardo Cofré Lizama
Luis Eduardo Cofré Lizama 2018년 9월 3일
Hi All, found the solution :). Perhaps the prob was my ignorance in using strings. rm = fitrm(t,modek{1},'WithinDesign',M); cheers
Eduardo

카테고리

Help CenterFile Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by