Description Usage Arguments Details Value Author(s) See Also
decode_ethnorace
formats both the RACE_CODES
and ETHNIC_CODES
fields by
evaluating two scalar values or vectors of values of equal length containing
race and ethnicity codes. Missing values for both race and ethnicity, as well
as missing race codes and ethnicity of 1
, are converted to Not Reported
.
In instances where more than one race or ethnicity is evaluated, the value is
labeled Two or More Races
.
1 | decode_ethnorace(race, ethnicity, ethnic.precedence = TRUE)
|
race |
A scalar or vector of length n and class character comprised of
race codes, e.g. |
ethnicity |
A scalar or vector of length n and class character or numeric
that contain an ethnicity code, i.e. |
ethnic.precedence |
A logical value indicating whether ethnicity takes
precedence over one or more races. As |
Output may be made categorical using function
factor
or as.factor
. This function also allows for easily
tallying counts using, e.g., function table
.
Ethnicity codes other than 1
or 2
are coerced to NA
(missing) rather
than converted to Not Reported
. Likewise, unrecognized race codes are
coerced to NA
(missing) values rather than Not Reported
. In both instances,
a warning is thrown.
In instances were race codes are detected in argument ethnicity =
or
ethnicity codes are detected in argument race =
, evaluation is halted and
an error is thrown.
A scalar or vector of values of length n and class character containing a single label describing the combined race and ethnicity code.
NULL
values are converted into the character string: Not Reported
.
Jamison R. Crawford, Institutional Research Associate, Georgia State University
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.