get_full_sample: Helper function for loop invariant calculations in binary...

Description Usage Arguments

View source: R/binary_search_mcr.r

Description

For general model classes, returns an augmented ("full") dataset, containing the original dataset, in addition to terms used to approximate or calculate e_switch. Warning: computational resources required are proportional to n times nrep_sample.

Usage

1
2
get_full_sample(y, X, p1, n = length(y), nrep_sample = 2, seed = 0,
  warn_dropped = TRUE)

Arguments

y

outcome vector

X

covariate matrix

p1

indeces for the variables to be switched

n

original sample size

nrep_sample

setting 'nrep_sample=2' corresponds to using e_divide to approximate e_switch. Increasing 'nrep_sample' further increases the number of terms used in the approximation of e_switch. If 'nrep_sample =n,' all permutations are returned.

seed

seed used for random permuations of the sample

warn_dropped

whether to give a warning if nrep_sample does not divide evenly into n. In this case, some number of observations (less than nrep_sample) will be dropped.


aaronjfisher/mcr documentation built on Jan. 2, 2020, 4:38 p.m.