vignettes/discord_regression.Rmd
discord_regression.Rmd
This vignette describes how to restructure data for comparing kin. The function that takes care of this is discord_regression
which provides a dynamic framework for determining differences between kinship pairs on a measured outcome (behavior) given a set of predictors, returning the model coefficients in a tidy manner using the broom package.
Below, we describe the theory behind the discordant-kinship model and show Examples of how this works with data downloaded from the National Longitudinal Survey of Youth (NLSY) 1979, though this could be done with any data containing kin pairs.
This section describes the theory of the discordant kinship model but is not necessary to successfully utilize the
discord
package.
The core of the discordant kinship model can be explained with a simplistic case where a behavioral outcome \(Y\) is predicted by one variable \(X\), the discord regression model relates the difference in that outcome, \(Y_{i\Delta}\), for a given kinship pair, indexed as \(i\), in the following model, where \(X_{i\Delta}\) is the difference in the predictor.
\(\mathrm{Y_{i\Delta}} = \beta_{0} + \beta_{1}\mathrm{\bar{Y_{i}}} + \beta_{2}\mathrm{\bar{X_{i}}} + \beta_{3}\mathrm{X_{i\Delta}}\)
where,
\(\mathrm{Y_{i\Delta}} = \mathrm{Y_{i,1}} - \mathrm{Y_{i,2}}\)
\(\mathrm{X_{i\Delta}} = \mathrm{X_{i,1}} - \mathrm{X_{i,2}}\)
and \(1\) and \(2\) identify the individuals within the kinship pair, defined by
\(\mathrm{Y_{i,1}} > \mathrm{Y_{i,2}}\)
\(\mathrm{X_{i,1}} > \mathrm{X_{i,2}}\)