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
Correlation between two long time seriesDear all, I want to test the correlation between two time series with large T, for example, the pri…
Table of descriptive data. Possible to switch rows and columns using tabstat?Hello, In my dataset I have 3 groups (1, 2, 3) and 20 continous variables (A, B, C, etc. ) for each …
mean comparison for panel dataDear All, I have a panel data with three waves and i am comparing the mean difference (mean comparis…
Add shade in the graphDear all, I want to add shade in my graph when the variable corr_x is negative. Code: * Example ge…
Add shade in the graphDear all, I want to add shade in my graph when the variable corr_x is negative. Code: * Example ge…
Subscribe to:
Post Comments (Atom)
0 Response to Type mismatch issues with generating / replacing
Post a Comment