Skip to content

glmmrBase

Generalised Linear Mixed Models in R

v1.3.0 · Mar 31, 2026 · GPL (>= 2)

Description

Specification, analysis, simulation, and fitting of generalised linear mixed models. Includes Markov Chain Monte Carlo Maximum likelihood model fitting for a range of models, non-linear fixed effect specifications, a wide range of flexible covariance functions that can be combined arbitrarily, robust and bias-corrected standard error estimation, power calculation, data simulation, and more.

Downloads

718

Last 30 days

5114th

2.2K

Last 90 days

7.7K

Last year

Trend: +16% (30d vs prior 30d)

CRAN Check Status

2 ERROR
2 NOTE
10 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 NOTE
r-oldrel-macos-x86_64 ERROR
r-oldrel-windows-x86_64 NOTE
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 ERROR
r-release-windows-x86_64 OK
Check details (8 non-OK)
NOTE r-oldrel-macos-arm64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
NOTE r-oldrel-macos-arm64

installed package size

installed size is 170.2Mb
  sub-directories of 1Mb or more:
    libs  168.9Mb
ERROR r-oldrel-macos-x86_64

examples

Running examples in ‘glmmrBase-Ex.R’ failed
The error most likely occurred in:

> ### Name: Model
> ### Title: A GLMM Model
> ### Aliases: Model
> 
> ### ** Examples
> 
> 
> ## ------------------------------------------------
> ## Method `Model$new`
> ## ------------------------------------------------
> 
> ## Don't show: 
> setParallel(FALSE) 
> ## End(Don't show)
> # For more examples, see the examples for MCML.
> 
> #create a data frame describing a cross-sectional parallel cluster
> #randomised trial
> df <- nelder(~(cl(10)*t(5)) > ind(10))
> df$int <- 0
> df[df$cl > 5, 'int'] <- 1
> mod <- Model$new(
+   formula = ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   data = df,
+   family = stats::gaussian()
+ )
> 
> # We can also include the outcome data in the model initialisation. 
> # For example, simulating data and creating a new object:
> df$y <- mod$sim_data()
> 
> mod <- Model$new(
+   formula = y ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   data = df,
+   fami
...[truncated]...
numeric(Orange$Tree)
> ##D 
> ##D # Here we can specify the model as a function. 
> ##D 
> ##D model <- Model$new(
> ##D   circumference ~ Asym/(1 + exp((xmid - (age))/scal)) - 1 + (Asym|gr(Tree)),
> ##D   data = Orange,
> ##D   family = gaussian(),
> ##D   mean = c(200,725,350),
> ##D   covariance = c(500),
> ##D   var_par = 50
> ##D )
> ##D 
> ##D # for this example, we will use MCEM with adaptive MCMC sample sizes
> ##D 
> ##D nfit <- model$MCML(method = "mcem.adapt", iter.sampling = 1000)
> ##D 
> ##D summary(nfit)
> ##D summary(nm1)
> ##D 
> ##D 
> ## End(Not run)
> 
> ## ------------------------------------------------
> ## Method `Model$fit`
> ## ------------------------------------------------
> 
> # Simulated trial data example using REML
> data(SimTrial,package = "glmmrBase")
> fit1 <- Model$new(
+   formula = y ~ int + factor(t) - 1 + (1|grlog(cl)*ar0log(t)),
+   data = SimTrial,
+   family = gaussian()
+ )$fit(reml = TRUE)
Error: Exponent fail: nan^1.000000
Execution halted
NOTE r-oldrel-macos-x86_64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 179.8Mb
  sub-directories of 1Mb or more:
    libs  178.6Mb
NOTE r-oldrel-windows-x86_64

for GNU extensions in Makefiles

GNU make is a SystemRequirements.
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.7Mb
  sub-directories of 1Mb or more:
    libs   4.5Mb
ERROR r-release-macos-x86_64

examples

Running examples in ‘glmmrBase-Ex.R’ failed
The error most likely occurred in:

> ### Name: Model
> ### Title: A GLMM Model
> ### Aliases: Model
> 
> ### ** Examples
> 
> 
> ## ------------------------------------------------
> ## Method `Model$new`
> ## ------------------------------------------------
> 
> ## Don't show: 
> setParallel(FALSE) 
> ## End(Don't show)
> # For more examples, see the examples for MCML.
> 
> #create a data frame describing a cross-sectional parallel cluster
> #randomised trial
> df <- nelder(~(cl(10)*t(5)) > ind(10))
> df$int <- 0
> df[df$cl > 5, 'int'] <- 1
> mod <- Model$new(
+   formula = ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   data = df,
+   family = stats::gaussian()
+ )
> 
> # We can also include the outcome data in the model initialisation. 
> # For example, simulating data and creating a new object:
> df$y <- mod$sim_data()
> 
> mod <- Model$new(
+   formula = y ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   data = df,
+   fami
...[truncated]...
numeric(Orange$Tree)
> ##D 
> ##D # Here we can specify the model as a function. 
> ##D 
> ##D model <- Model$new(
> ##D   circumference ~ Asym/(1 + exp((xmid - (age))/scal)) - 1 + (Asym|gr(Tree)),
> ##D   data = Orange,
> ##D   family = gaussian(),
> ##D   mean = c(200,725,350),
> ##D   covariance = c(500),
> ##D   var_par = 50
> ##D )
> ##D 
> ##D # for this example, we will use MCEM with adaptive MCMC sample sizes
> ##D 
> ##D nfit <- model$MCML(method = "mcem.adapt", iter.sampling = 1000)
> ##D 
> ##D summary(nfit)
> ##D summary(nm1)
> ##D 
> ##D 
> ## End(Not run)
> 
> ## ------------------------------------------------
> ## Method `Model$fit`
> ## ------------------------------------------------
> 
> # Simulated trial data example using REML
> data(SimTrial,package = "glmmrBase")
> fit1 <- Model$new(
+   formula = y ~ int + factor(t) - 1 + (1|grlog(cl)*ar0log(t)),
+   data = SimTrial,
+   family = gaussian()
+ )$fit(reml = TRUE)
Error: Exponent fail: nan^1.000000
Execution halted

Check History

ERROR 10 OK · 2 NOTE · 0 WARNING · 2 ERROR · 0 FAILURE Apr 1, 2026
ERROR r-release-macos-x86_64

examples

Running examples in ‘glmmrBase-Ex.R’ failed
The error most likely occurred in:

> ### Name: Model
> ### Title: A GLMM Model
> ### Aliases: Model
> 
> ### ** Examples
> 
> 
> ## ------------------------------------------------
> ## Method `Model$new`

...[truncated]...
ng REML
> data(SimTrial,package = "glmmrBase")
> fit1 <- Model$new(
+   formula = y ~ int + factor(t) - 1 + (1|grlog(cl)*ar0log(t)),
+   data = SimTrial,
+   family = gaussian()
+ )$fit(reml = TRUE)
Error: Exponent fail: nan^1.000000
Execution halted
NOTE r-oldrel-macos-arm64

installed package size

installed size is 170.2Mb
  sub-directories of 1Mb or more:
    libs  168.9Mb
ERROR r-oldrel-macos-x86_64

installed package size

installed size is 179.8Mb
  sub-directories of 1Mb or more:
    libs  178.6Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.7Mb
  sub-directories of 1Mb or more:
    libs   4.5Mb
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is 170.2Mb
  sub-directories of 1Mb or more:
    libs  168.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 175.4Mb
  sub-directories of 1Mb or more:
    libs  174.2Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.7Mb
  sub-directories of 1Mb or more:
    libs   4.5Mb

Reverse Dependencies (3)

depends

imports

linking_to

Dependency Network

Dependencies Reverse dependencies Matrix Rcpp R6 rstan rstantools glmmrOptim marginme rts2 glmmrBase

Version History

updated 1.3.0 ← 1.2.1 diff Mar 31, 2026
new 1.2.1 Mar 10, 2026
updated 1.2.1 ← 1.2.0 diff Jan 26, 2026
updated 1.2.0 ← 1.1.0 diff Jan 20, 2026
updated 1.1.0 ← 1.0.2 diff Sep 28, 2025
updated 1.0.2 ← 1.0.1 diff Jul 21, 2025
updated 1.0.1 ← 1.0.0 diff Jul 7, 2025
updated 1.0.0 ← 0.11.2 diff Mar 31, 2025
updated 0.11.2 ← 0.11.1 diff Dec 11, 2024
updated 0.11.1 ← 0.10.5 diff Dec 9, 2024
updated 0.10.5 ← 0.9.2 diff Sep 7, 2024
updated 0.9.2 ← 0.8.1 diff Jun 18, 2024
updated 0.8.1 ← 0.7.1 diff Apr 7, 2024
updated 0.7.1 ← 0.6.2 diff Feb 25, 2024
updated 0.6.2 ← 0.6.1 diff Jan 18, 2024
updated 0.6.1 ← 0.5.3 diff Jan 10, 2024
updated 0.5.3 ← 0.5.2 diff Nov 23, 2023
updated 0.5.2 ← 0.4.6 diff Nov 21, 2023
updated 0.4.6 ← 0.4.5 diff Sep 13, 2023
updated 0.4.5 ← 0.4.4 diff Aug 14, 2023