util_margins_nom {dataquieR}R Documentation

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

Description

This function is still under development. It uses the nnet package to compute multinomial logistic regression models.

Usage

util_margins_nom(
  resp_vars = NULL,
  group_vars = NULL,
  co_vars = NULL,
  min_obs_in_subgroup = 5,
  min_obs_in_cat = 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 nominal 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_obs_in_cat

integer This optional argument specifies the minimum number of observations that is required to include a category (level) of the outcome (resp_vars) in the analysis.

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]