Question: Imagine we have a binary numeric variable named employed that is equal to 2 if the individual is employed and 1 if the individual is

Imagine we have a binary numeric variable named "employed" that is equal to 2 if the individual is employed and 1 if the individual is not employed. We want to create a new variable that is equal to 1 if employed and 0 otherwise. What is wrong with this code?
It should be: gen newvar employed ==2
It should be: gen newvar==(employed=2)
"gen" is not the correct command to construct new variables
It shcyld be: gen newvar=(employed=="2")"
 Imagine we have a binary numeric variable named "employed" that is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!