Hi, I`m trying to generate a new variable = different expressions by sex, but only if sex==0 the expression doesn`t work... Why?
gen GFR=.
if sex==0 replace GFR= [(140- ages)* wt]/(cr *72) /// it doesn`t work
if sex==1 replace GFR= [(140- ages)* wt]/(cr *72) * 0.85 //// ok
Thanks in advance
Related Posts with Help with new variable generation
I don't understand why the results show different significance?Hi, Statalisters: I am not so much good in posting on the forum, please excuse me for not adhering t…
tempfileI often execute - in separate instances of Stata - multiple simultaneous do-files. Many of my do-fil…
Trajectory analysis - keep registry_HbA1c if date_of_HbA1c_test > 1 year after baseline_HbA1c for each ID_numberDear Stata experts, I am really stuck. In my data set, I have variables for the participant's ID nu…
Combine two variables into a dummy variableHey dear STATA Users, I am meant to create a dummy variable. That's literally a set of dummy variab…
Averaging year and outcome variables for panel dataHi STATA community, I was browsing through forum questions regarding averaging year and outcomes on…
Subscribe to:
Post Comments (Atom)
0 Response to Help with new variable generation
Post a Comment