-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add national primary care inequalities overview #119
Conversation
@Lextuga007 Would it better for me to add the NHSRtheme to the Qmd? |
@camappel - applying the brand would be a great idea but I think we should use the new |
england.qmd
Outdated
df[is.na(df$quin_4) & is.na(df$quin_5), ] | ||
df %<>% | ||
mutate(quin_5 = ifelse(is.na(quin_5), quin_4, quin_5)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is line 36 filtering by nothing in quin_4 and quin_5 but then lines 37-38 are mutating quin_5 to populate from two columns that are NA. Is that right? I struggle with reading base R and the magrittr pipe %<>% is new to me! I only have ever used %>%!
Edit: Is line 50 not used in the later code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If quin_5 is NA (missing), it assigns the value from quin_4 to quin_5. If quin_5 is not NA, it retains its value.
This shouldn't be necessary for this national level analysis, so I can remove it (or comment it out).
I'm not sure what line 50 refers to (I think the line numbers have changed), but the line was only run once as it applied to all indicators across all ICBs. This is so that if there were no practices in the most deprived quintile in the ICB, there would still be a datapoint representing the most deprived practices in that ICB (not the country)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, you are right about the lines being out of synch - that was local to me! I think it's good to keep the ICB level code in but comment it out and leave a note about that because it's highly likely if anyone wishes to replicate this for their area they will need this logic.
I can add this code back in with the comments to explain. Thanks
england.qmd
Outdated
|
||
Average payment per weighted patient is **£`r round(df_filter[df_filter$Indicator == "payment_per_patient_all", ]$quin_5, 2)`** in the most deprived 20% of practices, versus **£`r round(df_filter[df_filter$Indicator == "payment_per_patient_all", ]$quin_1, 2)`** in the least deprived 20%. | ||
|
||
If there are no dispensing practices in the most deprived quintile, we use the second most deprived. If both are missing, we omit the data point from the figure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this relates to when the data is used for other areas as these charts are for England and so there is data at these quintiles. Could this be amended to advise this is guidance as the code doesn't include this logic? I'm assuming that readers of this may well be new to R and want to follow the same principles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right - removed
england.qmd
Outdated
labs( | ||
x = NULL, y = NULL, | ||
title = paste0("Life expectancy by practice, birth cohort 2016-20 (England)"), | ||
subtitle = "Practices in most and least deprived IMD quintiles. Larger circles represent stronger socio-economic gradient.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there code that relates to changing circle sizes? These all render the at the same size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an old feature that I removed as it wasn't very interpretable - thank you for spotting
…qualities-notebook into camappel-add-qmd-file
Note for fixing - there are font issues which are suppressed with warning: false in global:
Font size is still quite small even with code removed in commit 2fe3385 |
england.qmd
Outdated
|
||
- The work of the Health Equity Evidence Centre is made possible through seed funding from NHS East of England team. | ||
|
||
- The views expressed in this publication are those of the Health Equity Evidence Centre and not necessarily those of NHS England. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been giving this line a bit of thought. NHS-R Community is not part of NHS England and, for this year at least, we aren't funded by NHSE so it might be these sentences are written more as a recognition of the contribution you have made to NHS-R Community:
This work has been provided by the Health Equity Evidence Centre which was made possible through seed funding from NHS East of England team.
Before I accept this PR and with this in mind, are you aware and happy that all the code and text you have submitted is subject to our CC0 and MIT licences for reuse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's much better.
Yes, happy with re-use and licenses etc!
Note for fixing - NHS logo not in repo
|
I've added 20 to the font size for all chart elements:
|
Thanks very much for the code review! I've now submitted the changes BTW I pushed new changes after submitting the review so it thinks there are more changes that need to be reviewed |
@all-contributors please add @camappel for content |
I've put up a pull request to add @camappel! 🎉 |
@all-contributors please add @camappel for code |
I've put up a pull request to add @camappel! 🎉 |
We present the latest NHS primary care data, using Index of Multiple Deprivation (IMD) to examine inequalities existing in primary care access, experience and outcomes, across the following categories: