Suppose that I have an m x n data matrix M where the first column is my binary response variable and the remaining columns are predictors.
I created a multiple logistic regression model using
my.model = glm(M[,1] ~ M[,2] + M[,3] + ... M[,n], family=binomial("logit"))
My question is how I can do this without having to write out the M[,2]+ ... + M[,n] terms, e.g. something along the lines of just:
my.model = glm(M[,1] ~M[2:n], family = binomial("logit"))
(I know that the latter won't work, but I'm looking for something where I can do something analogous using a list/block of the matrix).