Assume one of the explanatory variable (named X1) in your logistic regression is a categorical variable with the following levels: low, average and high, and another explanatory variable (named X2) is also categorical with the following levels: Sydney, Melbourne, Hobart and Brisbane. Explain how you will use them in developing your logistic regression model. How many coefficients you will have in your final model?
Solution :
The variables X1 is a categorical variable and can be encoded using two numbers and similarly X2 can be encoded using 1 number.
Logistic regression model :
It is used to describe data and to explain the relationship betweem one dependent binary variable and one or more nominal, ordinal, interval or ratio- level independent variable.
There fore then they can be two coefficients in the logistic regression model corresponding to two variables.
For X1, there are three categories so we would need (3 - 1) i.e. 2 variables.
For X2, there are four categories so we would need (4 - 1) i.e. 3 variables.
Hence,
Number of coefficients in final model = 2 + 3 = 5
Let me know in the comment section if anything is not
clear. I will reply ASAP!
If you like the answer, please give a thumbs-up. This will be quite encouraging for me.Thank-you!
Get Answers For Free
Most questions answered within 1 hours.