2021-02-26

How can I modify my db for a Logistic regression in R?

I have the following fields in my database:

  • record: row number
  • Father: (1 to 7 values)
  • Mother: (1 to 7 values)
  • Age: 13, 14, 15 and 16 yo.
  • Gender: Male/Female
  • Suicide: (1/0 values)

I'd like to create a ggplot from this logistic regression model where my response variable is Suicide vs Parent's education (Father & Mother) The plot has a straight line and not a curve as I expect, I'm using this code:

ggplot( baseRL, aes(x=Father, y=Suicide)) +
  geom_point() +
  geom_smooth(data = baseRL, aes(x = Father, y = Suicide),
              method = "glm", method.args = list(family = "binomial"), 
              se = FALSE)

Is there another way to plot my objective? Thanks!



from Recent Questions - Stack Overflow https://ift.tt/3qQDcE9
https://ift.tt/eA8V8J

No comments:

Post a Comment