Dichotomous variable

Discuss statistics related things
Post Reply
erikabal
Posts: 2
Joined: Thu Apr 08, 2021 9:27 am

Dichotomous variable

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

Re: Dichotomous variable

Post 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
erikabal
Posts: 2
Joined: Thu Apr 08, 2021 9:27 am

Re: Dichotomous variable

Post by erikabal »

Jonathon, thank you for your help, it works now.

Erika
Post Reply