mean_vs_mean: Piecewise linear functions based on means and medians

View source: R/mean_fun.R

mean_vs_meanR Documentation

Piecewise linear functions based on means and medians

Description

Approximate a linear fit by the line connecting the midpoints of the lower half of the data and the upper half of the data

Usage

mean_vs_mean(formula, data = parent.env(), stat_fun = mean)

Arguments

formula

a formula y ~ x

data

a data frame containing the variables in the formula

stat_fun

either mean or median or another function defining "midpoint"

Examples

mean_vs_mean(mpg ~ hp, data = mtcars)

dtkaplan/SDSdata documentation built on June 28, 2022, 8:09 a.m.