I have the following variables in a dataframe: PRCITSHP, FATHER, MOTHER, TOTAL
I’m trying to create a new variable TEST (which equals the variable TOTAL) based on the following conditions:
PRCITSHP<=3
FATHER>=100 except values ‘623’,’676′,’677′ or FATHER equals any of the following: ‘059’,’062′,’063′,’064′,’065′,’074′,’075′,’080′,’082′,’085′,’088′,’090′,’091′,’092′,’093′,’094′,’097′,’098′,’099′
MOTHER<100 except values ‘059’,’062′,’063′,’064′,’065′,’074′,’075′,’080′,’082′,’085′,’088′,’090′,’091′,’092′,’093′,’094′,’097′,’098′,’099′ or MOTHER equals any of the following: ‘623’,’676′,’677′
As you can see, it’s pretty complicated… What code creates the variable TEST to equal the variable TOTAL if all the conditions are met?