1
$\begingroup$

In a question I'm given

Construct a linear model and see how well the fat content can be estimated. That is, estimate the generalization error with a linear model. Optimize the number of principal components, i.e. determine how many and which components you need to get good generalization performance. It makes sense to report both an MSE and an RMS error. Do a residual analysis (this comment goes for all items).

The dataset I'm using includes 2 class variables as 'democratic' and 'republican'.

What I need to know is.. Can I use Logistic regression for this analysis? Can it be considered as a linear model or do I need to use the linear regression model?

$\endgroup$
7
  • 2
    $\begingroup$ I feel like I'm missing something. For the fat content that you are predicting is it like a 0,1 variable? Like the democratic/republican variables don't seem to force a logistic regression since you aren't predicting that (or are you?). $\endgroup$ Commented May 15, 2019 at 3:16
  • $\begingroup$ Yes.. I'm going to use predict democratic and republic... Is Logistic regression suitable for this? I done have a proper idea on what the mean by fat content estimation. $\endgroup$
    – Hiru
    Commented May 15, 2019 at 3:24
  • 2
    $\begingroup$ I mean if you are estimating 0,1 for fat content then I guess logistic regression makes the most sense. $\endgroup$ Commented May 15, 2019 at 3:28
  • 1
    $\begingroup$ I meant estimating. sorry for the confusion. $\endgroup$ Commented May 15, 2019 at 3:33
  • 1
    $\begingroup$ This still seems very unclear to me. You are trying to predict fat content from Democratic and Republican? Please show us an example of your data. If the dataset is small, show all of it. (If this is self-study please use that tag.) $\endgroup$
    – Nick Cox
    Commented May 15, 2019 at 7:54

1 Answer 1

1
$\begingroup$

Go on with logistic regression (LR.) Logistic regression is a generalized linear model (glm) and is the (first, at least) way to go when your response variable is binary.

To read up on LR Why isn't Logistic Regression called Logistic Classification?, Intuition behind logistic regression.

EDIT

Answer to additional question in comment: Your binary response variable democrat/republican can be modeled as binomial, which has a nonconstant variance which is a function of the mean. So the constant variance assumption of usual linear regression is not fulfilled. Also, linear regression may fit probabilities larger than one or smaller than zero, which does not make sense. Still, this is sometimes used as an approximation under the name linear probability model. Don't do it without some very good reason.

$\endgroup$
1
  • 1
    $\begingroup$ Hi I'm having a question. Why does linear regression doesn't work for this? $\endgroup$
    – Hiru
    Commented May 15, 2019 at 12:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.