# linear regression short easy question

#### leo nidas

##### New Member
Hi there,

I have the response Y and some covariates. I want to do linear regression.
Among the covariates there is the covariate sex (1: male, 2:female)

Can I just apply linear regression with spss or is there any problem with the categorical covariate? Or is there any special treatment needed?

Thanx in advance for any answers!

#### Link

##### Ninja say what!?!
I'm not familiar with SPSS syntax, but there is no problem with using a categorical covariate. In your situation, it'll just give each line a different intercept.

#### leo nidas

##### New Member
Forget SPSS,

what do you mean it will give each line a different intercept? I am talking about a multiple linear regression model and not a mixed model.

The form of the model will be y=b0+b1*Sex+b2*Age for example.

where the response and the variable of age are continuous and SEX is (1: male and 2:female)

I think that the above model is not correct because the variable SEX contains not scaled values. It is an ordinal variable and the values 1 and 2 are arbitrary. It doesn't mean that the class 2 is greater somehow from class 1. So I think that I should not include SEX in the model.

Were you talking about a mixed model?

Thanx for your time and looking forwars for your answer!!

#### Etienne

##### New Member
What Link is saying is that the model you want to fit is a model in which y is an affine function of age with a different constant for male and female individuals (two parallel lines).

To do so you need SEX to be a dummy variable : 0 for male and 1 for female. The constant for male will be b0 and the constant for female is b0 + b1. The lines are parallel with a slope equal to b2.

Hope this helps !

#### leo nidas

##### New Member
Would it be a problem if instead of 0 and 1 the coding values were 1 and 2 for example?

Why?

Thanx again!

#### Dason

##### Ambassador to the humans
It's still possible. You'll have a different overall intercept compared to doing 0-1 encoding. 0-1 encoding is more common and what you'll probably find in any literature. It's also slightly easier to interpret but you can still interpret things in the 1-2 coding scheme (but I recommend the 0-1).

#### Link

##### Ninja say what!?!
What Link is saying is that the model you want to fit is a model in which y is an affine function of age with a different constant for male and female individuals (two parallel lines).

To do so you need SEX to be a dummy variable : 0 for male and 1 for female. The constant for male will be b0 and the constant for female is b0 + b1. The lines are parallel with a slope equal to b2.

Hope this helps !
Thank you very much for clarifying Etienne.

#### leo nidas

##### New Member
Thank you all very much!

It is clear now!