From b5adffe455edc607e6750130c11b8de093d6db61 Mon Sep 17 00:00:00 2001 From: Clara Bicalho Date: Tue, 21 Aug 2018 18:09:34 +0200 Subject: [PATCH] Build updates --- man/block_cluster_two_arm_designer.Rd | 6 +++--- man/cluster_sampling_designer.Rd | 19 +++++++++++-------- man/multi_arm_designer.Rd | 12 ++++++------ man/pretest_posttest_designer.Rd | 4 ++-- man/randomized_response_designer.Rd | 6 +++--- man/regression_discontinuity_designer.Rd | 4 ++-- man/simple_spillover_designer.Rd | 8 ++++---- man/simple_two_arm_designer.Rd | 4 ++-- man/two_arm_attrition_designer.Rd | 2 +- 9 files changed, 34 insertions(+), 31 deletions(-) diff --git a/man/block_cluster_two_arm_designer.Rd b/man/block_cluster_two_arm_designer.Rd index 15900e72..5e050055 100644 --- a/man/block_cluster_two_arm_designer.Rd +++ b/man/block_cluster_two_arm_designer.Rd @@ -33,7 +33,7 @@ block_cluster_two_arm_designer(N_blocks = 1, N_clusters_in_block = 100, \item{ate}{A number. Average treatment effect. Alternative to specifying \code{treatment_mean}. Note that \code{ate} is an argument for the designer but it does not appear as an argument in design code (design code uses \code{control_mean} and \code{treatment_mean} only).} -\item{treatment_mean}{A number. Average outcome in treatment. If \code{treatment_mean} is not provided then it is calculated from \code{ate}. If both \code{ate} and \code{treatment_mean} are provided then only \code{treatment_mean} is used.} +\item{treatment_mean}{A number. Average outcome in treatment. If \code{treatment_mean} is not provided then it is calculated as \code{control_mean + ate}. If both \code{ate} and \code{treatment_mean} are provided then only \code{treatment_mean} is used.} } \value{ A block cluster two-arm design. @@ -45,12 +45,12 @@ Builds a two-arm design with blocks and clusters. Units are assigned to treatment using complete block cluster random assignment. Treatment effects can be specified either by providing \code{control_mean} and \code{treatment_mean} or by specifying an \code{ate}. Estimation uses differences in means accounting for blocks and clusters. -Total N is given by \code{N_blocks*N_clusters_in_block*N_i_in_cluster} +Total N is given by \code{N_blocks*N_clusters_in_block*N_i_in_cluster}. Normal shocks can be specified at the individual, cluster, and block levels. If individual level shocks are not specified and cluster and block level variances sum to less than 1, then individual level shocks are set such that total variance in outcomes equals 1. -Key limitations: The designer assumes covariance between potential outcomes at individual level only. +Key limitations: The designer assumes covariance between potential outcomes at the individual level only. See \href{https://declaredesign.org/library/articles/block_cluster_two_arm.html}{vignette online}. } diff --git a/man/cluster_sampling_designer.Rd b/man/cluster_sampling_designer.Rd index 4cab1f39..ae9d5767 100644 --- a/man/cluster_sampling_designer.Rd +++ b/man/cluster_sampling_designer.Rd @@ -4,25 +4,28 @@ \alias{cluster_sampling_designer} \title{Create a design for cluster random sampling} \usage{ -cluster_sampling_designer(N_clusters = 1000, N_i_in_cluster = 50, - n_clusters = 100, n_i_in_cluster = 10, icc = 0.2) +cluster_sampling_designer(N_blocks = 1, N_clusters_in_block = 1000, + N_i_in_cluster = 50, n_clusters_in_block = 100, + n_i_in_cluster = 10, icc = 0.2) } \arguments{ -\item{N_clusters}{An integer. Total number of clusters in the population.} +\item{N_blocks}{An integer. Number of blocks. Defaults to 1 for no blocks.} -\item{N_i_in_cluster}{An integer of vector of integers of length \code{N_clusters}. Total number of subjects per cluster in the population.} +\item{N_clusters_in_block}{An integer. Total number of clusters in the population.} -\item{n_clusters}{An integer. Number of clusters to sample.} +\item{N_i_in_cluster}{An integer of vector of integers of length \code{N_clusters_in_block}. Total number of subjects per cluster in the population.} \item{n_i_in_cluster}{An integer. Number of subjects to sample per cluster.} \item{icc}{A number in [0,1]. Intra-cluster Correlation Coefficient (ICC).} + +\item{N_clusters_in_block}{An integer. Number of clusters to sample.} } \value{ A cluster sampling design. } \description{ -Builds a cluster sampling design of a population with \code{N_clusters} containing \code{N_i_in_cluster}. Estimations sample \code{n_clusters} each comprising \code{n_i_in_cluster} units. Outcomes within clusters have ICC approximately equal to \code{ICC}. +Builds a cluster sampling design of a population with \code{N_blocks}, \code{N_clusters_in_block} containing \code{N_i_in_cluster}. Estimations sample \code{N_clusters_in_block} each comprising \code{n_i_in_cluster} units. Outcomes within clusters have ICC approximately equal to \code{ICC}. } \details{ Key limitations: The design assumes clusters draw with equal probability (rather than, for example, proportionate to size). @@ -34,8 +37,8 @@ See \href{https://declaredesign.org/library/articles/cluster_sampling.html}{vign cluster_sampling_design <- cluster_sampling_designer() # A design with varying cluster size cluster_sampling_design <- cluster_sampling_designer( - N_clusters = 10, N_i_in_cluster = 3:12, - n_clusters = 5, n_i_in_cluster = 2) + N_clusters_in_block = 10, N_i_in_cluster = 3:12, + n_clusters_in_block = 5, n_i_in_cluster = 2) } \author{ \href{https://declaredesign.org/}{DeclareDesign Team} diff --git a/man/multi_arm_designer.Rd b/man/multi_arm_designer.Rd index e2c0655b..b26e172b 100644 --- a/man/multi_arm_designer.Rd +++ b/man/multi_arm_designer.Rd @@ -15,19 +15,19 @@ multi_arm_designer(N = 30, m_arms = 3, outcome_means = rep(0, \item{outcome_means}{A numeric vector of length \code{m_arms}. Average outcome in each arm.} -\item{sd}{A nonnegative scalar. Standard deviations for shock for each unit (common across arms).} +\item{sd}{A nonnegative scalar. Standard deviation of individual-level shock (common across arms).} -\item{outcome_sds}{A nonnegative numeric vector of length \code{m_arms}. Standard deviations for additional shock for each unit for each of the arms.} +\item{outcome_sds}{A nonnegative numeric vector of length \code{m_arms}. Standard deviations for condition-level shocks.} -\item{conditions}{A vector of length \code{m_arms}. The names of each arm. It can be numeric or a character without blank spaces.} +\item{conditions}{A vector of length \code{m_arms}. The names of each arm. It can be given as numeric or character class (without blank spaces).} -\item{fixed}{A character vector. Names of arguments to be fixed in design. By default \code{m_arms} and \code{conditions} are always fixed.} +\item{fixed}{A character vector. Names of arguments to be fixed in design. By default, \code{m_arms} and \code{conditions} are always fixed.} } \value{ A function that returns a design. } \description{ -This designer creates a design \code{m_arms} experimental arms, each assigned with equal probabilities. +Creates a design with \code{m_arms} experimental arms, each assigned with equal probability. } \details{ See \href{https://declaredesign.org/library/articles/multi_arm.html}{vignette online}. @@ -39,7 +39,7 @@ design <- multi_arm_designer() # A design with different mean and sd in each arm -design <- multi_arm_designer(outcome_means = c(0, 0.5, 2), sd = c(1, 0.1, 0.5)) +design <- multi_arm_designer(outcome_means = c(0, 0.5, 2), outcome_sds = c(1, 0.1, 0.5)) design <- multi_arm_designer(N = 80, m_arms = 4, outcome_means = 1:4, fixed = c("outcome_means", "outcome_sds")) diff --git a/man/pretest_posttest_designer.Rd b/man/pretest_posttest_designer.Rd index 3c8a3456..47239d72 100644 --- a/man/pretest_posttest_designer.Rd +++ b/man/pretest_posttest_designer.Rd @@ -12,9 +12,9 @@ pretest_posttest_designer(N = 100, ate = 0.25, sd_1 = 1, sd_2 = 1, \item{ate}{A number. Average treatment effect.} -\item{sd_1}{Non negative number. Standard deviation of period 1 shocks.} +\item{sd_1}{Nonnegative number. Standard deviation of period 1 shocks.} -\item{sd_2}{Non negative number. Standard deviation of period 2 shocks.} +\item{sd_2}{Nonnegative number. Standard deviation of period 2 shocks.} \item{rho}{A number in [-1,1]. Correlation in outcomes between pre- and post-test.} diff --git a/man/randomized_response_designer.Rd b/man/randomized_response_designer.Rd index 24450b15..31364f00 100644 --- a/man/randomized_response_designer.Rd +++ b/man/randomized_response_designer.Rd @@ -10,11 +10,11 @@ randomized_response_designer(N = 1000, prob_forced_yes = 0.6, \arguments{ \item{N}{An integer. Size of sample.} -\item{prob_forced_yes}{A number. Probability of a forced yes.} +\item{prob_forced_yes}{A number in [0,1]. Probability of a forced yes.} -\item{prevalence_rate}{A number. Probability that individual has the sensitive trait.} +\item{prevalence_rate}{A number in [0,1]. Probability that individual has the sensitive trait.} -\item{withholding_rate}{A number. Probability that an individual with the sensitive trait hides it.} +\item{withholding_rate}{A number in [0,1]. Probability that an individual with the sensitive trait hides it.} } \value{ A randomized response design. diff --git a/man/regression_discontinuity_designer.Rd b/man/regression_discontinuity_designer.Rd index 30d71606..b2e598c4 100644 --- a/man/regression_discontinuity_designer.Rd +++ b/man/regression_discontinuity_designer.Rd @@ -14,9 +14,9 @@ regression_discontinuity_designer(N = 1000, tau = 0.15, cutoff = 0.5, \item{cutoff}{A number in (0,1). Threshold on running variable beyond which units are treated.} -\item{bandwidth}{A number. Bandwidth around threshold from which to include units.} +\item{bandwidth}{A number. The value of the bandwidth on both sides of the threshold from which to include units.} -\item{poly_order}{A number greater or equal to 1. Order of the polynomial regression used to estimate the jump at the cutoff.} +\item{poly_order}{A number greater than or equal to 1. Order of the polynomial regression used to estimate the jump at the cutoff.} } \value{ A regression discontinuity design. diff --git a/man/simple_spillover_designer.Rd b/man/simple_spillover_designer.Rd index 96c9c8dc..ff570e3c 100644 --- a/man/simple_spillover_designer.Rd +++ b/man/simple_spillover_designer.Rd @@ -12,9 +12,9 @@ simple_spillover_designer(N_groups = 80, N_i_group = 3, sd = 0.2, \item{N_i_group}{Number of units in each group. Can be scalar or vector of length \code{N_groups}.} -\item{sd}{A number. Standard deviation of individual level shock.} +\item{sd}{A nonnegative number. Standard deviation of individual-level shock.} -\item{gamma}{A number. Parameter that controls whether spillovers within groups substitute or complement each other.} +\item{gamma}{A number. Parameter that controls whether spillovers within groups substitute or complement each other. See `Details`.} } \value{ A simple spillover design. @@ -25,8 +25,8 @@ Potential outcomes exhibit spillovers: if any individual in a group receives tre the effect is spread equally among members of the group. } \details{ -Parameter \code{gamma} controls interactions between spillover effects.For \code{gamma}=1 for ever $1 given to a member of a group, each member receives $1\code{N_i_group} no matter how many others are already treated. -For \code{gamma}>1 (<1) for ever $1 given to a member of a group, each member receives an amount that depends negatively (positively) on the number already treated. +Parameter \code{gamma} controls interactions between spillover effects.For \code{gamma}=1 for every $1 given to a member of a group, each member receives $1\code{N_i_group} no matter how many others are already treated. +For \code{gamma}>1 (<1) for every $1 given to a member of a group, each member receives an amount that depends negatively (positively) on the number already treated. The default estimand is the average difference across subjects between no one treated and only that subject treated. diff --git a/man/simple_two_arm_designer.Rd b/man/simple_two_arm_designer.Rd index 4ce9791f..274383c3 100644 --- a/man/simple_two_arm_designer.Rd +++ b/man/simple_two_arm_designer.Rd @@ -31,10 +31,10 @@ A simple two-arm design. \description{ Builds a design with one treatment and one control arm. Treatment effects can be specified either by providing \code{control_mean} and \code{treatment_mean} -or by specifying an \code{ate}. +or by specifying a \code{control_mean} and \code{ate}. } \details{ -Units are assigned to treatment using complete random assignment. Potential outcomes follow a normal distribution. +Units are assigned to treatment using complete random assignment. Potential outcomes are normally distributed according to the mean and sd arguments. See \href{https://declaredesign.org/library/articles/simple_two_arm.html}{vignette online}. } diff --git a/man/two_arm_attrition_designer.Rd b/man/two_arm_attrition_designer.Rd index 7998d500..9ed46744 100644 --- a/man/two_arm_attrition_designer.Rd +++ b/man/two_arm_attrition_designer.Rd @@ -24,7 +24,7 @@ two_arm_attrition_designer(N = 100, a_R = 0, b_R = 1, a_Y = 0, A post-treatment design. } \description{ -Creates a two arm design with application for when estimand of interest is conditional on a post treatment outcome +Creates a two-arm design with application for when estimand of interest is conditional on a post-treatment outcome (the effect on Y given R) or data is conditionally observed (Y given R). See `Details` for more information on the data generating process. } \details{