jlm {jlme}R Documentation

Fit a (mixed-effects) regression model in Julia

Description

Fit a (mixed-effects) regression model in Julia

Usage

jlm(formula, data, family = "gaussian", contrasts = jl_contrasts(data), ...)

jlmer(
  formula,
  data,
  family = NULL,
  contrasts = jl_contrasts(data),
  ...,
  progress = interactive()
)

Arguments

formula

A formula written in Julia syntax. Can be a string or a language object.

data

A data frame

family

A distribution family

contrasts

A Julia dictionary of contrasts Inferred from data by default.

...

Additional arguments to the fit() function called in Julia

progress

Whether to print model fitting progress. Defaults to interactive()

Value

A julia model object of class jlme

Examples



jlme_setup(restart = TRUE)

# Fixed effects models
lm(mpg ~ hp, mtcars)
jlm(mpg ~ hp, mtcars)

# Auto-handling of contrasts
x <- mtcars
x$cyl_helm <- factor(x$cyl)
contrasts(x$cyl_helm) <- contr.helmert(3)
colnames(contrasts(x$cyl_helm)) <- c("4vs6", "4&6vs8")
lm(mpg ~ cyl_helm, x)
jlm(mpg ~ cyl_helm, x)

# Mixed effects models
library(lme4)

glmer(r2 ~ Anger + Gender + (1 | id), VerbAgg, family = "binomial")
jlmer(r2 ~ Anger + Gender + (1 | id), VerbAgg, family = "binomial")

stop_julia()



[Package jlme version 0.1.0 Index]