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
Increasing memory, exact logistic regressionHi, I'm using STATA 16. I'm trying to do an exact logistic regression, but it gives me the error me…
Structural equation model (SEM): degree of freedom and bootstrappingDear Statalist, First of all, Happy holidays to the people on this forum! I have 2 questions concer…
*PPMLHDFE number of observationsHi, I am running a trade gravity model. When I run the model with OLS, the number of observations …
Better looking window (resolution)Dear all, I was wondering if there is a way to increase the resolution of the whole Stata screen, i…
Xtlogit correctly predictedDear stat users, I am interested in calculating the correctly called event, false alrams, specifity…
Subscribe to:
Post Comments (Atom)
0 Response to Help with new variable generation
Post a Comment