0

I have a dataset with repeated measures at certain timepoints. Overall, a decreasing trend is seen in the measurements, but I am interested in the cases who do not decline or even have increasing values. I tried several filters/subsets, but don't know how to filter out these cases. Could anyone help?

Thank you!

Name of dataframe : epds Name of value I am interested in : epds_score Name of visits at which the measurements were done : visitnum.x

I hoped I would filter them out using either:

subset(epds, epds_score[epds$visitnum.x=='1.0'] =< epds_score[epds$visitnum.x >'1.0'])

or

filter(epds, !epds_score[visitnum.x=='1.0]' %<% epds_score[visitnum.x > '1.0'])

probably, I am doing something wrong and would really appreciate your help.

  • 3
    It's much easier for others to help you if you include a reproducible example. Can you share a sample of data using `dput()`? – nrennie Jun 08 '23 at 09:09
  • 1
    Welcome to SO, wendy van der wekken! Questions on SO (especially in R) do much better if they are reproducible and self-contained. By that I mean including attempted code (please be explicit about non-base packages), sample representative data (perhaps via `dput(head(x))` or building data programmatically (e.g., `data.frame(...)`), possibly stochastically), perhaps actual output (with verbatim errors/warnings) versus intended output. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Jun 08 '23 at 13:15

0 Answers0