0

# using categorical variable in linear regression

Tue 14 Jan, 2020 08:01 am
Hi,
Can we use categorical dependent variable and categorial independent variable in linear regression analysis?
• Topic Stats
• Top Replies
Type: Question • Score: 0 • Views: 75 • Replies: 5
No top replies

engineer

1
Tue 14 Jan, 2020 08:18 am
@maca111,
To do a linear regression, you need to have a continuous variable. A lot of stats packages will allow you to include a categorical variable in there too, but it is checking for a bias and an interaction in the variables (say a change in slope) by category.
maca111

1
Tue 14 Jan, 2020 09:23 am
@engineer,
Thank you! Another one: Are quality of exercise (predictor) and concentration level (outcome) categorical variables?
engineer

1
Tue 14 Jan, 2020 10:09 am
@maca111,
Depends on how you measure it. If "quality of exercise" is "low", "medium" and "high", they those are ordinal values. They have some order to them but are not quantified. You could also call them categorical variables. If you use a measurable metric, say something like number of minutes with heartbeat above 120 bmp, then that is a continuous variable. Look at this website for a more detailed explanation.
maca111

1
Tue 14 Jan, 2020 10:16 am
@engineer,
Great - so I can use it by quantifying it. And can the outcome variable (concentration) be categorical or it also has to be quantified? Sorry, a beginner!
engineer

1
Tue 14 Jan, 2020 11:43 am
@maca111,
Best if it is quantified. If it is categorical, you end up computing the probability of getting category two instead of category one as a function of your input variable. Not nearly as useful.
0 Replies

1. Forums
2. » using categorical variable in linear regression