Derivation
variable: height (table[s]: this dataset)
variable: weight (table[s]: this dataset)
variable: impval (table[s]: this dataset)
variable: sex (table[s]: this dataset)
variable: dropped_I (table[s]: this dataset)
gen ffmass_I=-10.68+(0.65*(height^2/impval))+(0.26*weight)+(0.02*impval) if sex==0 & height~=. & weight~=. & impval~=. //male
replace ffmass_I=-9.53+(0.69*(height^2/impval))+(0.17*weight)+(0.02*impval) if sex==1 & height~=. & weight~=. & impval~=. //female
<remove inconsistent data from combined data:>
foreach var in fatmass_I fatmasspc_I ffmass_I ffmasspc_I {
replace `var'=. if dropped_I==1
}