Learn R Programming

TriMatch (version 0.9.9)

loess3.plot: Loess plot for matched triplets.

Description

This function will create a ggplot2 figure with propensity scores on the x-axis and the outcome on the y-axis. Three Loess regression lines will be plotted based upon the propensity scores from model. Since each model produces propensity scores for two of the three groups, the propensity score for the third group in each matched triplet will be the mean of the other two. If model is not specified, the default will be to use the model that estimates the propensity scores for the first two groups in the matching order.

Usage

loess3.plot(tmatch, outcome, model, ylab = "Outcome",
  plot.connections = FALSE, connections.color = "black",
  connections.alpha = 0.2, plot.points = geom_point, points.alpha = 0.1,
  points.palette = "Dark2", ...)

Arguments

tmatch

the results of trimatch.

outcome

a vector representing the outcomes.

model

an integer between 1 and 3 indicating from which model the propensity scores will be used.

ylab

the label for the y-axis.

plot.connections

boolean indicating whether lines will be drawn connecting each matched triplet.

connections.color

the line color of connections.

connections.alpha

number between 0 and 1 representing the alpha levels for connection lines.

plot.points

a ggplot2 function for plotting points. Usually geom_point or geom_jitter. If NULL no points will be drawn.

points.alpha

number between 0 and 1 representing the alpha level for the points.

points.palette

the color palette to use. See scale_colour_brewer and http://colorbrewer2.org/ for more information.

...

other parameters passed to geom_smooth and stat_smooth.

Value

a ggplot2 figure.