Page 1 of 1

Transform from multiple variables

Posted: Mon Sep 06, 2021 12:37 am
by agoodquestion
Hi! This is a pretty basic question, but I can't figure it out. I'm trying to transform (recode) multiple variables into one, but the transform function only gives me the option of using the original source variable to pull the data. For example, I have several variables denoting race/ethnicity, and I want to pull them into one. So I want to combine all the people who identified as either Black, Asian, or Latinx into one variable. How do I do this recode other than manually?

Many thanks in advance!
-lina

Re: Transform from multiple variables

Posted: Wed Sep 08, 2021 5:58 am
by jonathon
hi,

it's possible that if you're combining many variables, you may be better off just using the computed variables.

but whether you're using computed or transformed, you can refer to any extra columns you want by name.

if it's still not clear, if you can share a simplified example where you'd like to combine to columns, i should be able to give you a concrete solution.

cheers

jonathon

Re: Transform from multiple variables

Posted: Wed Sep 08, 2021 6:14 pm
by agoodquestion
Hi Jonathon,

Thank you for the reply. I was able to do it with a mix of compute and then transform, per your suggestion.

Best wishes,
-lina

Re: Transform from multiple variables

Posted: Sun Feb 19, 2023 4:18 pm
by raimoi
Hi ! Could you share how you did it, Lina?

Re: Transform from multiple variables

Posted: Thu May 25, 2023 9:56 pm
by agoodquestion
Hi raimoi,
I'm sorry I didn't see this message sooner - I didn't receive an email alerting me to your message.
The way I did it was I computed a sum variable of all the variables that I wanted in one condition, and then transformed that computed variable with the formula: if >1 (meaning: if any of the original variables showed up as true/checked off) then 1, and all else is 0.
This only worked because the variables were all binary. I'm not sure how I would do the recode otherwise. I hope this helps, and again apologies for the delay!

Re: Transform from multiple variables

Posted: Fri May 26, 2023 1:50 am
by jonathon
info on recoding variables

https://blog.jamovi.org/2018/10/23/tran ... ables.html

jonathon