Dichotomous variable

Discuss statistics related things

by erikabal » Thu Apr 08, 2021 9:51 am

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

by jonathon » Thu Apr 08, 2021 9:54 am

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

by erikabal » Thu Apr 08, 2021 10:42 am

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

Erika
erikabal
 
Posts: 2
Joined: Thu Apr 08, 2021 9:27 am


Return to Statistics