Creates plot showing mean of Y variable across levels of a grouping variable,
with customizable error bars. Observations with missing values for y
and/or group
are dropped.
means_graph(y, group, error.bars = "t.ci", alpha = 0.05,
p.legend = TRUE, plot.list = NULL, lines.list = NULL,
axis.list = NULL, legend.list = NULL, ...)
Numeric vector of values for the continuous variable.
Vector of values indicating what group each y
observation
belongs to. Function plots group levels across x-axis in same order as
table(group)
.
Character string indicating what the error bars should
represent. Possible values are "sd"
for +/- one standard deviation,
"se"
for +/- one standard error, "t.ci"
for 95% confidence
interval based on t distribution, "z.ci"
for 95% confidence interval
based on Z distribution, and "none"
for no error bars.
Numeric value indicating what alpha should be set to for
confidence intervals. Only used if error.bars
is "t.ci"
or
"z.ci"
.
Optional list of inputs to pass to
plot
function.
Optional list of inputs to pass to
lines
function.
Optional list of inputs to pass to
axis
function.
Optional list of inputs to pass to
legend
function.
Plot showing mean of y
across levels of group
.