Hello,

How do I plot a gam fit object on probability (Y axis) vs raw values (X
axis) axis and include the confidence plot lines?

Details...

I'm using the gam function like this:
l_yx[,2] = log(l_yx[,2] + .0004)
fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial)

And I want to plot it so that probability is on the Y axis and values are
on the X axis (i.e. I don't want log likelihood on the Y axis or the log of
my values on my X axis):

xx <- seq(min(l_yx[,2]),max(l_yx[,2]),len=101)
plot(xx,predict(fit,data.frame(x=xx),type="response"),type="l",xaxt="n",xlab="Churn",ylab="P(Top
Performer)")
at <- c(.001,.01,.1,1,10)  # <-------------- I'd also like to generalize
this rather than hard code the numbers
axis(1,at=log(at+ .0004),label=at)

So far, using the code above, everything looks the way I want. But that
does not give me anything information on variability/confidence/certainty.
How do I get the dash plots from this:
plot(fit)
...on the same scales as above?

Related question: how do get the dashed values out of the fit object so I
can do 'stuff' with it?

Thanks,

Ben

PS - thank you Patrick for your help previously.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to