somers.mer: Somers' Dxy Rank Correlation and Concordance Index C

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/somers.mer.R

Description

Computes Somers' Dxy rank correlation between a variable x and a binary (0-1) variable y, and the corresponding receiver operating characteristic curve area c. Note that Dxy = 2(c - 0.5). somers allows for a weights variable, which specifies frequencies to associate with each observation.

Usage

1
2
3
4
somers.mer(x, ...)
## Default S3 method:
somers.mer(x, weights = NULL, normwt = FALSE,
	na.rm = TRUE)

Arguments

x

a object of class lmerMod or glmerMod.

weights

a numeric vector of observation weights (usually frequencies). Omit or specify a zero-length vector to do an unweighted analysis.

normwt

logical. Should weights sum to the actual number of non-missing observations?

na.rm

logical. Should missing data be removed?

Details

An adaptation of somers2 from package Hmisc for use with mixed models from the lme4 package. Note that the additional vector of outcomes is not necessary in this version.

Value

A vector with the named elements C, Dxy, n (number of non-missing pairs), and Missing. Uses the formula C = (mean(rank(x)[y == 1]) - (n1 + 1)/2)/(n - n1), where n1 is the frequency of y = 1.

Author(s)

F. Harrell, J. Grafmiller

See Also

somers2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run:
data(brown_genitives)

require(lme4)
require(languageR)

genitive.glmm = glmer(Type ~ PossrAnimacyBin +
   PossrWordC + Genre + (1|Text), data = brown_genitives,
   family = binomial, control = glmerControl(optimizer = "bobyqa"))

somers.mer(genitive.glmm)
## End(Not run)

jasongraf1/JGmermod documentation built on May 24, 2019, 9:54 p.m.