# Capture z-score from the following distribution x
x = c(6, 7, 7, 12, 13, 13, 15, 16, 19, 22)
z_scores = zscore(x, round = 2) # limit to 2 decimal place
z_scores = zscore(x) # no decimal place limit
df = data.frame(val = x, zscore = z_scores)
head(df)
#EXAMPLE for zscore based on CDC growth chart
# Calculate the zscore for a patient weighing 50kg
Li=-0.1600954
Mi=9.476500305
Si=0.11218624
Xi=50
zscoreGrowthCurve(Xi,Mi,Si,Li)
Run the code above in your browser using DataLab