# Patient-level vs. Event-level tables

**URL:** <https://datashield.discourse.group/t/patient-level-vs-event-level-tables/1017>\
**Category:** Beginner Support\
**Created:** [30 May 2024 13:45 UTC](https://datashield.discourse.group/t/patient-level-vs-event-level-tables/1017 "2024-05-30T13:45:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [30 May 2024 13:45 UTC](https://datashield.discourse.group/t/patient-level-vs-event-level-tables/1017/1 "2024-05-30T13:45:06Z")

</div>

In most use cases DataSHIELD tables are meant to be patient-level, i.e. each row represents one individual. And it is very important for this rule to be respected to ensure not violating the data disclosure mechanisms. dsBase functions will fire an error if there are ever multiple rows with the same (patient) id.

What I am curious to learn about is how packages like [dsSurvival](https://neelsoumya.github.io/dsSurvivalbookdown/index.html) work? If I understand correctly, the functions in this package expect event-level tables, i.e. each row represents an event and the same individual can appear multiple times. Is this just custom behaviour because dsSurvival is a community package?

Am I missing something here?

---

<div class="post-metadata">

**Author:** ![demetris.avraam](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@demetris.avraam](https://datashield.discourse.group/u/demetris.avraam)\
**Post date:** [31 May 2024 08:02 UTC](https://datashield.discourse.group/t/patient-level-vs-event-level-tables/1017/2 "2024-05-31T08:02:12Z")

</div>

Hi Ahmet,

The existing functions in dsSurvival do study-level meta analysis. So for example a cox regression is applied in each study separately and study-specific estimates are then combined with meta-analysis methods. In that case the event-level tables are not send to the client. Also data anonymisation is applied for the survival curves. You can have a look on these papers:

> **[dsSurvival: Privacy preserving survival models for federated individual...](https://bmcresnotes.biomedcentral.com/articles/10.1186/s13104-022-06085-1)**
>
> Objective Achieving sufficient statistical power in a survival analysis usually requires large amounts of data from different sites. Sensitivity of individual-level data, ethical and practical considerations regarding data sharing across institutions...

> **[dsSurvival 2.0: privacy enhancing survival curves for survival models in the...](https://bmcresnotes.biomedcentral.com/articles/10.1186/s13104-023-06372-5)**
>
> Objective Survival models are used extensively in biomedical sciences, where they allow the investigation of the effect of exposures on health outcomes. It is desirable to use diverse data sets in survival analyses, because this offers increased...

I am now working on the development of a pooled version of the cox regression (not released yet) where in that case event-level tables should be sent from each study to the client in order to be combined across all studies. In this case, i plan to use the same disclosure checks that we have in ds.table function, i.e. the number of unique time intervals is less than a pre-specified threshold (this can be either specified as a proportion of the individual-level data from each study or by a fixed value) and also that each time interval has more events than a pre-specified threshold.

About the community packages you are right that some of them might not take into account main disclosure controls. This is one of the reasons that the Governance Theme has produced a draft of the process needed for packages audit: [DataSHIELD package audit process | DataSHIELD Community Wiki](https://wiki.datashield.org/en/governance/audit-process). This will be discussed and finalised in the DataSHIELD conference this year so any feedback is welcome!
