jglmm: Fitting Generalized Linear Mixed-Effects Models in Julia

View source: R/fit.R

jglmmR Documentation

Fitting Generalized Linear Mixed-Effects Models in Julia

Description

Fitting Generalized Linear Mixed-Effects Models in Julia

Usage

jglmm(
  formula,
  data,
  family = "normal",
  link = NULL,
  weights = NULL,
  contrasts = NULL,
  REML = FALSE
)

## S3 method for class 'jglmm'
print(x, ...)

## S3 method for class 'jglmm'
summary(object, ...)

Arguments

formula

A two-sided linear formula object describing both the fixed-effects and random-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. Random-effects terms are distinguished by vertical bars ("|") separating expressions for design matrices from grouping factors.

data

A data frame containing the variables named in formula.

family

(optional) The distribution family for the response variable (defaults to "normal").

link

(optional) The model link function (defaults to "identity").

weights

(optional) A vector of prior case weights.

contrasts

(optional) A named list mapping column names of categorical variables in data to coding schemes (defaults to dummy coding all categorical variables).

REML

(optional) A logical indicating whether REML should be used instead of maximum likelihood (defaults to FALSE).

x

An object of class 'jglmm', as returned by 'jglmm()'.

...

Optional additional arguments, currently none are used.

object

An object of class 'jglmm', as returned by 'jglmm()'.

Value

An object of class 'jglmm'.

Examples

## Not run: 
jglmm_setup()
# linear model
lm1 <- jglmm(Reaction ~ Days + (Days | Subject), lme4::sleepstudy)

# logistic model
cbpp <- dplyr::mutate(lme4::cbpp, prop = incidence / size)
gm1 <- jglmm(prop ~ period + (1 | herd), data = cbpp, family = "binomial",
             weights = cbpp$size)
gm2 <- jglmm(prop ~ period + (1 | herd), data = cbpp, family = "binomial",
             weights = cbpp$size, contrasts = list(period = "effects"))

## End(Not run)

mikabr/jglmm documentation built on Nov. 18, 2022, 1:32 a.m.