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
Difference-in-difference fixed effects with multiple periodsDear all, I am trying to run a difference-in-difference fixed-effects model. The challenge here is …
Data Analyst, Research Job Opening - Center for Community Health, Northwestern UnviersityWorking in the Center for Community Health in Northwestern University’s Institute of Public Health, …
"Rename" isn't letting me change variable names to lowercase.I’ve concatenated four years of survey data (2013-2016). Most of the variables in each year are the …
Using psmatch2 for panel dataDear Statalisters, I am using balanced panel data where the panel variable is country and the time v…
frame post not working after last updateHas anyone else noticed their code using frame post is now not working? I had code like below that w…
Subscribe to:
Post Comments (Atom)
0 Response to Help with new variable generation
Post a Comment