How to create a new parameter in one table based on multiple observations in a second table?
Show older comments
Hi everyone,
I have two tables:
- Basic patient info, incluing a numericar identifier, in which each patient has one row.
- Daily patient data, in which each patient (with the same ID) has multiple rows, each one for each day of observation. Coloum 1 is the ID, 2 is the date and 3 and on are events as true/false.
I am trying to create a new parameter in table 1 that will ask if the patient had an event (for example any of the rows of patient 1 on column 3 = true), and a second parameter that will have the earliest date in which that event happened.
I tryed different approached including splitapply and for loop, but cannot get the correct input.
Would really appreciate the help!
Thanks.
2 Comments
Athrey Ranjith Krishnanunni
on 6 Jan 2021
Could you explain more about what you mean by "creating a parameter" in a table, in the context of "asking if any of the rows of patient 1 on column 3 = true"?
Do you mean a function that accepts the patient ID and column number of event as input, and returns the date as the output?
Ofer Sadan
on 7 Jan 2021
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!