Using the set of data below and using R in Rstudio im attempting to form a very simple logistic regression model using "glm" and then given the formula logit ProbOfBreastFeed = a + b * Age
where a is the intercept
and b is the slope
im trying to get the mean and standard deviation of a and b. Im new to R so perhaps its a misunderstanding here in how to get to this but when attempting to use glm im getting the error Error in model.frame.default(formula = logisticBabies ~ No + Yes * Age, :
invalid type (list) for variable 'logisticBabies'
and im not quite sure why that is or how to resolve that. Any insight?
DATA
Age No Yes
28 4 2
29 3 2
30 2 7
31 2 7
32 4 16
33 1 14
Current R Code
glm(logisticBabies ~ No + Yes * Age, data = logisticBabies, family = binomial)