Skip to contents

Crosswalk cognitive measures

Usage

crosswalk(
  cog1,
  cog2,
  data,
  niter = NULL,
  condition_by = NULL,
  condition_loop = FALSE,
  control = NULL
)

est_cw_coef(cog1, cog2, data, method = "lm")

Arguments

cog1

The name of the first cognitive measure column

cog2

The name of the second cognitive measure column

data

A data.table, data.frame, matrix, or list containing the cognitive measure data

niter

Number of iterations to conduct for an unconditional split routine

condition_by

The name of a conditioning variable by which splits will be conducted. If not conducted, the function will use unconditional splits.

condition_loop

Whether to conduct conditional splitting sequentially. Defaults to FALSE to maximize speed. Unused if condition_by is NULL. See documentation for make_conditional_splits() for details.

control

A list of settings passed to bootstrap_crosswalk(). See boot_control() for more information.

method

Either 'lm' (recommended) or 'manual'. The former will fit a linear regression model and return the fit object, while the latter will return a table containing the covariance between the cognitive measures (cov), the variance of the measure input as cog1 (var), and the estimated sloped (coef).

Details

Unlike crosswalk(), which uses splitting to estimate the sample coefficient, est_cw_coef() calculates the coefficient based on summary statistics from the input data: cov(cog1, cog2) / var(cog1).