Skip to contents

Compare Score with a Benchmark

Usage

benchmark_score(
  data,
  column,
  benchmark,
  mean,
  sd,
  n,
  tail = "one",
  remove_missing = TRUE,
  input = "long",
  output = "console"
)

Arguments

data

dataframe

column

a column of scores from the dataframe

benchmark

benchmark

mean

if input = "values", enter mean value

sd

if input = "values", enter standard deviation value

n

if input = "values", enter total number of scores

tail

one-tailed or two-tailed test

remove_missing

TRUE/FALSE (Default is TRUE)

input

Default: "long" - long form of data, "values" to pass values directly. If using this option, must specify mean, sd, and n.

output

Default: "console" - prints output in console and returns tibble invisibly.

Value

dataframe of results when saved to an object. show console output by default

Examples

scores <- 80 + 23 * scale(rnorm(172)) # 80 = mean, 23 = sd
data <- data.frame(scores = scores)
benchmark_score(data, scores, 67)
#> 
#> ── Compare Score with a Benchmark ──────────────────────────────────────────────
#> We can be 100% confident that the true score is between 67 and 93
#>   term                    result  
#>   mean                        80  
#>   sd                          23  
#>   se                    1.753734  
#>   n                          172  
#>   df                         171  
#>   probability       2.732705e-12  
#>   tail                       one  
#>   confidence                   1  
#>   margin_of_error             13  
#>   t                     7.412757  
#>   lower_ci                    67  
#>   upper_ci                    93  
data |> benchmark_score(scores, 67)
#> 
#> ── Compare Score with a Benchmark ──────────────────────────────────────────────
#> We can be 100% confident that the true score is between 67 and 93
#>   term                    result  
#>   mean                        80  
#>   sd                          23  
#>   se                    1.753734  
#>   n                          172  
#>   df                         171  
#>   probability       2.732705e-12  
#>   tail                       one  
#>   confidence                   1  
#>   margin_of_error             13  
#>   t                     7.412757  
#>   lower_ci                    67  
#>   upper_ci                    93  
benchmark_score(mean = 80, sd = 23, n = 172, benchmark = 67, input = "values")
#> 
#> ── Compare Score with a Benchmark ──────────────────────────────────────────────
#> We can be 100% confident that the true score is between 67 and 93
#>   term                    result  
#>   mean                        80  
#>   sd                          23  
#>   se                    1.753734  
#>   n                          172  
#>   df                         171  
#>   probability       2.732705e-12  
#>   tail                       one  
#>   confidence                   1  
#>   margin_of_error             13  
#>   t                     7.412757  
#>   lower_ci                    67  
#>   upper_ci                    93