I'm trying to fit a logistic regression model using all predictors as a polynomial model. I've tried doing this but didn't work:
poly_model = glm(type~ poly(., 2), data=train_data, family=binomial)
I'm using the built in dataset:
train_data = MASS::Pima.tr
What's the correct way to do this?