Comments (5)
If you are using age as an attribute to a condition this is indeed correct. However, circe allows you to use a demographic attribute as a point of attrition. This is not covered in Capr
v2 and needs to be added.
from capr.
I just found some relevant documentation in at
Capr/vignettes/capr_objects.Rmd
Lines 101 to 106 in fa03ba0
from capr.
@pa-nathaniel thanks for your question. you have indeed found a bug. If you want to observe the attrition based on age you can add the age as a demographic criteria to a group. This is what happens in ATLAS. I need to add a container that holds the demographic criteria to apply it to the group. A group must take in a criteria class. Code would look as such:
library(Capr)
t1dConceptSet <- cs(descendants(195771), name = "T1D")
cd <- cohort(
entry = entry(
t1dConceptSet,
observationWindow = continuousObservation(priorDays = 365L),
primaryCriteriaLimit = "All"
),
attrition = attrition(
'atLeast18' = withAll(
demographic(age(gte(18L))) # function to add
)
)
)
from capr.
Ah interesting, I thought I had solved it yesterday evening by doing something like the code below. Would this not do it?
library(Capr)
t1dConceptSet <- cs(descendants(195771), name = "T1D")
cd <- cohort(
entry = entry(
t1dConceptSet,
observationWindow = continuousObservation(priorDays = 365L),
primaryCriteriaLimit = "All"
),
attrition = attrition(
"At least 18 at entry" = withAll(
atLeast(
1,
conditionOccurrence(
t1dConceptSet,
age(gte(18)), firstOccurrence()
)
)
)
from capr.
Ah great glad I wasn't too far off, thanks!
from capr.
Related Issues (20)
- Executing writeCohort() leads to Error: 'list_flatten' is not an exported object from 'namespace:purrr' HOT 3
- align with circe-be changes HOT 1
- procedure() not working HOT 3
- Add labelling to cohort elements
- What's the right way to get json from Capr code object? HOT 3
- Setting observational start date for cohort HOT 4
- Typos using "-" instead of "-" in some documentation HOT 1
- Is there Capr support for Health Economics Data Tables HOT 4
- Support updates to Circe v1.11.0 HOT 5
- Add ability to generate `CohortGenerator` input tables HOT 4
- Possible bug in Example vignette code for applying inclusion criteria HOT 2
- R6 v S3/S4 in HADES HOT 4
- Released version failing R Check HOT 2
- Tips for using calendar date range requirement in defining entry (or attrition)? HOT 3
- Add Device exposure as an entry option HOT 1
- Are examples for unit() out of date due to a breaking change? HOT 1
- how to retrieve conceptid HOT 1
- How do I specify a date range? HOT 6
- Allow numeric as `offsetDays` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capr.