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(glmmTMB) | |
library(ggeffects) | |
data("Salamanders") | |
m1 <- glmmTMB( | |
count ~ mined + (1 | site), | |
zi = ~ mined, | |
family = poisson, | |
data = Salamanders | |
) |
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(parameters) | |
library(performance) | |
library(ggplot2) | |
set.seed(123) | |
x <- 3 + rnorm(200) | |
y <- 4 + .5 * x + rnorm(100) | |
dat <- data.frame(x, y) | |
ggplot(dat, aes(x, y)) + |
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
# Second Generation P-value | |
p_delta <- function(lb, ub, delta_lb, delta_ub) { | |
# special case: infinite CI and H0 bounds in the same direction | |
if ((delta_lb == -Inf & lb == -Inf) | (delta_ub == Inf & ub == Inf)) { | |
return(1) | |
} | |
# usual case: non-point CI & non-point Ho |
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
See https://twitter.com/malte_grosser/status/1262862749794795520?s=20 | |
``` r | |
table2 <- function(x) { | |
x_u <- if (is.factor(x)) sort(x[!duplicated(x)]) else sort(unique(x)) | |
x_f <- factor(x, levels = as.character((x_u)), exclude = NULL) | |
t_x_f <- tabulate(x_f) | |
names(t_x_f) <- as.character(x_u) | |
t_x_f | |
} |
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(tidyverse) | |
library(parameters) | |
library(lme4) | |
library(see) | |
# data generation ----------------------- | |
set.seed(123) | |
n <- 5 | |
b <- seq(1, 1.5, length.out = 5) |
NewerOlder