Categorical covariates in parameter estimation
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Abed Alnaif
am 3 Nov. 2023
Kommentiert: Abed Alnaif
am 24 Nov. 2023
Hello,
Do the SimBIology parameter estimation functions support categorical covariates?
Thank you,
Abed
2 Kommentare
Joe Myint
am 4 Nov. 2023
Bearbeitet: Joe Myint
am 4 Nov. 2023
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
Akzeptierte Antwort
Arthur Goldsipe
am 6 Nov. 2023
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 Kommentare
Jeremy Huard
am 23 Nov. 2023
Bearbeitet: Jeremy Huard
am 23 Nov. 2023
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550577/image.png)
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")
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]
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
During fitting, we can now use a covariate model such as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550582/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550587/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550592/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550597/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550602/image.png)
I hope this helps.
Best regards,
Jérémy
Weitere Antworten (1)
Sulaymon Eshkabilov
am 3 Nov. 2023
Yes, it should work. See this doc: https://www.mathworks.com/help/simbio/ref/groupeddata.createdoses.html
0 Kommentare
Communitys
Weitere Antworten in SimBiology Community
Siehe auch
Kategorien
Mehr zu Import Data finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!