Filter Patient IDs depending on timepoints

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
Philipp.B
Posts: 7
Joined: Fri Sep 24, 2021 9:57 pm

Filter Patient IDs depending on timepoints

Post by Philipp.B »

Hello everyone,

i have a longformat dataset containing a column for ID, one column for time and one for my dependent variable.
I was hoping to filter out every patient who has missing values at any timepoint.

Could someone hint me in the right direction of how to do this?

Cheers
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Filter Patient IDs depending on timepoints

Post by MAgojam »

Hey @Philipp.B,
if your variable name is time and you want to exclude from the analysis all cases that have missing data in time, you can do it in several ways.
The simplest and fastest is to click on the funnel icon (filters) at the bottom left and in Filter 1 insert

Code: Select all

time != NA
in case you want to include them instead

Code: Select all

time == NA
Still in the lower left, by clicking on the eye you can hide the filter column and collapse the excluded cases (rows).

If you are looking for FILTER in the Forum, you will find much more ...

Cheers,
Maurizio
Philipp.B
Posts: 7
Joined: Fri Sep 24, 2021 9:57 pm

Re: Filter Patient IDs depending on timepoints

Post by Philipp.B »

Hey maurizio,

Thank you for the fast reply. I think I was to tired yesterday
to formulate the question correctly.
Variables: pat_id, time, dv
Let's say I have measurements of 900 patients pre, 300 patients during and 100 patients post therapy in a longformat dataset.
I can filter out anyone with missing values in the dv in the way you described. Now I also want to filter the variable pat_id so that only those patients are included that have measurements of the dv on all three timezones.

Cheers and thanks for your time
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Filter Patient IDs depending on timepoints

Post by MAgojam »

Philipp.B wrote:Now I also want to filter the variable pat_id so that only those patients are included that have measurements of the dv on all three timezones.
I understand you could look for this:

Code: Select all

time != NA and dv != NA
Even if a little dated, it can suggest you for the need.
https://blog.jamovi.org/2018/04/25/jamovi-filters.html

Cheers,
Maurizio
Philipp.B
Posts: 7
Joined: Fri Sep 24, 2021 9:57 pm

Re: Filter Patient IDs depending on timepoints

Post by Philipp.B »

Thats a very obvious solution that I absolutely didn't find myself.
Thank you very much!
Post Reply