hsquared

Lifecycle: experimental R-CMD-check

R interface · Julia engine · a twin, not a port

How much is genetic?

Formula first. The engine returns heritability, variance components, and breeding values on the routes that are covered — experimental 0.9.0 release, not production. CRAN availability is tracked separately.

Get started Choose a model Fit a model

Before you report anything

Warning — experimental 0.9.0 release. Not production. CRAN availability is tracked separately. There are 7 R-public covered routes; fitting needs local Julia and an HSquared.jl checkout. Julia engine-covered ≠ R-public covered. Report point estimates only within a covered route. No interval is nominally coverage-calibrated; named univariate pedigree intervals are only classified as directional-conservative. See Can I fit and report this?.

Your first analysis

  1. 1. Get started
    Install or validate a first animal-model formula.
  2. 2. Choose a model
    Check the route scope before fitting.
  3. 3. Fit
    Run the smallest honest workflow.
  4. 4. Diagnose
    Read fit diagnostics before extracting results.
  5. 5. Report
    Use route-scoped point estimates only.

Start here

If you want to… Read this
check a formula without installing Julia Getting started (control = hs_control(engine = "validate"))
decide whether a number may go in a paper Can I fit and report this?
see the seven R-public covered routes Model status
set up the Julia engine Installation
look up a function Reference
understand evidence history without mistaking it for a release Progression & evidence

Quick start — no Julia required

This four-animal pedigree is a syntax demo, not a number for a paper.

library(hsquared)

ped <- data.frame(
  id   = c("sire", "dam", "off1", "off2"),
  sire = c(NA, NA, "sire", "sire"),
  dam  = c(NA, NA, "dam", "dam")
)
dat <- data.frame(
  id     = c("sire", "dam", "off1", "off2"),
  sex    = c("m", "f", "m", "f"),
  weight = c(42, 38, 40, 37)
)

hsquared(
  weight ~ sex + animal(1 | id, pedigree = ped),
  data = dat,
  control = hs_control(engine = "validate")
)

Fitting — requires the Julia engine

With a local Julia, JuliaCall, and an HSquared.jl checkout (see Installation):

fit <- hsquared(
  weight ~ sex + animal(1 | id, pedigree = ped),
  data = dat
)
summary(fit)

Report only what Can I fit and report this? allows for the route you ran.

Installation

# install.packages("remotes")
remotes::install_github("itchyshin/hsquared")

Fitting also needs Julia, JuliaCall, and a local HSquared.jl tree. HSquared is not in the Julia General registry — do not use Pkg.add("HSquared") by name.

install.packages("JuliaCall")

Clone or point at your HSquared.jl checkout per the getting-started guide.

Authors

Shinichi Nakagawa (ORCID 0000-0002-7765-5182, itchyshin@gmail.com), Yefeng Yang (ORCID 0000-0002-8610-4016), Szymon Drobniak (ORCID 0000-0001-8101-6247).

Twin

hsquared is the applied R interface. HSquared.jl is the sparse engine. A twin, not a port.