Babies born small for gestational age (SGA) or large for gestational age (LGA) have a higher risk of morbidity and mortality. Small is often defined as <= 10th percentile given the baby's sex and gestational age, or <= 3rd percentile given the baby's sex and gestational age. Similarly, LGA is often defined in terms of the 90th.
Finding look-up tables is straightforward enough, but these are not particularly useful for processing millions of records. This trivial package gives a percentile classifications (weight for gestational age and sex) for a single infant (ga_class()) or a dataframe of millions of infants (ga_dataframe()).
The possible percentile classes are: "<= 03", "<= 05", "<= 10", "10-90", ">= 90", ">= 95", ">= 97"
When processing a dataframe, the entire dataframe is returned with an additional column (ga_class)
You can install the package directly from GitHub using the devtools package
install.packages("devtools") # assuming you have not already
devtools::install_github("dreidpath/SGA-LGA")
The classifications are based on US data, using the tables published by Talge et al (2014)
Talge NM, Mudd LM, Sikorskii A, Basso O. United States birth weight reference corrected for implausible gestational age estimates. Pediatrics; 2014 May;133(5):844-53. doi: 10.1542/peds.2013-3285. https://www.ncbi.nlm.nih.gov/pubmed/24777216