Hi,

I am trying to plot densities for the logit and probit models with plot function but it’s not working out.

The code is below.

if ggplot2 can be used to achieve same outcome then it would be of great help.

dataset available here https://drive.google.com/open?id=1nwkjz-y_aGYGP1HS8JB0XmJVDzppIWw-

```
MP_NSS$scst= MP_NSS$socgrp
MP_NSS$scst= ifelse(MP_NSS$socgrp== c(1, 2), 1, 0)
MP_NSS$pds2= MP_NSS$pds_wheat_qty
MP_NSS= MP_NSS %>%
replace_na(list(pds2= 0))
MP_NSS$pds2= ifelse(MP_NSS$pds2>0,1, 0)
MP_NSS$total_land2= MP_NSS$total_land
MP_NSS= MP_NSS %>%
replace_na(list(total_land2= 0))
logit3= glm(pds2~ scst+ unitvalue_rice_wheat+ total_land2+ I(total_land2* total_land2), family = binomial(link = "logit"), data = MP_NSS)
plot(MP_NSS$unitvalue_rice_wheat, MP_NSS$pds2)
curve(exp(coef(logit3)[1]+ (coef(logit3)[2]*(MP_NSS$unitvalue_rice_wheat)))/(1+ exp(coef(logit3)[1]+ (coef(logit3)[2]*(MP_NSS$unitvalue_rice_wheat)) )))
```