Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected counts #170

Open
catalamarti opened this issue Sep 23, 2024 · 4 comments
Open

Unexpected counts #170

catalamarti opened this issue Sep 23, 2024 · 4 comments

Comments

@catalamarti
Copy link
Collaborator

library(OmopSketch)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

cdm <- mockOmopSketch()
#> Note: method with signature 'DBIConnection#Id' chosen for function 'dbExistsTable',
#>  target signature 'duckdb_connection#Id'.
#>  "duckdb_connection#ANY" would also be valid

result <- cdm |>
  summariseConceptCounts(
    conceptId = list(
      "Renal agenesis" = 194152,
      "Manic mood" = c(4226696, 4304866, 37110496, 40371897)
    )
  )
#> ℹ Getting use of codes from Renal agenesis
#> Getting use of codes ■■■■■■■■■■■■■■■■                  50% | ETA:  1s
#> ℹ Getting use of codes from Manic mood
#> Getting use of codes ■■■■■■■■■■■■■■■■                  50% | ETA:  1sGetting use of codes ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  100% | ETA:  0s

result |>
  filter(estimate_name == "person_count") |>
  plotConceptCounts(facet = "codelist_name", colour = "codelist_name")
#> ! Multiple values of `variable_level` and `person_count` detected, consider
#>   including them in either: `x`, `facet`, and `colour`.

Created on 2024-09-23 with reprex v2.1.1

Is there any explanation why Manic mood counts are higher than overall? That's an unexpected result for me...
@KimLopezGuell @martaalcalde

@catalamarti
Copy link
Collaborator Author

found... there are two concepts with the same name... How we want to deal with this?

@KimLopezGuell
Copy link
Collaborator

I would not add them together, it's very confusing... Can we keep them separate (potentially change names to name_1 or similar) and throw a warning?

@catalamarti
Copy link
Collaborator Author

to do so we would have to include concept_id (variable_level) in the naming

@KimLopezGuell
Copy link
Collaborator

Can we do that only if needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants