Transform from multiple variables

Discuss the jamovi platform, possible improvements, etc.
Post Reply
agoodquestion
Posts: 6
Joined: Mon Nov 16, 2020 9:30 pm

Transform from multiple variables

Post 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
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Transform from multiple variables

Post 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
agoodquestion
Posts: 6
Joined: Mon Nov 16, 2020 9:30 pm

Re: Transform from multiple variables

Post 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
raimoi
Posts: 9
Joined: Sun Feb 12, 2023 12:10 am

Re: Transform from multiple variables

Post by raimoi »

Hi ! Could you share how you did it, Lina?
agoodquestion
Posts: 6
Joined: Mon Nov 16, 2020 9:30 pm

Re: Transform from multiple variables

Post 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!
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Transform from multiple variables

Post by jonathon »

info on recoding variables

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

jonathon
Post Reply