process_prespecified: Obtain quantiles for prespecified variables

process_prespecifiedR Documentation

Obtain quantiles for prespecified variables

Description

Obtain quantiles for prespecified variables

Usage

process_prespecified(
  dat,
  prespec,
  cond = TRUE,
  nlevs = 5,
  cor_thresh = 0.25,
  tol = sqrt(.Machine$double.eps)
)

Arguments

dat

data frame containing variables

prespec

character vector of prespecified variables in dat

cond

logical: should conditional quantiles be estimated?

nlevs

maximum number of levels for 'discrete' variable

cor_thresh

threshold for when linear regression should be used to model dependence

tol

tolerance for similarity of ranks for applying uniform noise

Details

Currently takes the rank of each entry, and subtracts 1/2 and normalizes by the number of entries. If there are k ties they are randomly sorted with a uniform random variable in the symmetric interval around the rank of width k/n.

nlevs is used to classify discrete vs continuous variables. If a variable has more than this number of distinct values, it is considered to be continuous. cor_thresh is used to determine when the correlation is small enough that it need not be modelled.


rje42/causl documentation built on June 1, 2025, 2:50 p.m.