# Linear model with and without intercept [duplicate]

This question is based on Everitt et al. (A Handbook of Statistical Analyses Using R) and I am trying to answer these questions:

1. Load the Default dataset from ISLR library. The dataset contains information on ten thousand customers. The aim here is to predict which customers will default on their credit card debt. It is a four-dimensional dataset with 10000 observations. The question of interest is to predict individuals who will default . We want to examine how each predictor variable is related to the response (default). Do the following on this dataset:

a) Perform descriptive analysis on the dataset to have an insight. Use summaries and appropriate exploratory graphics to answer the question of interest.

b) Use R to build a logistic regression model.

c) Discuss your result. Which predictor variables were important? Are there interactions?

However, I am more interested in understanding when one should use -1 and the relevance of excluding intercept in a model. Here is the data summary:

# Set up data
data("Default", package = "ISLR")

#create default binary
default_binary     <-
ifelse(regexpr('Yes', Default$$default) == -1, 0, 1) dflt_str <- ifelse(regexpr('Yes', Default$$default) == -1,
"Not Defaulted",
"Defaulted")

stdn     <- ifelse(regexpr('Yes', Default$$student) == -1, 0, 1) stdn_str <- ifelse(regexpr('Yes', Default$$student) == -1, "Not-Student", "Student")

blnc <- Default$$balance incm <- Default$$income

df <-
data.frame(default_binary, dflt_str, stdn, stdn_str, blnc, incm)

# with intercept
fm0 <- default_binary ~ stdn + blnc + incm
# no intercept as indicated by -1
fm1 <- default_binary~-1+stdn+blnc+incm
regression_model_without_minus_1 <- glm(fm0, family = binomial())
regression_model_with_minus_1 <- glm(fm1, family = binomial())

and for summary of the model, I get:

Can someone please explain me the difference between results with -1 and without -1 in these models with merits and drawbacks. Thanks for helping me!

• "the difference", "merits and drawbacks". These things hinge crucially on the interpretation of your results in terms of real-life things. What are you modeling? The intercept is simply what you expect $y$ to be when $x=0$. If you have some a priori info that constrains this, you can use it in your model by basically just not modeling the intercept. However, any a priori info involves knowledge about the world and the real-life context of the problem.
– Him
Sep 17, 2019 at 18:53
• @Scott I am trying to understand when one should use -1 and the relevance of excluding intercept in a model.
– MAPK
Sep 17, 2019 at 18:55
• Exactly. Your question does not include sufficient information to determine whether one should model the intercept or not, any more than it contains sufficient information as to whether you should even be modeling with a linear model or a spherical one. You should model the intercept when it makes sense from the context of the problem to model the intercept. Without any context, your question has only one answer: ¯\_(ツ)_/¯
– Him
Sep 17, 2019 at 18:58
• @Scott Please see my updated question.
– MAPK
Sep 17, 2019 at 19:04