Skip to contents

Computes means by group and plots them in as a scatterplot

Usage

scatter_means_ci(
  variable1,
  variable2,
  group,
  data,
  plot = TRUE,
  print = TRUE,
  smooth.method = "lm",
  drop.groups = NULL
)

Arguments

variable1

Variable to plot on x axis

variable2

Variable to plot on y axis

group

Grouping variable

data

Data frame

plot

Logical. Should the plot be created?

print

Logical. Should the result be printed in the console?

smooth.method

Method for smoothing line. "lm" by default.

drop.groups

Vector of groups to be excluded from the analysis.

Details

Recommended to use with `with` function, as in example.

Examples

scatter_means_ci('alcfreq', 'HE', 'cntry', ESS, plot=T, print=TRUE)
#> Loading required package: ggrepel
#> Loading required package: ggplot2
#> Error: object 'ESS' not found