0
$\begingroup$

I have fit a simple binary logistic GAM model in R and have used the plot() function to plot the results of this model. The outputted graph shows a fitted line and a confidence interval, but the scale is clearly not 0-1. Does anyone know what is being plotted? Ideally I would like to get a graph of the predicted probability of the outcome versus the continuous predictor. Does anyone know how to get that out?

Thanks

$\endgroup$
  • $\begingroup$ You should post this on stackoverflow.com $\endgroup$ – danas.zuokas Jun 21 '12 at 10:18
  • 2
    $\begingroup$ Add some sample code to this question. Specify what packages you are using. There are multiple packages that allow GAM modelling in R. $\endgroup$ – John Jun 21 '12 at 11:13
  • $\begingroup$ perhaps the log odds is being plotted. $\endgroup$ – Macro Jun 21 '12 at 21:37
2
$\begingroup$

The individual plots are on the scale of the linear predictor, i.e. a scale that is -Inf to +Inf. The inverse of the link function is used to map from this scale to the 0, ..., 1 scale of the response. Further note that each smooth is subject to centring constraints and so is centred about 0.

$\endgroup$
3
$\begingroup$

What is being plotted is the log-odds. It's log(p/(1-p)). That's the space of the logistic regression. You can convert the values using the logistic distribution and the qlogis and plogis functions.

I don't know what GAM functions you're using but often times there are options to get the p-values out.

$\endgroup$
  • $\begingroup$ The predict function often has a variable type and for a logistic regression you could use type="response". $\endgroup$ – Wayne Jun 21 '12 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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