Perform a Linear Regression within the Discordant Kinship Framework
Source:R/func_discord_regression.R
discord_regression.Rd
Perform a Linear Regression within the Discordant Kinship Framework
Usage
discord_regression(
data,
outcome,
predictors,
demographics = NULL,
id = NULL,
sex = "sex",
race = "race",
pair_identifiers = c("_s1", "_s2"),
data_processed = FALSE,
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.
- 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".
- 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
- data_processed
Logical operator if data are already preprocessed by discord_data , default is FALSE
- 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".
Examples
discord_regression(
data = data_sample,
outcome = "height",
predictors = "weight",
pair_identifiers = c("_s1", "_s2"),
sex = NULL,
race = NULL
)
#>
#> Call:
#> stats::lm(formula = stats::as.formula(paste(realOutcome, preds,
#> sep = " ~ ")), data = preppedData)
#>
#> Coefficients:
#> (Intercept) height_mean weight_diff weight_mean
#> 0.624271 0.012577 0.323839 -0.005329
#>