Skip to content

Commit

Permalink
Minor edits to documentation
Browse files Browse the repository at this point in the history
- edits to conText documentation
  • Loading branch information
prodriguezsosa committed Aug 12, 2023
1 parent c8c31fb commit 72deca8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions R/conText.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
#' @inheritParams dem
#' @param bootstrap (logical) if TRUE, use bootstrapping -- sample from texts with replacement and
#' re-run regression on each sample.
#' @param num_bootstraps (numeric) number of bootstraps to use (at least 100)
#' @param num_bootstraps (numeric) number of bootstraps to use (at least 100). Ignored if bootstrap = FALSE.
##' @param stratify (logical) if TRUE, stratify by discrete covariates when bootstrapping.
#' @param jackknife (logical) if TRUE, jackknife debiasing is implemented.
#' @param jackknife (logical) if TRUE (default), jackknife (leave one out) debiasing is implemented.
#' Implies n resamples.
#' @param confidence_level (numeric in (0,1)) confidence level e.g. 0.95
#' @param permute (logical) if TRUE, compute empirical p-values using permutation test
#' @param num_permutations (numeric) number of permutations to use
Expand Down Expand Up @@ -85,7 +86,7 @@ conText <- function(formula, data, pre_trained, transform = TRUE, transform_matr
if(confidence_level >= 1 || confidence_level<=0) stop('"confidence_level" must be a numeric value between 0 and 1.', call. = FALSE) # check confidence level is between 0 and 1
if((bootstrap || jackknife) && (confidence_level >= 1 || confidence_level<=0)) stop('"confidence_level" must be a numeric value between 0 and 1.', call. = FALSE) # check confidence level is between 0 and 1
if(bootstrap && num_bootstraps < 100) stop('num_bootstraps must be at least 100') # check num_bootstraps >= 100
if(jackknife && bootstrap) stop("must either implement bootstrap or Jackknife (set one to TRUE, the other to FALSE), or neither (set both to FALSE), can't implement both simultaneously.") # check num_bootstraps >= 100
if(jackknife && bootstrap) stop("implement bootstrap or jackknife (set one to TRUE, the other to FALSE), or neither (set both to FALSE), can't implement both simultaneously.") # check num_bootstraps >= 100

# extract dependent variable
target <- as.character(formula[[2]])
Expand Down
5 changes: 3 additions & 2 deletions man/conText.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 72deca8

Please sign in to comment.