While I know that the following command will sum ri where the variable pic is equal to USA and spread the sum to all observation whether or not pic is equal to USA. However, I am not sure what specifically the slash does that the if condition cannot. also, what other useful uses of slash are availabe in Stata.
Code:
egen GDPref = total( ri / ( pic == "USA"))
Comment