Hi all,
I'm currently trying to create a dummy variable, inlaborforce, using the below code:
gen inlaborforce = 0
replace inlaborforce = 1 if labforce == "Yes, in the labor force"
replace inlaborforce = . if labforce == "NIU"
I'm seeing similar if not identical syntax in guides / forums, but I'm get a type mismatch error. Tried to destring but both variables are numerical so that didn't work.
Sorry if this is too basic a question. Thanks,
Related Posts with Type mismatch issues with generating / replacing
Question related to loop/foreach vvvHi, Using the below sample data, I am trying to obtain the number of values in b1 (id=50_512) that e…
Setting up data for competing risk analysisHello, So I used a cox proportional regression model and I am pretty sure the assumptions have been…
Panel dataI hope all is well and stay safe at home. I am a very beginner for STATA. I currently clean adminis…
Group mean and separating data into 3 groupsHi, I have a large set of data sets and multiple variables. I want to do the following: 1. First I …
can't delete a post?wish I could delete a post that seems rather silly now with more understanding. …
Subscribe to:
Post Comments (Atom)
0 Response to Type mismatch issues with generating / replacing
Post a Comment