Re: [R] ggplot2 stat_smooth formula different units

2020-11-11 Thread David Winsemius
On 11/11/20 2:11 PM, Marcelo Laia wrote: Hi, I am running these approaches: Model 1 ggplot( dat , aes(x=DAP, y=Altura, color=as.factor(Espacamento) )) + geom_point(size=0.5) + stat_smooth(method = "lm", formula = y ~ x + I(x^2), size = 1) + facet_grid(Espacame

Re: [R] ggplot2 stat_smooth formula different units

2020-11-11 Thread Marcelo Laia
Hi Rui, You are very welcome! On 11/11/20 at 11:10, Rui Barradas wrote: > > dput(head(dat, 20)) > structure(list(Bloco = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), Espacamento = c("3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1",

Re: [R] ggplot2 stat_smooth formula different units

2020-11-11 Thread Rui Barradas
Hello, Try removing I() from I(log(y)). But it's hard to say without a reproducible example, please post the output of dput(dat) or, if dat is big, the output of dput(head(dat, 20)) Hope this helps, Rui Barradas Às 22:11 de 11/11/20, Marcelo Laia escreveu: Hi, I am running these approa

[R] ggplot2 stat_smooth formula different units

2020-11-11 Thread Marcelo Laia
Hi, I am running these approaches: Model 1 ggplot( dat , aes(x=DAP, y=Altura, color=as.factor(Espacamento) )) + geom_point(size=0.5) + stat_smooth(method = "lm", formula = y ~ x + I(x^2), size = 1) + facet_grid(Espacamento ~ Clone) + theme(legend.position="none")

Re: [R] ggplot2 stat_smooth

2016-06-29 Thread Nathan Pace
help@r-project.org" Subject: Re: [R] ggplot2 stat_smooth > >> On Jun 29, 2016, at 2:17 PM, Nathan Pace wrote: >> >> I want to add a logistic plot to data. >> >> My call to ggplot is: >> >> >> ggplot(data = SSI.dt, aes(x = elapsed,

Re: [R] ggplot2 stat_smooth

2016-06-29 Thread David Winsemius
> On Jun 29, 2016, at 2:17 PM, Nathan Pace wrote: > > I want to add a logistic plot to data. > > My call to ggplot is: > > > ggplot(data = SSI.dt, aes(x = elapsed, y = 1 - control)) + geom_point() + > stat_smooth(method = 'glm', family = binomial) + > xlab('Surgery Duration (min)') + ylab('Pr

[R] ggplot2 stat_smooth

2016-06-29 Thread Nathan Pace
I want to add a logistic plot to data. My call to ggplot is: ggplot(data = SSI.dt, aes(x = elapsed, y = 1 - control)) + geom_point() + stat_smooth(method = 'glm', family = binomial) + xlab('Surgery Duration (min)') + ylab('Probability SSI') + labs(title = 'THA Surgical Site Infections') ggsave(f

Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula

2013-12-17 Thread ONKELINX, Thierry
, Thierry Van: Michael Friendly [frien...@yorku.ca] Verzonden: dinsdag 17 december 2013 19:42 Aan: ONKELINX, Thierry; R-help Onderwerp: Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula Thanks very much for this helpful reply, Thierry Using aes(wei

Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula

2013-12-17 Thread Michael Friendly
rry -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Michael Friendly Verzonden: dinsdag 17 december 2013 14:58 Aan: R-help Onderwerp: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula With ggplot2, I can plot the g

Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula

2013-12-17 Thread ONKELINX, Thierry
, Thierry -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Michael Friendly Verzonden: dinsdag 17 december 2013 14:58 Aan: R-help Onderwerp: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula With ggplot2, I can plot the

[R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula

2013-12-17 Thread Michael Friendly
With ggplot2, I can plot the glm stat_smooth for binomial data when the response is binary or a two-level factor as follows: data("Donner", package="vcdExtra") ggplot(Donner, aes(age, survived)) + geom_point(position = position_jitter(height = 0.02, width = 0)) + stat_smooth(method = "glm", fami