필터 지우기
필터 지우기

Categorical covariates in parameter estimation

조회 수: 5 (최근 30일)
Abed Alnaif
Abed Alnaif 2023년 11월 3일
댓글: Abed Alnaif 2023년 11월 24일
Hello,
Do the SimBIology parameter estimation functions support categorical covariates?
Thank you,
Abed
  댓글 수: 2
Joe Myint
Joe Myint 2023년 11월 4일
편집: Joe Myint 2023년 11월 4일
Hello Abed,
Take a look at this example and see if it is what you are looking for. This example shows how to estimate category-specific (such as young versus old, male versus female) parameters using PK profile data from multiple individuals.
Hope it helps, Joe
Abed Alnaif
Abed Alnaif 2023년 11월 9일
Thank you, Joe! I wasn't aware of this feature, and I think it will work for me. I'm going to try it.

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

채택된 답변

Arthur Goldsipe
Arthur Goldsipe 2023년 11월 6일
Do you want to do nonlinear regression or nonlinear mixed effects (NLME)? The feature Joe mentions in his comment only applies to nonlinear regression. If you want to use categorical covariates with sbiofitmixed (for NLME), then there's no direct support for categorical covariates. I have an idea for a workaround, but I'd need to think about it a little more. If you are interested in the workaround, please let me know and I can investigate it a bit further. It would also be helpful to know more about your covariate model. How many categories are in your categorical covariate? What does your covariate model look like?
  댓글 수: 3
Jeremy Huard
Jeremy Huard 2023년 11월 23일
편집: Jeremy Huard 2023년 11월 23일
I would recommend to convert categorical covariates into dummy variables or one-hot vectors, where each category is converted into a new binary column.
However, I would only use categories and all zeros would encode for the last category.
Please note that I will be using a dataset shipped with MATLAB that does not contain time courses. But the categorical variable it contains will help illlustrate the general idea.
load patients
T = table(Age,Height,Weight,Smoker,...
SelfAssessedHealthStatus,Location,...
'RowNames',LastName);
T = convertvars(T,@iscellstr,"string")
T = 100×6 table
Age Height Weight Smoker SelfAssessedHealthStatus Location ___ ______ ______ ______ ________________________ ___________________________ Smith 38 71 176 true "Excellent" "County General Hospital" Johnson 43 69 163 false "Fair" "VA Hospital" Williams 38 64 131 false "Good" "St. Mary's Medical Center" Jones 40 67 133 false "Fair" "VA Hospital" Brown 49 64 119 false "Good" "County General Hospital" Davis 46 68 142 false "Good" "St. Mary's Medical Center" Miller 33 64 142 true "Good" "VA Hospital" Wilson 40 68 180 false "Good" "VA Hospital" Moore 28 68 183 false "Excellent" "St. Mary's Medical Center" Taylor 31 66 132 false "Excellent" "County General Hospital" Anderson 45 68 128 false "Excellent" "County General Hospital" Thomas 42 66 137 false "Poor" "St. Mary's Medical Center" Jackson 25 71 174 false "Poor" "VA Hospital" White 39 72 202 true "Excellent" "VA Hospital" Harris 36 65 129 false "Good" "St. Mary's Medical Center" Martin 48 71 181 true "Good" "VA Hospital"
In the table above, the variable SelfAssessedHealthStatus contains 4 categories: Poor, Fair, Good, Excellent.
You can generate dummy variables for it with:
Tstatus = convertvars(T(:,"SelfAssessedHealthStatus"), "SelfAssessedHealthStatus","categorical");
Tstatus = onehotencode(Tstatus);
T = [Tstatus, T]
T = 100×10 table
Excellent Fair Good Poor Age Height Weight Smoker SelfAssessedHealthStatus Location _________ ____ ____ ____ ___ ______ ______ ______ ________________________ ___________________________ Smith 1 0 0 0 38 71 176 true "Excellent" "County General Hospital" Johnson 0 1 0 0 43 69 163 false "Fair" "VA Hospital" Williams 0 0 1 0 38 64 131 false "Good" "St. Mary's Medical Center" Jones 0 1 0 0 40 67 133 false "Fair" "VA Hospital" Brown 0 0 1 0 49 64 119 false "Good" "County General Hospital" Davis 0 0 1 0 46 68 142 false "Good" "St. Mary's Medical Center" Miller 0 0 1 0 33 64 142 true "Good" "VA Hospital" Wilson 0 0 1 0 40 68 180 false "Good" "VA Hospital" Moore 1 0 0 0 28 68 183 false "Excellent" "St. Mary's Medical Center" Taylor 1 0 0 0 31 66 132 false "Excellent" "County General Hospital" Anderson 1 0 0 0 45 68 128 false "Excellent" "County General Hospital" Thomas 0 0 0 1 42 66 137 false "Poor" "St. Mary's Medical Center" Jackson 0 0 0 1 25 71 174 false "Poor" "VA Hospital" White 1 0 0 0 39 72 202 true "Excellent" "VA Hospital" Harris 0 0 1 0 36 65 129 false "Good" "St. Mary's Medical Center" Martin 0 0 1 0 48 71 181 true "Good" "VA Hospital"
Now, we can use Poor as the reference group, meaning that when all other groups are 0, then the category is Poor:
T.Poor(:) = 0
T = 100×10 table
Excellent Fair Good Poor Age Height Weight Smoker SelfAssessedHealthStatus Location _________ ____ ____ ____ ___ ______ ______ ______ ________________________ ___________________________ Smith 1 0 0 0 38 71 176 true "Excellent" "County General Hospital" Johnson 0 1 0 0 43 69 163 false "Fair" "VA Hospital" Williams 0 0 1 0 38 64 131 false "Good" "St. Mary's Medical Center" Jones 0 1 0 0 40 67 133 false "Fair" "VA Hospital" Brown 0 0 1 0 49 64 119 false "Good" "County General Hospital" Davis 0 0 1 0 46 68 142 false "Good" "St. Mary's Medical Center" Miller 0 0 1 0 33 64 142 true "Good" "VA Hospital" Wilson 0 0 1 0 40 68 180 false "Good" "VA Hospital" Moore 1 0 0 0 28 68 183 false "Excellent" "St. Mary's Medical Center" Taylor 1 0 0 0 31 66 132 false "Excellent" "County General Hospital" Anderson 1 0 0 0 45 68 128 false "Excellent" "County General Hospital" Thomas 0 0 0 0 42 66 137 false "Poor" "St. Mary's Medical Center" Jackson 0 0 0 0 25 71 174 false "Poor" "VA Hospital" White 1 0 0 0 39 72 202 true "Excellent" "VA Hospital" Harris 0 0 1 0 36 65 129 false "Good" "St. Mary's Medical Center" Martin 0 0 1 0 48 71 181 true "Good" "VA Hospital"
During fitting, we can now use a covariate model such as:
Here, (the population estimate) will correspond to the case where SelfAssessedHealthStatus = Poor, will correspond to SelfAssessedHealthStatus = Fair, will correspond to SelfAssessedHealthStatus = Good, will correspond to SelfAssessedHealthStatus = Excellent.
I hope this helps.
Best regards,
Jérémy
Abed Alnaif
Abed Alnaif 2023년 11월 24일
Thanks, Jeremy. This makes sense to me.

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

추가 답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 11월 3일

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Import Data에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by