-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added notes about unequally weighted obs
- Loading branch information
Showing
7 changed files
with
164 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(find_p_two_types) | ||
export(sens_analysis) | ||
export(sim_urn) | ||
importFrom(BiasedUrn,dFNCHypergeo) | ||
importFrom(stats,uniroot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Functions for drawing from urn models | ||
|
||
|
||
#' Simulate an urn model | ||
#' | ||
#' A function that allows the researcher to simulate draws from urn models that | ||
#' do not have nice analytical expressions. For example, urn models where each | ||
#' ball has a different probability of being drawn. Given a set of draws, we | ||
#' can calculate probabilities. | ||
#' | ||
#' | ||
#' @title Simulate draws from an urn model | ||
#' @param urn_size Total number of items in the urn | ||
#' @param total_obs An integer representing the total number of observations | ||
#' @param thep The p-value threshold | ||
#' @return A vector of length n | ||
#' @importFrom BiasedUrn dFNCHypergeo | ||
#' @importFrom stats uniroot | ||
#' @export | ||
|
||
sim_urn <- function(urn_size, total_obs, item_probs, thep) { | ||
res <- sample(x = distinct_items, prob = item_probs, replace = FALSE) | ||
return(the_draw) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters