lme4

lme4 is a skill for Claude Code, Codex from LeoLin990405/r-analytics-skill. It costs 25 tokens per session (779 once invoked), scanned A, original, MIT.

An R package for fitting mixed-effects models, which represent both overall relationships and group-specific variation. It supports linear and generalized models for outcomes such as categories or counts.

In plain words
What is it for?
Use it to fit linear, logistic, Poisson, and negative-binomial mixed models, inspect group effects, calculate confidence intervals, and compare models.
Why use it?
It helps analyse grouped, repeated, nested, or crossed observations without treating every measurement as unrelated.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to fit linear, logistic, Poisson, and negative-binomial mixed models, inspect group effects, calculate confidence intervals, and compare models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leolin990405/r-analytics-skill/lme4
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeoLin990405/r-analytics-skill --skill lme4
Clone the repo
git clone --depth 1 https://github.com/LeoLin990405/r-analytics-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lme4

README.md
[![agentmods](https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/lme4/github.svg)](https://agentmods.dev/skills/leolin990405/r-analytics-skill/lme4)
Your own site
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/lme4"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/lme4/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lme4

Your own site · 80×15
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/lme4"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/lme4.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 779 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00779
Opus 5 $0.00013 $0.00390
Sonnet 5 $0.00005 $0.00156
Haiku 4.5 $0.00003 $0.00078

Measured 6d ago against content hash 5dbb62c343a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

lme4 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sub-skills/r-ml/r-ml-frameworks/lme4/SKILL.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

lme4

Linear mixed-effects models.

Linear Mixed Models

library(lme4)

# Random intercept
model <- lmer(y ~ x + (1 | group), data = df)

# Random intercept and slope
model <- lmer(y ~ x + (1 + x | group), data = df)

# Uncorrelated random effects
model <- lmer(y ~ x + (1 | group) + (0 + x | group), data = df)

# Multiple grouping factors
model <- lmer(y ~ x + (1 | group1) + (1 | group2), data = df)

# Nested groups
model <- lmer(y ~ x + (1 | group1/group2), data = df)

# Crossed random effects
model <- lmer(y ~ x + (1 | subject) + (1 | item), data = df)

Generalized Linear Mixed Models

# Logistic
model <- glmer(y ~ x + (1 | group), data = df, family = binomial)

# Poisson
model <- glmer(count ~ x + (1 | group), data = df, family = poisson)

# Negative binomial
library(MASS)
model <- glmer.nb(count ~ x + (1 | group), data = df)

Model Summary

# Summary
summary(model)

# Fixed effects
fixef(model)
coef(summary(model))

# Random effects
ranef(model)
VarCorr(model)

# Confidence intervals
confint(model)
confint(model, method = "boot", nsim = 1000)

Model Comparison

# Likelihood ratio test
model1 <- lmer(y ~ x + (1 | group), data = df)
model2 <- lmer(y ~ x + z + (1 | group), data = df)
anova(model1, model2)

# AIC/BIC
AIC(model1, model2)
BIC(model1, model2)

Predictions

# Predictions with random effects
predict(model)
predict(model, newdata = new_df)

# Predictions without random effects (population level)
predict(model, re.form = NA)

# Predictions for new groups
predict(model, newdata = new_df, allow.new.levels = TRUE)

Diagnostics

# Residuals
residuals(model)
residuals(model, type = "pearson")

# Fitted values
fitted(model)

# Influence measures
influence(model)

# Plot diagnostics
plot(model)
qqnorm(resid(model))

Bootstrapping

# Bootstrap confidence intervals
boot_ci <- confint(model, method = "boot", nsim = 500)

# Bootstrap predictions
bootMer(model, FUN = fixef, nsim = 100)

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 151 lines · 25 tokens per session scan A 5dbb62c343a7

Subscribe to this mod's changes

lme4 is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 5mo ago), licensed MIT. It adds 25 tokens to every session and 779 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

ai-science-diffusion-generative-models

Code DDPM/DDIM diffusion samplers, linear/cosine noise schedules, and DDRM inverse-problem solving (denoising, inpainting, super-resolution) in NumPy/PyTorch. Use for forward/reverse diffusion, score matching, or DDIM sampling.

Pavel-Kravchenko/Bioinformatics · 67 tokens

ai-science-esm2-embeddings

Generate ESM2 protein embeddings (fair-esm/transformers) and predict structure with ESMFold. Use when embedding sequences, scoring mutations zero-shot, annotating protein function, or doing fast MSA-free structure prediction.

Pavel-Kravchenko/Bioinformatics · 56 tokens

ai-science-geneformer-scgpt

Tokenize scRNA-seq via Geneformer gene-rank or scGPT expression-bin encoding; annotate cell types, simulate in-silico knockouts. Use for foundation-model cell annotation, Geneformer/scGPT tokenization, or perturbation prediction.

Pavel-Kravchenko/Bioinformatics · 60 tokens

ai-science-zero-shot-mutation

Score protein point mutations zero-shot with ESM-1v/ESM-2 masked-LM log-odds, ensembled, benchmarked on ProteinGym DMS. Use when predicting mutation effects, ranking missense variants, scoring VUS fitness with no labels.

Pavel-Kravchenko/Bioinformatics · 63 tokens

bio-applied-cancer-transcriptomics

Classify tumor RNA-seq into subtypes (melanoma Tirosh/Harbst on TCGA-SKCM): log1p/z-score, PCA/t-SNE, hierarchical clustering, random forest, Kaplan-Meier survival. Use when subtyping cBioPortal expression data.

Pavel-Kravchenko/Bioinformatics · 67 tokens

bio-applied-data-harmonization

Harmonize multi-omics data (RNA-seq, proteomics, methylation, metabolomics) before integration — per-layer normalization, KNN/half-minimum missing-value imputation, PCA/PVCA batch-effect detection, and ComBat correction with pandas/scikit-learn. Use when prepping matrices for MOFA2/DIABLO/mixOmics, fixing missing…

Pavel-Kravchenko/Bioinformatics · 106 tokens