This is from
https://github.com/R-Computing-Lab/discord/blob/74323b2cdd739355cd4a388251c747f1bcd87eb5/R/discord_data.R
and is legacy code used to restructure wide form, double-entered data, into
analyzable data sorted by outcome. This can be used in discord_regression_legacy
.
discord_data_legacy(
outcome,
predictors = NULL,
doubleentered = TRUE,
sep = "",
scale = FALSE,
df = NULL,
id = NULL,
full = TRUE,
...
)
Returns data.frame
with the following variables:
id
outcome for kin1; kin1 is always greater than kin2, except when tied. Then kin1 is randomly selected from the pair
outcome for kin2
difference between outcome of kin1 and kin2
mean outcome for kin1 and kin2
predictor variable i for kin1
predictor variable i for kin2
difference between predictor i of kin1 and kin2
mean predictor i for kin1 and kin2
Name of outcome variable
Names of predictors.
Describes whether data are double entered. Default is FALSE.
The character in df
that separates root outcome and predictors from mean and diff labels character string to separate the names of the predictors
and outcome
s from kin identifier (1 or 2). Not NA_character_
.
If TRUE, rescale all variables at the individual level to have a mean of 0 and a SD of 1.
dataframe with all variables in it.
id variable (optional).
If TRUE, returns kin1 and kin2 scores in addition to diff and mean scores. If FALSE, only returns diff and mean scores.
Optional pass on additional inputs.