This text is from An Introduction to Statistical Learning with Applications in R(by • Gareth James • Daniela Witten • Trevor Hastie • Robert Tibshirani) List item Can anyone help me by making linear models with these different variable so that I can practically understand what is wrong with these
Suppose that we are trying to predict the medical condition of a patient in the emergency room on the basis of her symptoms. In this simpliﬁed example, there are three possible diagnoses: stroke, drug overdose, and epileptic seizure. We could consider encoding these values as a quantitative response variable, Y , as follows:
y=1 if stroke;
y= 2 if drug overdose;
y= 3 if epileptic seizure.
Using this coding, least squares could be used to ﬁt a linear regression model to predict Y on the basis of a set of predictors X1,...,Xp. Unfortunately, this coding implies an ordering on the outcomes, putting drug overdose in between stroke and epileptic seizure, and insisting that the diﬀerence between stroke and drug overdose is the same as the diﬀerence between drug overdose and epileptic seizure. In practice there is no particular reason that this needs to be the case.
For instance, one could choose an equally reasonable coding,
y=1 if epileptic seizure;
y=2 if stroke;
y=3 if drug overdose.
which would imply a totally diﬀerent relationship among the three conditions. Each of these coding would produce fundamentally diﬀerent linear models that would ultimately lead to diﬀerent sets of predictions on test observations.
please help me to understand this that
1)how to produce linear model using any of the relationship
2)how different relationship among the three condition produce different linear model