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
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
IntegerVector recode_outcomes(IntegerVector x) { | |
int n = x.size(); | |
IntegerVector y(n); | |
for(int i=0; i<n; i++){ |
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
# produce balance statistics ------- | |
## version to pass unquoted | |
balance_stats_var <- function(data_, treatment_, variable_){ | |
treatment_ <- enquo(treatment_) | |
variable_ <- enquo(variable_) | |
temp_means <- group_by(data_, !!treatment_) %>% ## make it possible to change the 'treatment' var |
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
Mode <- function(x, tie = c("missing", "error"), ignore_categories = NULL) { | |
if(!is.null(ignore_categories)){ | |
x <- x[!(x %in% ignore_categories)] | |
} | |
NewerOlder