Stefan Hansen
@stefanforfan.bsky.social
📤 185
📥 291
📝 77
Associate professor in biostatistics at Aarhus University
https://github.com/snhansen
pinned post!
I made a Shiny app to showcase the differences between using a linear fit, a categorical fit and a (restricted cubic) spline fit under various data generating mechanisms. The app is available at:
apps.biostat.au.dk/stefan/splin...
Feel free to use it in your teaching #rstats #datascience #statssky
over 2 years ago
0
29
10
reposted by
Stefan Hansen
Nick Tierney
6 days ago
I'd like to make positron look as much like RStudio as possible, do people have settings/configs that they feel approaches something like this?
#rstats
#positron
2
12
4
reposted by
Stefan Hansen
Totoro
19 days ago
Speaking of which, is there an R / Quarto flowchart drawing system which doesn't suck?
#Rstats
add a skeleton here at some point
4
1
1
reposted by
Stefan Hansen
Chris Kenny, PhD
23 days ago
I’m using wf:
christophertkenny.com/wf/
(Admittedly, I’m probably the only one using it because I wrote it)
loading . . .
Artificial Intelligence Workflow Tools
Manage skills for large language model coding agents. Supports installing skills from GitHub or local directories, tracking versions in a lock file, and keeping installations current. Installations ca...
https://christophertkenny.com/wf/
3
4
2
A nice piece on the challenges of teaching in the age of LLMs.
add a skeleton here at some point
about 1 month ago
0
0
0
reposted by
Stefan Hansen
Crystal Lewis
4 months ago
dplyr 1.2.0 was released last week and since I use {dplyr} a lot in my work, I wanted to take some time to try some of the new functions. This post provides some supplemental examples of the new functions, beyond what is provided in the new Posit materials.
#rstats
cghlewis.com/blog/dplyr_u...
loading . . .
Trying out dplyr 1.2.0 | Crystal Lewis
Updating existing dplyr code in my workflow with new dplyr updates
https://cghlewis.com/blog/dplyr_update/
4
86
31
reposted by
Stefan Hansen
James Balamuta
7 months ago
{ripper} dissects your
#Quarto
documents, extracting code blocks by language and leaving executable scripts behind. Supports
#rstats
,
#python
,
#julia
, and 13 other victims. For those who never stopped celebrating Halloween. 📚
quarto.thecoatlessprofessor.com/ripper/
💻
github.com/coatless-qua...
0
36
8
reposted by
Stefan Hansen
W. Joel Schneider
9 months ago
New web app to make apaquarto documents (APA style via Quarto)
wjschne.github.io/posts/2025-0...
Direct link:
wjschne.github.io/apa7maker/
#quarto
#QuartoPub
#rstats
loading . . .
W. Joel Schneider
Announcing a web app for creating apaquarto documents.
https://wjschne.github.io/posts/2025-09-05-apaquartoshiny/
0
3
2
reposted by
Stefan Hansen
Emil Hvitfeldt
10 months ago
Happy to announce ✨quarto-revealjs-editable✨ This fully supersedes the imagemover extension, as I back then didn't realize the potential. You can now also move, resize, change font size and alignment for text in your slides
github.com/EmilHvitfeld...
#quarto
#slidecrafting
loading . . .
10
116
44
Vibe-estimanding is my new favorite expression! A concise description of a widespread phenomenon in health science research.
add a skeleton here at some point
10 months ago
1
4
1
reposted by
Stefan Hansen
W. Joel Schneider
10 months ago
Now on CRAN, ggdiagram is a
#ggplot2
extension that draws diagrams programmatically in
#Rstats
. Allows for precise control in how objects, labels, and equations are placed in relation to each other.
wjschne.github.io/ggdiagram/ar...
10
181
83
Consider the following DAG where both exposure and frailty have positive effects on pregnancy (P) and healthy child (Y). Say, I'm interested in the effect of the exposure on having healthy children in my population.
#stats
#causalsky
#episky
#statsky
#causalinference
about 1 year ago
2
3
0
I've made my first R package {ciwidth}. It's nothing big, but it lets you calculate the sample size needed for obtaining a confidence interval for a mean or mean difference with a certain width with a given probability. Take a look here:
github.com/snhansen/ciw...
#rstats
#statssky
loading . . .
GitHub - snhansen/ciwidth: Sample size calculations based on confidence intervals
Sample size calculations based on confidence intervals - snhansen/ciwidth
https://github.com/snhansen/ciwidth
about 1 year ago
2
30
4
reposted by
Stefan Hansen
Julia M. Rohrer
about 1 year ago
I did update the figure a bit and added labels, but it probably works better as sequential slides in a presentation. If you want the code and the pptx just drop me a dm and I’ll send it all your way.
5
42
7
reposted by
Stefan Hansen
Chris Kenny, PhD
about 1 year ago
I've been playing with Quarto shortcodes, so here's a simple CV template that is easily customized using shortcodes and renders quickly/prettily using Typst:
github.com/christopherk...
0
5
2
reposted by
Stefan Hansen
Magdalena Janecka
over 1 year ago
Our new work shows the associations between maternal health in pregnancy and autism are attributable to familial confounding. Comprehensive atlas of these associations (>230 dx) + results from sibling comparisons + paternal negative control (DK >1.1M)
tinyurl.com/3y4kafu9
@naturemedicine.bsky.social
loading . . .
Familial confounding in the associations between maternal health and autism - Nature Medicine
Using national registry data from Denmark, 30 maternal diagnoses linked to offspring autism were identified with most associations attributable to family-level factors rather than direct causal effect...
https://tinyurl.com/3y4kafu9
2
3
1
We're already six days into this year's Advent of Code. This is my sixth year participating and I'm having a lot of fun. I'll be posting my crude Python solutions to my GitHub:
github.com/snhansen/adv...
Want to join, then go visit
adventofcode.com/2024
#adventofcode
#python
over 1 year ago
1
0
0
reposted by
Stefan Hansen
Eric Wastl
over 1 year ago
This was my tenth(!) year building 25 days of puzzles for
#AdventOfCode
. You can solve them all for free! Most people write code to solve them, but you can solve them however you like. I hope they help people become better programmers. 🌟 The first puzzle comes out in two hours:
adventofcode.com
loading . . .
Advent of Code 2024
https://adventofcode.com/
61
1123
229
reposted by
Stefan Hansen
Richard Riley (R²)
over 2 years ago
Here is a 1-page summary for your wall This talk is based on our Christmas article from 2022
t.co/y4GVFmTOfs
1
26
13
reposted by
Stefan Hansen
Jack Wilkinson
over 1 year ago
With respect, this suggests quite a serious misunderstanding about why we randomise. We do this to ensure imbalances are random. Our analyses treat them as such, and ensure valid inference. The problem here is with the idea that point estimates are useful, rather than with randomisation.
2
20
4
reposted by
Stefan Hansen
Quarto
over 1 year ago
Quarto 1.6 is out! 🎉 Download it here:
quarto.org/docs/download/
Quarto 1.6 supports unified branding across formats, updates to RevealJS, a new shortcode to reorder content, a landscape page block, and more. Blog post:
quarto.org/docs/blog/po...
loading . . .
Quarto 1.6 – Quarto
Quarto 1.6 supports unified branding across formats, updates to RevealJS, a new shortcode to reorder content, a landscape page block, and more. There are also a couple of breaking changes that will af...
https://quarto.org/docs/blog/posts/2024-11-25-1.6-release/
2
228
70
To new users and followers: Here's a Shiny app showing the differences between three ways of including a continuous covariate in linear regression models. Feel free to use it in your teaching or elsewhere!
#rstats
#datascience
#statssky
#stats
#epi
#episky
add a skeleton here at some point
over 1 year ago
1
29
9
reposted by
Stefan Hansen
Darren Dahly
over 1 year ago
In clinical research, you will often receive feedback on study design, stats, and/or data analysis from an editor or reviewer that is simply wrong. Here is a list of common "statistical myths" and references you can use to push back.
discourse.datamethods.org/t/reference-...
loading . . .
Reference Collection to push back against "Common Statistical Myths"
Note: This topic is a wiki, meaning that this main body of the topic can be edited by others. Use the Reply button only to post questions or comments about material contained in the body, or to sugge...
https://discourse.datamethods.org/t/reference-collection-to-push-back-against-common-statistical-myths/1787
47
379
184
With the recent influx of new users, I wanted to repost some of my Shiny apps that might be helpful to others. Feel free to use them in your teaching or other projects!
#rstats
#datascience
#stats
add a skeleton here at some point
over 1 year ago
0
9
2
reposted by
Stefan Hansen
Andrew Heiss
over 1 year ago
New blog post! I helped build Idaho's official election results website (with
#rstats
and
#quartopub
) and we did some neat stuff to auto-generate hundreds of R chunks. Here's a guide about how to create tabsets and slides programmatically with inline knitr chunks
www.andrewheiss.com/blog/2024/11...
10
186
53
reposted by
Stefan Hansen
Grant McDermott
almost 2 years ago
A few months ago, I gave a workshop on “(Pretty) big data wrangling with DuckDB and Polars”. Slides, notebooks etc. are all available here:
grantmcdermott.com/duckdb-polars/
#EconSky
2
92
25
reposted by
Stefan Hansen
Weverthon Machado
almost 2 years ago
📊When teaching or giving a talk, do you like presenting plots step by step, revealing e.g. one group at a time? This is often useful for walking through complex results. I made a R package that makes it extremely easy to do this! ggreveal: Reveal a ggplot incrementally
#rstats
#dataviz
#ggplot2
loading . . .
Reveal a ggplot incrementally
Provides functions that make it easy to reveal ggplot2 graphs incrementally. The functions take a ggplot2 object and return a list of plots showing data incrementally by panels, layers, groups, the va...
https://www.weverthon.com/ggreveal/
34
392
158
When converting RevealJS .html slides made with Quarto to .pdf using the {pagedown} package (or Chrome in general), code chunks are indented by a large margin. Is there a way to remove this indentation?
#rstats
#quartopub
about 2 years ago
1
1
1
reposted by
Stefan Hansen
John Holbein
about 2 years ago
Timeless
7
1363
249
What software do you use to make teaching videos? I'm looking for something simple that can capture my screen and overlay audio. Some editing capabilities would be nice. I've used Camtasia before, but not sure if there is something better out there.
#StatsSky
#EpiSky
over 2 years ago
7
3
1
reposted by
Stefan Hansen
Emil Hvitfeldt
over 2 years ago
New {paletteer} release dropped over the weekend! 159 color palettes have been added from vangogh, ButterflyColors, MoMAColors, PrettyCols, waRhol, MexBrewer, and ltc. Bringing the total to 2759 palettes from 75 different packages 🎨
#rstats
github.com/EmilHvitfeld...
1
69
30
reposted by
Stefan Hansen
Tim Morris
over 2 years ago
A meandering post, even for me, on rAnDoM cOnFoUnDiNg. Will probably regret the title but hey, there it is.
tpmorris.substack.com/p/oxymoronic...
2
5
3
reposted by
Stefan Hansen
Darren Dahly
over 2 years ago
On the uses and abuses of regression models: a call for reform of statistical practice and teaching
arxiv.org/abs/2309.06668
1
17
11
Is there an R equivalent of Stata's "ciwidth" command that accounts for sampling variability in the confidence interval?
#rstats
#statssky
over 2 years ago
2
0
1
I made a Shiny app to showcase the differences between using a linear fit, a categorical fit and a (restricted cubic) spline fit under various data generating mechanisms. The app is available at:
apps.biostat.au.dk/stefan/splin...
Feel free to use it in your teaching #rstats #datascience #statssky
over 2 years ago
0
29
10
My students often struggle with selection and measurement error bias in linear regression models, so I have made two Shiny apps to help visualize these concepts:
apps.biostat.au.dk/stefan/selec...
apps.biostat.au.dk/stefan/measu...
Feel free to use them in your teaching #rstats #datascience #stats
over 2 years ago
2
26
11
you reached the end!!
feeds!
log in