-
Notifications
You must be signed in to change notification settings - Fork 663
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
Reproduction and Contraceptives #186
Conversation
I will followup with an analysis of the new birth rate, average births per mother, contraceptive use rates, and performance changes in the next day or two. |
+1 This is very impressive! And also nice to see where you've taken the initial Pregnancy and Birth models I offered. |
Eagerly awaiting the statistics. Overall looks good. Some thoughts:
|
Another thought: the next logical extension to this is STDs/STIs/whatever they're called now. While this model is fresh in your head, are there any potential minor changes to this model that would make it easier to extend to STDs later? I suspect the sexually_active attribute and contraceptive info is likely enough as-is, just wanted to throw the idea out there. |
Sexually_active by itself is too broad. How about adding a promiscuity_risk to indicate multiple partners? That would greatly increase the STD risks.
… On Apr 17, 2017, at 7:31 AM, dehall ***@***.***> wrote:
Another thought: the next logical extension to this is STDs/STIs/whatever they're called now. While this model is fresh in your head, are there any potential minor changes to this model that would make it easier to extend to STDs later? I suspect the sexually_active attribute is likely enough as-is, just wanted to throw the idea out there.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#186 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIO2lPHhA-408tFuze1RcZJmO9jlRvusks5rw02lgaJpZM4M9bNS>.
|
AnalysisAt present, there is an average birth rate of 5.45 children per mother. This is 3x too high - time to start turning some of the proverbial dials down a little. The things I can see being adjusted are:
I noticed that prescription contraceptives are not being ended. It seems that the I also neglected to set Statistics,
|
I also isolated the logs for 10 random female patients, several in each age bracket: female_1.txt These offer some insight into the number of pregnancies each women had, when she was sexually active, and what contraceptives she was taking (if any). |
@jeffeastman, What may be risk factors that play into promiscuity? Age, race, socioeconomic status? That may have a lot to do with family history too. @dehall, Thinking further down the line, what would we need to do to augment this model with family history? Could we go the next step and have Synthea patient's giving birth to more Synthea children? As-is, we could easily identify who their mothers are. Do we randomly assign a Synthea father to the mix? Also I couldn't find even a generic IUD code in RxNorm. However, I found SNOMED codes for IUDs. Do those count as "devices"? |
Having Synthea patients give birth to other Synthea patients would be challenging. We would have to balance patients that get created out of nowhere with ones that are born. Feel free to keep thinking about that but I don't think that should be a short-term goal. |
I agree with @cjduffett that it would be really neat to have real family lineage in Synthea, but also agree with @dehall that it would lead to many challenges. For instance, if the patients had real relatives, with real Synthea records, then we'd need to take their relatives' conditions (family history) into account for everything we do in Synthea. We'd have to build this awareness into the tool and allow the modules to somehow reference it, and if done right, It would affect many of the distributions. We'd also have to figure out how this all works in serialized generation vs parallel generation. For now, having the ability to completely fictionalize (or ignore) any family history is the simpler path. |
I’ve actually been doing just this in PatientGen. I use the Synthea pregnancy module and use it to trigger new baby creation in the population. These babies have mothers and fathers and also any inherited genetic mutations. Here are some statistics from a recent 100-yr run:
Gen-0 Babies = 19.70% (1154)
Gen-0 Triplets = 0.05% (3)
Gen-0 Twins = 0.67% (39)
Gen-1 Babies = 23.93% (1402)
Gen-1 Triplets = 0.03% (2)
Gen-1 Twins = 0.75% (44)
Gen-2 Babies = 19.82% (1161)
Gen-2 Triplets = 0.02% (1)
Gen-2 Twins = 0.65% (38)
Gen-3 Babies = 2.83% (166)
Gen-3 Twins = 0.07% (4)
Gen-4 Babies = 0.03% (2)
Heterozygous for BRCA1 = 1.02% (60)
Heterozygous for BRCA2 = 0.58% (34)
Heterozygous for CFTR = 1.11% (65)
Heterozygous for DOWN = 3.47% (203)
Heterozygous for HgbS = 0.70% (41)
Homozygous for BRCA1 = 0.02% (1)
Homozygous for BRCA2 = 0.02% (1)
Homozygous for CFTR = 0.05% (3)
Homozygous for HgbS = 0.03% (2)
You can see from the above that the run actually produced two babies with great-great grandparents. Given a way to access patient genealogy and mutations from modules (think Expressions with Functions <grin>) it would be possible to base the likelihood of diseases upon this information. Other than inherited mutations and gender, I don’t have any longitudinal family history consequences yet. Since we are beginning to realize that genetics play a large role in many diseases, adding more “mutations” to the set would allow an individual patient’s disease risks to be based upon family history without having to cross generational boundaries. Just a thought...
In terms of Synthea’s births-from-nowhere vs births-from-pregnancy, my population run using the current pregnancy module to trigger births started with this age distribution of 2000 patients:
Age[0-9] = 257
Age[10-19] = 226
Age[20-29] = 301
Age[30-39] = 235
Age[40-49] = 286
Age[50-59] = 289
Age[60-69] = 210
Age[70-79] = 121
Age[80-89] = 50
Age[90-99] = 25
Age[100-109] = 0
And ended 100 yrs later with this distribution of 3072 patients:
Age[0-9] = 413
Age[10-19] = 389
Age[20-29] = 375
Age[30-39] = 382
Age[40-49] = 377
Age[50-59] = 305
Age[60-69] = 240
Age[70-79] = 228
Age[80-89] = 275
Age[90-99] = 83
Age[100-109] = 5
These growth results look reasonable to me. How do they compare with Synthea’s population growth?
Jeff
… On Apr 18, 2017, at 8:18 AM, Chris Moesel ***@***.***> wrote:
I agree with @cjduffett <https://github.com/cjduffett> that it would be really neat to have real family lineage in Synthea, but also agree with @dehall <https://github.com/dehall> that it would lead to many challenges. For instance, if the patients had real relatives, with real Synthea records, then we'd need to take their relatives' conditions (family history) into account for everything we do in Synthea. We'd have to build this awareness into the tool and allow the modules to somehow reference it, and if done right, It would affect many of the distributions. We'd also have to figure out how this all works in serialized generation vs parallel generation. For now, having the ability to completely fictionalize (or ignore) any family history is the simpler path.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#186 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIO2lLOoxAGKzZlSd-TKGxLGfoR2EfSdks5rxKowgaJpZM4M9bNS>.
|
To effectively model many different contraceptive types and their effectiveness, I needed to rework the pregnancy module and add new modules to model 1) female reproduction, 2) sexual activity, and 3) contraceptive use, 4) MANY contraceptive types. Collectively, these determine how likely a female will become pregnant in a given reproductive cycle.
Added model of natural infertility. Natural infertility increases with age - it becomes harder or impossible to get pregnant as you get older. This reduced the overall birth rate from 5.45 -> 4.49 births/mother.
17b518a
to
87872a7
Compare
Some updates:
0.69, 0.58, 3.24, 1.61, 1.97, 2.13... There are clearly a lot of variables at play here. However, these various runs average out to a birth rate of about 1.7, so close to the desired 2.0. |
@jawalonoski, I incorporated the changes we discussed on Thursday. I removed the condition checking a I ran 3 runs of 1k patients over the weekend, with an average birth rate of 2.6 children/mother. I think that's spot on. |
I just finished incorporating the latest reproductive modules into PatientGen and am seeing a big impact on birth rates. Over a 100 yr simulation, the previous population grew from 2000 to over 3000 lives. With the new contraceptives etc, it now drops to under 1000.
IIRC, Synthea does not use its pregnancies to grow the population the way I do, so the change in the birth rate from the previous pregnancy-only module to the new suite of reproductive modules wouldn't impact its overall population growth.
From this thread, I see there are many knobs to tune to adjust the birth rate with these new modules. I’d like to continue to have #births outnumber #deaths and I wonder if someone could suggest which knobs to twist first?
eJeff
… On Apr 24, 2017, at 10:18 AM, jawalonoski ***@***.***> wrote:
Merged #186 <#186>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#186 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIO2lG8mElSDgaDJ8w87AeJISlZP0NG_ks5rzK8igaJpZM4M9bNS>.
|
If it helps, while I still get babies with great-great grandparents (even more than before), the numbers are lower than what I reported earlier:
Then:
Gen-0 Babies = 19.70% (1154)
Gen-0 Triplets = 0.05% (3)
Gen-0 Twins = 0.67% (39)
Gen-1 Babies = 23.93% (1402)
Gen-1 Triplets = 0.03% (2)
Gen-1 Twins = 0.75% (44)
Gen-2 Babies = 19.82% (1161)
Gen-2 Triplets = 0.02% (1)
Gen-2 Twins = 0.65% (38)
Gen-3 Babies = 2.83% (166)
Gen-3 Twins = 0.07% (4)
Gen-4 Babies = 0.03% (2)
Now:
Gen-0 Babies = 15.70% (518)
Gen-0 Triplets = 0.03% (1)
Gen-0 Twins = 0.55% (18)
Gen-1 Babies = 10.85% (358)
Gen-1 Twins = 0.39% (13)
Gen-2 Babies = 6.85% (226)
Gen-2 Twins = 0.21% (7)
Gen-3 Babies = 3.67% (121)
Gen-3 Twins = 0.06% (2)
Gen-4 Babies = 0.39% (13)
… On Apr 24, 2017, at 3:04 PM, Jeastman ***@***.***> wrote:
I just finished incorporating the latest reproductive modules into PatientGen and am seeing a big impact on birth rates. Over a 100 yr simulation, the previous population grew from 2000 to over 3000 lives. With the new contraceptives etc, it now drops to under 1000.
IIRC, Synthea does not use its pregnancies to grow the population the way I do, so the change in the birth rate from the previous pregnancy-only module to the new suite of reproductive modules wouldn't impact its overall population growth.
From this thread, I see there are many knobs to tune to adjust the birth rate with these new modules. I’d like to continue to have #births outnumber #deaths and I wonder if someone could suggest which knobs to twist first?
eJeff
> On Apr 24, 2017, at 10:18 AM, jawalonoski ***@***.*** ***@***.***>> wrote:
>
> Merged #186 <#186>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <#186 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIO2lG8mElSDgaDJ8w87AeJISlZP0NG_ks5rzK8igaJpZM4M9bNS>.
>
|
@jeffeastman You're saying the population is declining by 50%? Or in other words, the number of deaths exceeds the number of births? |
Yes, its not too apparent at the beginning, but once the population size begins to drop, the trend accelerates. In my run, I saw a larger number of women choose sterilization than I would have expected (728). That by itself could have triggered the population collapse. Female Sterilization: 12 states |
Here's another thought on my high incidences of female sterilization: since I start my populations with a multinomial of ages, none of the older females in my populations will have had any children. Thus they will be exposed to pregnancy issues later in life and might be expected to resort to sterilization as a means of birth control more often than a population of females who experienced pregnancies earlier in life and then would have already had their computed number babies by late adulthood.
Interesting that my Down Syndrome prevalence is also lower now, maybe since more older females elect sterilization?
This all is such a great example of chaos theory isn't it?
eJeff
…Sent from my iPhone
On Apr 24, 2017, at 3:18 PM, jawalonoski ***@***.***> wrote:
@jeffeastman You're saying the population is declining by 50%? Or in other words, the number of deaths exceeds the number of births?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
A Conceptual Overview
Collectively this PR adds 3 new modules, 9 new submodules, and expands 1 existing module to better represent pregnancy, the use of contraceptives, and female sexual activity as a whole. The sheer scale of this endeavor was mainly due to the diverse set of contraceptives available today.
The following 6 prescription contraceptives are now represented here:
3 non-prescription contraceptive methods are also represented:
To make contraceptives, female reproduction, and pregnancy play nicely there is a delicate interplay between several main modules. This is facilitated by the use of 5 key attributes:
sexually_active
(bool
) - Assigned yearly by the "Sexual Activity" module.contraceptive
(MedicationOrder
) - Active, prescription contraceptive medications are assigned to this attribute.contraceptive_type
(string
) - Indicates the current contraceptive type in-use, which directly influences the monthly probability of a sexually active female becoming pregnant.pregnant
(bool
) - When true, triggers a cycle of the pregnancy module and suspends the use of contraceptives.infertile
(bool
) - Sterilization makes you this. Some people are also infertile from birth.To track birth rate, the
number_of_children
attribute is also used to record the total number of live births for each female.A Visual Overview
Assumptions and Shortcomings
Because this is already complex enough.
Diaphragms and emergency contraceptives are not represented here. There was little data on diaphragm use available, and emergency contraceptives are out-of-scope since they're not a preventative measure.
Race, ethnicity, and socioeconomic status are all factors that influence the birth rate and contraceptive use; however, they are not modeled here.
Hormonal contraceptives carry an elevated risk of blood clots and stroke, especially for smokers over the age of 35. I made no changes to the Cardiovascular Disease module at this time.
Sexual activity incidence is only based on a modern study. For now I am (perhaps naively) assuming that human sexual activity has been consistent for the last century. As-is, when birth control methods are historically unavailable more people are having unprotected sex in this model.
All females reach reproductive age at age 14. All women reach menopause at age 50. All women have 28-day reproductive cycles. These are all the average cases. In reality, there are outliers.
Contraceptive Use By Different Age Groups
For simplicity, I binned all contraceptive users into 3 age groups:
14-24 - Teens/20-somethings favor short-term contraceptives like the pill, condoms, or injectables.
25-34 - More of these people are actually trying to make babies. Those that aren't either use long-acting contraceptives (IUD, implant, ring, etc.) or sterilization.
35-50 - Parenting to menopause. This group favors long-acting contraceptives and sterilization. No more babies if they can help it.
New Main Modules
Sexual Activity
The Female Reproductive Cycle
Contraceptive Use
New Submodules
Most of these submodules prescribe a contraceptive medication given the current year of the simulation. 3 contraceptive types require additional, periodic maintenance within an age range: IUDs, implants, and injectables.
Oral Contraceptive
Intrauterine Device
Implanted Contraceptive
Injectable Contraceptive
Patch Contraceptive
Vaginal Ring Contraceptive
Female Sterilization
Male Sterilization
Clear (Reset) Contraceptive
In Summary
Who knew making babies was so hard?