plot.linear_fe: Get funnel plot from a fitted 'linear_fe' object for...

View source: R/plot.linear_fe.R

plot.linear_feR Documentation

Get funnel plot from a fitted linear_fe object for institutional comparisons

Description

Creates a funnel plot from a linear fixed effect model to compare provider performance.

Usage

## S3 method for class 'linear_fe'
plot(
  x,
  null = "median",
  target = 0,
  alpha = 0.05,
  labels = c("lower", "expected", "higher"),
  point_colors = c("#E69F00", "#56B4E9", "#009E73"),
  point_shapes = c(15, 17, 19),
  point_size = 2,
  point_alpha = 0.8,
  line_size = 0.8,
  target_line_type = "longdash",
  ...
)

Arguments

x

a model fitted from linear_fe.

null

a character string or a number specifying null hypotheses of fixed provider effects. The default is "median".

target

a numeric value representing the target outcome. The default value is 0.

alpha

a number or a vector of significance levels. The default is 0.05.

labels

a vector of labels for the plot.

point_colors

a vector of colors representing different provider flags. The default is c("#E69F00", "#56B4E9", "#009E73").

point_shapes

a vector of shapes representing different provider flags. The default is c(15, 17, 19).

point_size

size of the points. The default is 2.

point_alpha

transparency level of the points. The default is 0.8.

line_size

size of all lines, including control limits and the target line. The default is 0.8.

target_line_type

line type for the target line. The default is "longdash".

...

additional arguments that can be passed to the function.

Details

This function generates a funnel plot from a linear fixed effect model. Currently, it only supports the indirect standardized difference. The parameter alpha is a vector used to calculate control limits at different significance levels. The first value in the vector is used as the significance level for flagging each provider, utilizing the test.linear_fe function.

Value

A ggplot object representing the funnel plot.

See Also

linear_fe, linear_fe, linear_fe

Examples

data(ExampleDataLinear)
outcome <- ExampleDataLinear$Y
covar <- ExampleDataLinear$Z
ID <- ExampleDataLinear$ID
fit_fe <- linear_fe(Y = outcome, Z = covar, ID = ID)
plot(fit_fe)


pprof documentation built on April 12, 2025, 1:33 a.m.