util_margins_ord {dataquieR}R Documentation

Utility function to create a plot similar to the margins plots for ordinal variables

Description

This function is still under development. It uses the ordinal package to compute ordered regression models.

Usage

util_margins_ord(
  resp_vars = NULL,
  group_vars = NULL,
  co_vars = NULL,
  min_obs_in_subgroup = 5,
  min_subgroups = 5,
  ds1,
  label_col,
  adjusted_hint = "",
  title = "",
  sort_group_var_levels = getOption("dataquieR.acc_margins_sort",
    dataquieR.acc_margins_sort_default)
)

Arguments

resp_vars

variable the name of the ordinal measurement variable

group_vars

variable the name of the observer, device or reader variable

co_vars

variable list a vector of covariables, e.g. age and sex for adjustment

min_obs_in_subgroup

integer from=0. This optional argument specifies the minimum number of observations that is required to include a subgroup (level) of the group_var in the analysis.

min_subgroups

integer from=3. The model provided by the ordinal package requires at least three different subgroups (levels) of the group_var. Users might want to increase this threshold to obtain results only for variables with a sufficient number of group_var levels (observers, devices, etc.).

ds1

data.frame the data frame that contains the measurements, after replacing missing value codes by NA, excluding inadmissible values and transforming categorical variables to factors.

label_col

variable attribute the name of the column in the metadata with labels of variables

adjusted_hint

character hint, if adjusted for co_vars

title

character title for the plot

sort_group_var_levels

logical Should the levels of the grouping variable be sorted descending by the number of observations (in the figure)?

Value

A table and a matching plot.


[Package dataquieR version 2.5.1 Index]