bar_plot | R Documentation |
Generate a bar plot for flagging percentage.
bar_plot(
flag_df,
group_num = 4,
bar_colors = c("#66c2a5", "#fc8d62", "#8da0cb"),
bar_width = 0.7,
label_color = "black",
label_size = 4
)
flag_df |
a data frame from |
group_num |
number of groups into which providers are divided based on their sample sizes. The default is 4. |
bar_colors |
a vector of colors used to fill the bars representing the categories. The default is c("#66c2a5", "#fc8d62", "#8da0cb"). |
bar_width |
width of the bars in the bar chart. The default is 0.7. |
label_color |
color of the text labels inside the bars. The default is "black". |
label_size |
size of the text labels inside the bars. The default is 4. |
This function generates a bar chart to visualize the percentage of flagging results based on provider sizes.
The input data frame test_df
must be the output from package pprof
's test
function.
Providers are grouped into a specified number of groups (group_num
) based on their sample sizes, where
the number of providers are approximately equal across groups. An additional "overall" group is
included to show the flagging results across all providers.
A ggplot object representing the bar chart of flagging results.
test.linear_fe
, test.linear_re
, test.logis_fe
data(ExampleDataLinear)
outcome <- ExampleDataLinear$Y
covar <- ExampleDataLinear$Z
ID <- ExampleDataLinear$ID
fit_linear <- linear_fe(Y = outcome, Z = covar, ID = ID)
test_linear <- test(fit_linear)
bar_plot(test_linear)
data(ExampleDataBinary)
fit_logis <- logis_fe(Y = ExampleDataBinary$Y,
Z = ExampleDataBinary$Z,
ID = ExampleDataBinary$ID, message = FALSE)
test_logis <- test(fit_logis)
bar_plot(test_logis)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.