1

I've been running regressions for some months now and just realized I've been writing things without truly understanding the code.

For example, I am now running:

logit <- glm(loan_result ~ . -annual_income, data = train_set, family = "binomial")

I realize the command means: "use all the variables in train_set except for anual income to model loan_result using a logit model."

I have no idea what the dot and the tilde mean separately or how to use them individually in any other function. Could someone explain the meaning of these two characters please?

Thanks in advance.

GetHacked
  • 526
  • 3
  • 19
Arturo Sbr
  • 2,773
  • 1
  • 10
  • 34

1 Answers1

4

This is the "Formula" syntax ~ is read as "in function of" and . means all other variables in this case you have load_result in function of every other variable except annual_income

Jake Kaupp
  • 7,097
  • 2
  • 21
  • 34