Public-Health-Scotland / phsmethods

An R package to standardise methods used in Public Health Scotland (https://public-health-scotland.github.io/phsmethods/)
https://public-health-scotland.github.io/phsmethods/
54 stars 13 forks source link

Sex from chi #45

Closed Moohan closed 3 years ago

Moohan commented 4 years ago

Opening as draft pending comments in the issue. Closes #43

davidc92 commented 3 years ago

Hi James

I'm just getting round to looking at this now. Before I do a review I'd just like to understand the scope for this function a bit more because I'm not entirely convinced this is all that useful? The reason being, I don't know of any dataset that has chi on it that does not also have sex. I also have some questions around how accurate this is - how are people who are intersex or their sex is otherwise unknown accounted for here?

D

Moohan commented 3 years ago

As far as its usefulness there are definitely datasets that have CHI but no sex. I guess they fall into 2 categories of either a submitted CHI number or a dataset with CHI seeded to it but which didn't include other variables. Working in the COVID team, the COCIN dataset I used had CHI seeded to it and we needed to extract the sex from the CHI number to fill in where sex wasn't otherwise submitted. I know other examples from COVID where submissions were returned with the patients' CHI number (e.g. Primary Care surveillance) but not other variables. As for unknown / intersex, this can't be accounted for as it's not part of the CHI spec. However, this is a tiny proportion of people so I think is fine for any typical use case.

Moohan commented 3 years ago

Made most of the changes, see comment above.

I updated the readme.rmd and re-knitted, I got the same error again about proxy (#55) ... However, the .md file still updated and looks ok to me (both in markdown and if you look at it on GitHub for this branch). There were also merge conflicts for some reason which I resolved.

I also just added a short bit to the readme for this function, I'm pretty happy that they're in sync now.