Skip to contents

Re-exported functions for interacting with Julia model objects

Usage

propertynames(x)

issingular(x)

likelihoodratiotest(x, ...)

Arguments

x

Julia model object

...

Additional arguments passed to the Julia function

Value

An appropriate R or Julia object

Examples

# \donttest{
jlme_setup(restart = TRUE)
#> Starting Julia (v1.10.5) ...
#> Successfully set up Julia connection.

x <- jlmer(r2 ~ Anger + (1 | id), lme4::VerbAgg, family = "binomial")

# `propertynames()` lists properties accessible via `$`
propertynames(x)
#>  [1] "A"         "L"         "LMM"       "PCA"       "X"         "b"        
#>  [7] "beta"      "coef"      "corr"      "lowerbd"   "objective" "rePCA"    
#> [13] "resp"      "sigma"     "theta"     "u"         "vcov"      "wt"       
#> [19] "y"         "β"         "θ"         "λ"         "σ"         "σs"       
#> [25] "σρs"      

# `issingular()` reports whether model has singular fit
issingular(x)
#> [1] FALSE

# `likelihoodratiotest()` conducts a likelihood-ratio test between nested models
likelihoodratiotest(
  x,
  jlmer(r2 ~ 1 + (1 | id), lme4::VerbAgg, family = "binomial")
)
#> <Julia object of type MixedModels.LikelihoodRatioTest>
#> Model Formulae
#> 1: r2 ~ 1 + (1 | id)
#> 2: r2 ~ 1 + Anger + (1 | id)
#> ──────────────────────────────────────────────────
#>      model-dof   deviance       χ²  χ²-dof  P(>χ²)
#> ──────────────────────────────────────────────────
#> [1]          2  9510.5478                         
#> [2]          3  9499.3324  11.2154       1  0.0008
#> ──────────────────────────────────────────────────

stop_julia()
# }