Final Project Generate new variable

Final Project Generate new variable

by Faby -
Number of replies: 1

Hi, 

I'm trying to generate a new variable that combines race/ethnicity and language. I did the gen "newvarname"= 0 and am now trying to replace with two commands: 

replace "newvarname" = 1 if ethnicmost_mr == "4" & language == "S" 

in this case I'm trying to combine all the participants that indicated they were Latina (4) and used spanish in their interview. Stata keeps giving me a type mismatch error. I can't figure out where I'm going wrong. 

thank you, 

Faby

In reply to Faby

Re: Final Project Generate new variable

by Kristen -

Hi Faby, 

Is the language variable numeric or a string?