Welcome to ClientVPS Mirrors

statar

statar

Matthieu Gomez

2025-07-23

stat_binmean

stat_binmean() is a stat for ggplot2. It returns the mean of y and x within bins of x. It’s a bareborne version of the Stata command binscatter

ggplot(iris, aes(x = Sepal.Width , y = Sepal.Length)) + stat_binmean()

ggplot(iris, aes(x = Sepal.Width , y = Sepal.Length, color = Species)) + stat_binmean(n=10) 

Since stat_binmean is just a layer for ggplo2, you can surimpose any model fit

ggplot(iris, aes(x = Sepal.Width , y = Sepal.Length, color = Species)) + stat_binmean(n=10) + stat_smooth(method = "lm", se = FALSE)

Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.

This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.