Suppose my imaginary dataset is this:
dt1<-data.frame(X2=c(1,2,3,4,5),X9= c(3,4,5,6,7), X16=c(10,11,12,13,14),
X30=(21,22,23,24,25), X23=c(0,1,0,1,1))
I ran a logistic regression model on a given data set using the code below:
myresult<-glm(X23~., data = dt1, family = "binomial")
and I obtained the following summary as shown in the attached pic below: (the summary results are for a different data set but with same column and data set names): summary results pic.
The summary contains the coefficient estimates of X2, X9, X16 and X30 variables. I would like to write a code which would return me the coefficient estimates only for X2 and X16 variables. Could anyone please guide me. Thanks