Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Recode nominal text to binary variable

Can somebody help me explain, step by step, how to create a new variable in JASP from a nominal text variable (“Male” / “Female”) into a binary 0/1 variable?

All the best,

Per – the JASP lover ❤️

Comments

  • My LLM gives a pretty extensive answer -- have you tried?

    EJ

  • Yes it did very good. Thank you. Do you use LLM integrated in JASP or a one beside (such as ChatGPT or Co-pilot)?

  • Hi,

    It looks like you've already solved this, but in case someone else stumbles upon this question in the future, here is one way to do this:

    1. Create a new variable, give it a name (gender01), select Scale , and specify `Computed with drag and drop`.
    2. On the right, scroll down until you find ifElse(y) , and drag it into the area
    3. Drag the = from the above the computed column field into the `test` area.
    4. Drag the variable to the left hand side and the value to compare to to the right hand side.
    5. Specify the desired output values (0 and 1).
    6. Click `Compute column`.

    Cheers,

    Don

  • Here's another way, using 'Computed with R code':


    R

Sign In or Register to comment.