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
Panel data, want to see the regression results for two time periods and country setsHi, I have a panel dataset of with a variable country, year, university, sat score. (Similar variabl…
Increase in the number of observations after using RESHAPE commandDear community, My original data are in long shape. When I reshape long to wide there is an increas…
Dummy VariableHow do I create a dummy variable which takes the value 1 in a household when first two children are …
Asgen with missing observations for the weightDear Forum, I have a short question regarding the ASGEN command with weights. I am creating value w…
time series prediction assignmentBackground: As a researcher at the financial economics research department of the Federal Reserve Ba…
Subscribe to:
Post Comments (Atom)
0 Response to Help with new variable generation
Post a Comment