Consider the following:
set.seed(1)
y <- rbinom(10, 1, prob=.5)
x <- runif(10)
m <- glm(y~x, family=binomial)
s <- summary(m)
I am looking for some function, foo(s)
, that I can use to return "y"
.
There may be a better answer, but
as.character(attributes(s$terms)$variables[[2]])
works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With