0

I want to perform a regression and first of all I want to test if my nullmodel is significant. So if not, I wont be able to perform the stepwise introduction according to AIC.

So I did the following:

m0 <- glm(Y~ 1, data = Data, family = binomial)
summary(m0)

So I have seen on the internet that some people use this code:

model <- glm(Y ~ .,data = Data, family=binomial) 
summary(model)

What I want to know is whats the difference between the dot (.) and the 1.

Thank you :)

bli12blu12
  • 357
  • 2
  • 11
  • 1
    "*If not, I wont be able to perform the stepwise introduction according to AIC*". That sounds suspicious. I mean, stepwise regresssion is widely discouraged and recognized as dubious, but I've never heard any conditions on the null model for it to "work". As for how to proceed, I would recommend a regularized regression such as the Lasso or a Bayesian model. – Gregor Thomas Jun 11 '18 at 16:41
  • 1
    Yes, I think testing if the null model is significant is pointless - basically it's just asking if your data is centered or not. And I also think very poorly of stepwise regression in general. As I said in my first comment, I would recommend a regularized regression such as the Lasso or a Bayesian model. stats.stackexchange [has a nice Q/A about automatic model selection here](https://stats.stackexchange.com/q/20836/7515). – Gregor Thomas Jun 11 '18 at 17:00
  • 1
    I don't understand your new question. The question you posted was about how to do feature selection, and I gave you my recommendation. Now it seems like you are asking *"How about I don't do feature selection, I just use all my variables. Will that work?"* No one can answer that without knowing your data and your goal in the analysis. – Gregor Thomas Jun 12 '18 at 13:22

1 Answers1

1

The Y is the dependent variable the right is the independent variable, the . is short hand for all the other variables

Y ~ val means model Y with val Y ~ . means the model against all the other variables

Meaning of dot in lm(y~.) in R

Carlos Santillan
  • 1,077
  • 7
  • 8