Skip to contents

boxplots show range of scores here vs range in US overall

Usage

boxplots_ratios(
  x,
  selected_dvar_colname = varlist2names("names_d")[1],
  selected_dvar_nicename = selected_dvar_colname,
  towhat_nicename = "US average",
  wheretext = "Near"
)

Arguments

x

data.frame that is the output of ejscreen analysis, for example:

x <- ejscreenit(testpoints_5)$table

x <- testoutput_ejscreenapi_plus_5

selected_dvar_colname

default is "Demog.Index"

selected_dvar_nicename

default is "Demog.Index"

towhat_nicename

default is "US average"

wheretext

Use in plot subtitle. Default is "Near" but could be "Within 5km of" for example. If it is a number, n, it will set wheretext to "Within n miles of"

Value

same format as output of ggplot2::ggplot()

Details

See plot_boxplot_pctiles() now espec. for percentiles.

This function originally was used for ejscreenit() output, and was just a quick interim solution that could be replaced.

To communicate whether this is skewed to the right (more high scores than might expect) also could say that X% OF SITES OR PEOPLE have scores in top Y% of US range, >= 100-Y percentile. e.g., 20% of these sites have scores at least in the top 5% of US scores (which is more/less than one might expect

  • leaving aside statistical significance ie whether this could be by chance if sites were randomly picked from US block groups or people's bg scores)

Examples

  # x <- testoutput_ejscreenit_50$table # or
  x <- testoutput_ejscreenapi_plus_5
  myradius <- x$radius.miles[1]
  boxplots_ratios(calc_ratios_to_avg(x)$ratios_d, wheretext = myradius)
  #boxplots_ratios(calc_ratios_to_avg(x)$ratios_e, wheretext = myradius)