plot_repsd {repsd}R Documentation

REPSD Null vs Observed Histogram

Description

REPSD Null vs Observed Histogram

Usage

plot_repsd(repsd_values, null_values, pvalues, which_item, bins = 30)

Arguments

repsd_values

A numerical vector of repsd values, the output of repsd()$repsd_each_item.

null_values

A matrix of the repsd null distribution, the output of null_repsd().

pvalues

A numerical vector of the repds p-values, the output of repsd_pval()$p.value

which_item

A numerical indicator of the specific item to plot.

bins

A numerical indicator on the number of bins to output in the histogram.

Value

A plot of the REPSD null distribution for the indicated item with the observed REPSD value as a red line and the observed p-value

Examples

example_repsd <-
    repsd()
example_null <-
    null_repsd(iterations = 100)
example_pvals <-
    repsd_pval(
               alpha = .05,
               null_dist = example_null,
               items_repsd = example_repsd$repsd_each_item
               )
# Only one plot
plot_repsd(repsd_values = example_repsd$repsd_each_item,
           null_values = example_null,
           pvalues = example_pvals$p.value,
           which_item = 18,
           bins = 10)
# Multiple plots on the same plot
oldpar <- par()
par(mfrow = c(2,2))
for (i in c(1,8,16,18)) {
  plot_repsd(
             repsd_values = example_repsd$repsd_each_item,
             null_values = example_null,
             pvalues = example_pvals$p.value,
             which_item = 18,
             bins = 10
             )
}
par(mfrow = oldpar$mfrow)

[Package repsd version 1.0.1 Index]