Skip to contents

Calculate Item Discrimination Index of Moodle Grade Report (see Details).

Usage

item_discrim(
  data,
  cor_method = c("pearson", "kendall", "spearman"),
  conf.level = 0.95
)

Arguments

data

(GradesReport) A data frame of class "GradesReport"

cor_method

(Character) A character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman", can be abbreviated.

conf.level

(Numeric) Confidence level for the returned confidence interval. Currently only used for the Pearson product moment correlation coefficient if there are at least 4 complete pairs of observations.

Value

A data frame of Item Discrimination Index for each questions.

Details

Item discrimination index (r) is a measure of how well an item is able to distinguish between examinees who are knowledgeable and those who are not. It is a pairwise point-biserial correlation between the score of each questions ("Q" columns) and total score of the quiz ("Grade" column).

item_discrim() calculate the correlation by stats::cor.test() function using Pearson's correlation coefficient (by default), then summarize each parameters into a data frame by broom::tidy(). Different types of correlation can be specified by cor_method argument.

References

Examples

library(moodleStats)
# Prepare
grades_df_preped <- prep_grades_report(grades_df)

# Calculate
item_discrim(grades_df_preped)
#> # A tibble: 9 × 10
#>   Questions estimate statistic  p.value parameter conf.low conf.high method     
#>   <chr>        <dbl>     <dbl>    <dbl>     <int>    <dbl>     <dbl> <chr>      
#> 1 Q1           0.434      7.89 7.44e-14       269    0.332     0.526 Pearson's …
#> 2 Q2           0.452      8.28 6.15e-15       267    0.351     0.542 Pearson's …
#> 3 Q3           0.600     12.2  1.48e-27       266    0.517     0.671 Pearson's …
#> 4 Q4           0.510      9.68 3.52e-19       267    0.415     0.593 Pearson's …
#> 5 Q5           0.675     14.9  4.13e-37       267    0.604     0.735 Pearson's …
#> 6 Q6           0.646     13.8  3.26e-33       267    0.571     0.711 Pearson's …
#> 7 Q7           0.554     10.9  4.86e-23       267    0.465     0.632 Pearson's …
#> 8 Q8           0.640     13.6  3.59e-32       265    0.563     0.706 Pearson's …
#> 9 Q9           0.597     12.2  1.81e-27       268    0.514     0.669 Pearson's …
#> # … with 2 more variables: alternative <chr>, p.signif <chr>