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
Problem with stcox hazard modelHi all, I am trying to use stcox to create a multivariable cox proportional hazard model. I am runni…
Trend analysisI am interested in comparing a linear trend model with 1) power trend, 2) exponential trend, and 3) …
Expand value within groupDear all, I am currently working on a patient consultations database from 2016 to 2021. My purpose …
cvlasso lambda list truncated starting in v14I am using cvlasso and it seems to be truncating the number of lambda's generated when the lminratio…
What's the principle behind twoway graph's legend and its label optionDear Stata users, I have an interesting finding regards to twoway graph's legend option, put it pre…
Subscribe to:
Post Comments (Atom)
0 Response to Type mismatch issues with generating / replacing
Post a Comment