0
$\begingroup$

I am trying to understand why my data is not showing a full S-curve? Is it because the predictor does not do a good job of predicting fellow = 1, or simply because there are few fellow = 1 that score within the top end on c_ns2 (x-axis variable)?

enter image description here

[![enter image description here][2]][2]

///

when attempting to extend x-xis to range from 2.5--7: enter image description here

##### 2 #####
ggplot(graph_df, aes(c_ns2, fellow)) +
  geom_point() +
  geom_smooth(method = 'glm', method.args = list(family = "binomial"), se = FALSE, size = 2, colour = "lightblue") +
  theme_classic() +
  geom_hline(yintercept = 0.5, colour = "grey50", linetype = 2, size = 1) +
    xlim(c(2.5, 7))
$\endgroup$

1 Answer 1

0
$\begingroup$

Extend your graph out for larger c_ns2 (x-axis). The graph will then show a full sigmoid curve. There are likely many more fellow=0 than fellow=1 and the relative distribution weights the fitted curve quite heavily towards them.

$\endgroup$
7
  • $\begingroup$ Thank you very much for your explanation @njp. There is an upper limit to the x-axis variable: 5.32, so can I ask what you mean by extending the c-axis? This is exactly right! There are many more 0s than 1s in the true data. I found it a little interesting that when plotting the predicted probabilities (instead of fitting the data with a glm, binomial function), it extends a little more (added above). $\endgroup$
    – In_cognito
    Apr 4 at 22:56
  • $\begingroup$ Not sure what graphics package you are plotting this in, but just set the x limits of the figure to, say, [2.5, 7]. It looks like the centre of the curve is around 4.75. Your predictions (bottom panel) will look the same but hopefully the blue curve will show the full sigmoid curve that you are after. $\endgroup$
    – njp
    Apr 4 at 23:51
  • $\begingroup$ thanks! I have extended the breaks on the x-axis (in R), and still thefitted line isn't extending much above 0.5 (see new pic) with added code! $\endgroup$
    – In_cognito
    Apr 5 at 1:08
  • $\begingroup$ try + xlim(c(2.5, 7)) rather than + scale_x_continuous(breaks=seq(2.5, 7.0, 0.5)) $\endgroup$
    – njp
    Apr 5 at 1:24
  • $\begingroup$ thanks--the data ends, but line extends $\endgroup$
    – In_cognito
    Apr 5 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.