Page 1 of 1

Dichotomous variable

Posted: Thu Apr 08, 2021 9:51 am
by erikabal
Hi,

I have a very beginner's problem. I am doing multiple regression and I want to include dichotomous variables (male/female, manager or not). I was able to transform categorical data into 2 categories (ex. socioeconomic status: employee, unemployed, entrepreneur, student, where the student was transformed as 1, otherwise as 0, used as nominal). But when the data is actually dichotomous as gender (f = 0, m = 1), the regression pops out an error: contrasts can be applied only to factors with 2 or more levels.

Can anyone please help me to solve this problem? It would be highly appreciated.

Thank you, Erika

Re: Dichotomous variable

Posted: Thu Apr 08, 2021 9:54 am
by jonathon
hi erika,

take a look at a contingency table of student vs gender, and see if there are any cell counts of zero.

cheers

jonathon

Re: Dichotomous variable

Posted: Thu Apr 08, 2021 10:42 am
by erikabal
Jonathon, thank you for your help, it works now.

Erika