Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-17 Thread Brian Diggs
On 4/17/2014 5:44 AM, Michael Friendly wrote: I know I can do that. My example was just a toy version of a more complex graph I generate on the logit scale, and save as gg. I wanted to know if there was a way to transform it to the probability scale by using gg + coord_trans() with some suitabl

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-17 Thread Michael Friendly
I know I can do that. My example was just a toy version of a more complex graph I generate on the logit scale, and save as gg. I wanted to know if there was a way to transform it to the probability scale by using gg + coord_trans() with some suitable argument(s) for example, this *does* work

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-17 Thread ONKELINX, Thierry
Dear Michael, You can use geom_smooth directly. ggplot(pred, aes(x = Age, y = Better)) + geom_smooth(method = "glm", family = binomial) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-16 Thread Tim Marcella
Sorry I jumped the gun. That does not provide you with the same plot as gg2 that you are aiming for. -T On Wed, Apr 16, 2014 at 7:37 PM, Tim Marcella wrote: > I think all you have to do is add type="response" to your call for the > predictions. > > Does this work for you > > # get fitted value

Re: [R] ggplot2: using coord_trans for logit -> probability

2014-04-16 Thread Tim Marcella
I think all you have to do is add type="response" to your call for the predictions. Does this work for you # get fitted values on the logit scale pred <- data.frame(Arthritis, predict(arth.logistic, se.fit=TRUE,type="response")) library(ggplot2) library(scales) # plot on logit