Skip to content
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

outputting z scores and flags in original dataframe #32

Closed
pgupta919 opened this issue Jun 18, 2020 · 2 comments
Closed

outputting z scores and flags in original dataframe #32

pgupta919 opened this issue Jun 18, 2020 · 2 comments

Comments

@pgupta919
Copy link

Hi Dirk,

I am a doctoral student at Emory University using the anthro R package you developed- THANK YOU! It’s amazing and so much shorter than the SAS macro!

I was wondering however, the anthro package differs from the SAS macro as it exports the z scores and flags to a dataframe separate from the input dataset. I was wondering how the output values can be merged back in to the original file? I am not sure what the unique identifier is between the original dataframe and the dataframe with the z scores. Any help you could provide on this would be greatly appreciated!

I look forward to hearing from you and thanks again for this package!

@dirkschumacher
Copy link
Collaborator

The results of anthro_zscores are returned in the same order as your input them. So you could use the function cbind to bind the results to you original dataset. Hope this helps.

E.g.

your_data_set <- read.csv("my_survey.csv")
scores <- with(
  your_data_set,
  anthro_zscores(
    sex = sex, age = age_in_days,
    weight = weight, lenhei = lenhei
  )
)
cbind(your_data_set, scores)

@pgupta919
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants