Dummy coding confusion

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
ccheers
Posts: 2
Joined: Sat Mar 18, 2023 1:18 am

Dummy coding confusion

Post by ccheers »

Hi all,
I have a large data set, and am trying to complete a 2 x 2 factorial ANOVA. One IV is gender of participant (male or female), the other is gender of a target (target male or female). The DV is how trustworthy the target is rated. Both IVs a between subjects (participants only judged a male or female target)
As such the trustworthy DV is in separate columns for the target male and female, so I'm stuck on how to create the dummy variable for the target IV. I have been able to manage to compute two new variables, using the IF function to compute new variables. One variable shows "0" if the male target. The other variable shows "1" if the female target. However, now I can't work out how to combine them.
I am also interested if there is a way to use the "IF" function using information from two variables, as then I could ask that IF the target male trustworthy column, show a value to show "0", and if the trustworthy female column shows a value, to show "1."

I hope that makes sense. Any help is greatly appreciated.

PS. I have tried to export of excel using CSV, so I could just combine using excel, however the file is too large a data was lost.
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Dummy coding confusion

Post by mcfanda@gmail.com »

I'd suggest to make a small dataset to exemplify the issue, and post it as a .omv file, so we know what you did and how to solve the issue.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Dummy coding confusion

Post by jonathon »

people usually want to dummy code because they're coming from SPSS where the linear regression doesn't support factors. in jamovi, you can provide factors to the lin reg, and it will automatically dummy code them for you.

jonathon
ccheers
Posts: 2
Joined: Sat Mar 18, 2023 1:18 am

Re: Dummy coding confusion

Post by ccheers »

Thanks for your help! I've attached an example to illustrate the data set. As you mentioned Jonathon, I am a previous SPSS user, so with a data set like this I would normally combine the two trustworthy variables into one variable, and then create a dummy coded variable to use as the IV or "factor" which would indicate whether the male or female condition was shown. The new combined trustworthy variable would become the DV. Are you suggesting I should do it as a linear regression rather than an ANOVA? Or is there a way to do the 2x2 ANOVA, however jamovi does the dummy code for you. As I'm trying to do the ANOVA and as the fixed factors need to be nominal or ordinal variables, I'm not sure how a data set like mine would work.
DataExample.omv
(3.78 KiB) Downloaded 50 times
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Dummy coding confusion

Post by jonathon »

let's start with your data

Screenshot 2023-03-19 at 15.53.15.png
Screenshot 2023-03-19 at 15.53.15.png (13.29 KiB) Viewed 1579 times

i'll begin by saying this data is very unusually formatted. i used a couple of computed variables to make it suitable for an ANOVA.

IFMISS(`Trustworthy Male Target`, 'Female', 'Male') <- i've just noticed i've done that backwards
IFMISS(`Trustworthy Male Target`, `Trustworthy Female Target`, `Trustworthy Male Target`)

Screenshot 2023-03-19 at 15.59.45.png
Screenshot 2023-03-19 at 15.59.45.png (59.91 KiB) Viewed 1579 times

and here is your .omv file

DataExample.omv
(4.44 KiB) Downloaded 58 times
Post Reply