jeudi 18 juin 2020

Conditional calculation of equation in new column

I have 2 equations. On the basis of SEX the value of data$CB changes. Kindly check if the conditional loop is correct as it is not working.

if ( data$SEX==1) { data$CB= (140-data$AGE)*data$WT/(data$CRCL*72)}

else if ( data$SEX==0) { data$CB =(140-data$AGE)*data$WT/(data$CRCL*72)*0.85 }

Aucun commentaire:

Enregistrer un commentaire