Skip to content

Instantly share code, notes, and snippets.

View strengejacke's full-sized avatar
⁉️
Focusing

Daniel strengejacke

⁉️
Focusing
View GitHub Profile
@strengejacke
strengejacke / intersectional.R
Created June 9, 2023 06:13
Example for building intersectional strata
easystats::install_latest(force= TRUE)
library(datawizard) # data wrangling and preparation
library(parameters) # model summaries
library(glmmTMB) # multilevel modelling
# sample data set
data(efc, package = "ggeffects")
efc <- efc |>
# numeric to factors, set labels as levels
library(easystats)
library(palmerpenguins)
library(lme4)
library(ggplot2)
# data generation -----------------------
data(penguins)
d <- penguins |>
@strengejacke
strengejacke / gist:bd14a299a806d5e2d03347d5c274a7f9
Created May 6, 2024 06:14
Compile R Report (HTML/PDF/Word file from R scripts)
#' ---
#' title: "Compile Report"
#' author: ""
#' date: ""
#' ---
#' Comments that are to be displayed as normal text are marked with `#'`
#' at the beginning of the line. Comments that are to be displayed as
#' code are marked with `#` at the beginning of the line.
@strengejacke
strengejacke / Positron-Setup
Last active August 2, 2025 07:11
Positron-Setup
Positron Version: 2025.09.0 (system setup) build 5
Code - OSS Version: 1.102.0
Commit: df4dfe533fe81e0f3191fcf60bbf5f588411a1ad
Date: 2025-08-01T04:07:02.449Z
Electron: 35.6.0
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Windows_NT x64 10.0.26100
@strengejacke
strengejacke / gist:8c1ad0d82f962b6842ca141ea4625200
Last active March 13, 2025 17:03
Modelling Within-Subject Variation in psychological trials with Reaction Times
library(easystats)
set.seed(1234)
n <- 100
baseline <- rnorm(n, 5, 1.5)
d <- data.frame(
RT1 = rnorm(n, baseline, 0.5),
RT2 = rnorm(n, baseline, 0.5),
RT3 = rnorm(n, baseline, 0.5),
RT4 = rnorm(n, baseline, 0.5),
@strengejacke
strengejacke / gist:4ccb47dab2c97d3bb48b7805122b1e88
Last active July 22, 2025 14:54
`tinyplot` methods for _modelbased_
Replicates plots from this vignette:
https://easystats.github.io/modelbased/articles/plotting.html
Not working
m <- lm(neg_c_7 ~ c12hour * barthtot * c160age, data = efc)
# gpplot2 version
estimate_means(m, c("c12hour", "barthtot", "c160age")) |> plot()
## FIXME not working yet
estimate_means(m, c("c12hour", "barthtot", "c160age")) |> plt()