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
Multiple individuals per household id number: how to get household information from individual observationsI am working in a dataset that has both household and individual level variables. We have a total of…
Plotting Gamma function simultaneouslyAny possibility one could plot two different gamma distributions at the same time. …
Combining Datasets and Reformatting DataHello everyone. I have a number of datasets (excel files) with data formatted as SheetName: Year1,…
dropping observation with a conHello all, I would like to drop certain observations from my database and I am not sure how to do so…
log forvalueswhile Code: forvalues i = 10(10)200 { works great, and increments i linearly, is it possible to eas…
Subscribe to:
Post Comments (Atom)
0 Response to Type mismatch issues with generating / replacing
Post a Comment