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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>tinytable_c80pijf8rq8f225cdrn6</title> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<script type="text/x-mathjax-config"> |
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
# Downloads data here: | |
# https://academic.oup.com/ije/article/49/5/1719/5835351#226179197 | |
############################################################################# | |
# TRIAL EMULATION: SURGERY WITHIN 6 MONTHS AMONG OLDER LUNG CANCER PATIENTS | |
# Author: Clemence Leyrat (from Camille Maringe's Stata code) | |
# Refactored by Vincent Arel-Bundock on 2023-12-08 |
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
# Example of examining a continuous x categorical interaction using emmeans, | |
# and an attempt at doing the same using marginaleffects. | |
# Author: Cameron Patrick <[email protected]> | |
library(tidyverse) | |
library(emmeans) | |
library(marginaleffects) | |
# use the mtcars data, set up am as a factor | |
data(mtcars) |
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
``` r | |
library(marginaleffects) | |
library(modelsummary) | |
set.seed(20220722) | |
S <- diag(3) | |
S[1,2] <- S[2,1] <- 0.6 | |
S[1,3] <- S[3,1] <- 0.6 | |
data <- MASS::mvrnorm(1000, rep(0, 3), S) |> | |
as.data.frame() |> |
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
library(fixest) | |
library(data.table) | |
library(insight) | |
bboot_vab <- function(model, reps = 1e3, conf.level = .95, cluster = NULL) { | |
data <- insight::get_data(model) | |
setDT(data) | |
if (!is.null(cluster)) { | |
if (anyNA(data[[cluster]])) { | |
stop("The cluster variable cannot include missing values.") |
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
# French Accents | |
name: french-finnish-accents | |
parent: default | |
matches: | |
- trigger: "e''" | |
replace: "é" | |
- trigger: "e``" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
library(rdrobust) | |
library(modelsummary) | |
tidy.rdrobust <- function(object, ...){ | |
ret <- data.frame(term = row.names(object$coef), | |
estimate = object$coef[, 1], | |
std.error = object$se[, 1], | |
statistic = object$z[, 1], | |
p.value = object$pv[, 1], | |
conf.low = object$ci[,1], |
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
library(data.table) | |
library(tidyverse) | |
library(microbenchmark) | |
make_tibble <- function(...) { | |
treated_units <- sample(1:20000, 4000) | |
# year fixed effects | |
year <- tibble( | |
year = 1981:2010, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder