discord_data: Restructure Data to Determine Kinship Differences

View source: R/func_discord_data.R

discord_dataR Documentation

Restructure Data to Determine Kinship Differences

Description

Restructure Data to Determine Kinship Differences

Usage

discord_data(
  data,
  outcome,
  predictors,
  id = NULL,
  sex = "sex",
  race = "race",
  pair_identifiers,
  demographics = "both",
  coding_method = "none"
)

Arguments

data

The data set with kinship pairs

outcome

A character string containing the outcome variable of interest.

predictors

A character vector containing the column names for predicting the outcome.

id

Default's to NULL. If supplied, must specify the column name corresponding to unique kinship pair identifiers.

sex

A character string for the sex column name.

race

A character string for the race column name.

pair_identifiers

A character vector of length two that contains the variable identifier for each kinship pair

demographics

Indicator variable for if the data has the sex and race demographics. If both are present (default, and recommended), value should be "both". Other options include "sex", "race", or "none".

coding_method

A character string that indicates what kind of additional coding schemes should be used. Default is none. Other options include "binary" and "multi".

Value

A data frame that contains analyzable, paired data for performing kinship regressions.

Examples


discord_data(
  data = data_sample,
  outcome = "height",
  predictors = "weight",
  pair_identifiers = c("_s1", "_s2"),
  sex = NULL,
  race = NULL,
  demographics = "none"
)


discord documentation built on April 12, 2025, 1:12 a.m.