Hi,
I'm creating a new dummy variable such that a = b/c if d = chocolates or sweets, else a = b*c.
HTML Code:
gen a = 0
replace a = b/c if d == "chocolates" | d == "sweets"
Trying to do the first part gives me error type mismatch r(109). Where am I going wrong?