glmmrOptim
Approximate Optimal Experimental Designs Using Generalised Linear Mixed Models
Description
Optimal design analysis algorithms for any study design that can be represented or modelled as a generalised linear mixed model including cluster randomised trials, cohort studies, spatial and temporal epidemiological studies, and split-plot designs. See <https://github.com/samuel-watson/glmmrBase/blob/master/README.md> for a detailed manual on model specification. A detailed discussion of the methods in this package can be found in Watson, Hemming, and Girling (2023) <doi:10.1177/09622802231202379>.
Downloads
326
Last 30 days
11989th
725
Last 90 days
2.7K
Last year
Trend: +41.1% (30d vs prior 30d)
CRAN Check Status
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 | ERROR |
| r-devel-macos-arm64 | ERROR |
| r-devel-windows-x86_64 | OK |
| r-oldrel-macos-arm64 | NOTE |
| r-oldrel-macos-x86_64 | ERROR |
| r-oldrel-windows-x86_64 | ERROR |
| r-patched-linux-x86_64 | OK |
| r-release-linux-x86_64 | OK |
| r-release-macos-arm64 | ERROR |
| r-release-macos-x86_64 | ERROR |
| r-release-windows-x86_64 | ERROR |
Check details (9 non-OK)
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... ********* Removing: 12**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 7**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error in Rmosek::mosek(prob, opts) : Unknown exported object to be built. Please use 'Rmosek::mosek_attachbuilder' to complete the installation of Rmosek. Calls: <Anonymous> ... method(solve_via_data, CVXR::Mosek_Solver) -> <Anonymous> Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... ********* Removing: 7**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 12**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error in Rmosek::mosek(prob, opts) : Unknown exported object to be built. Please use 'Rmosek::mosek_attachbuilder' to complete the installation of Rmosek. Calls: <Anonymous> ... method(solve_via_data, CVXR::Mosek_Solver) -> <Anonymous> Execution halted
installed package size
installed size is 45.7Mb
sub-directories of 1Mb or more:
libs 45.5Mb
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... ********* Removing: 12**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 7**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error in Rmosek::mosek(prob, opts) : Unknown exported object to be built. Please use 'Rmosek::mosek_attachbuilder' to complete the installation of Rmosek. Calls: <Anonymous> ... method(solve_via_data, CVXR::Mosek_Solver) -> <Anonymous> Execution halted
installed package size
installed size is 46.7Mb
sub-directories of 1Mb or more:
libs 46.4Mb
examples
Running examples in 'glmmrOptim-Ex.R' failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... 128099 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 12**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 7**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... ********* Removing: 7**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 12**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error in Rmosek::mosek(prob, opts) : Unknown exported object to be built. Please use 'Rmosek::mosek_attachbuilder' to complete the installation of Rmosek. Calls: <Anonymous> ... method(solve_via_data, CVXR::Mosek_Solver) -> <Anonymous> Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... ********* Removing: 12**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 7**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error in Rmosek::mosek(prob, opts) : Unknown exported object to be built. Please use 'Rmosek::mosek_attachbuilder' to complete the installation of Rmosek. Calls: <Anonymous> ... method(solve_via_data, CVXR::Mosek_Solver) -> <Anonymous> Execution halted
examples
Running examples in 'glmmrOptim-Ex.R' failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## Method `DesignSpace$new` > ## ------------------------------------------------ > > ## Don't show: > glmmrBase::setParallel(FALSE) # for the CRAN check > setParallelOptim(FALSE) > ## End(Don't show) > df <- nelder(~ ((int(2)*t(3)) > cl(3)) > ind(5)) > df$int <- df$int - 1 > des <- Model$new(formula = ~ int + factor(t) - 1+ (1|gr(cl)) + (1|gr(cl,t)), + covariance = c(0.04,0.01), + mean = rep(0,4), + data=df, + family=gaussian()) > ds <- DesignSpace$new(des) experimental condition not provided, assuming each observation is a separate experimental condition. experimental condition can be changed manually in self$experimental_condition > #add another design > des2 <- Model$ne ...[truncated]... 128099 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 12**| |Iteration 120| Size: 31 Current value: 0.13282 Calculating removals: 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| ************************************************ Removing: 7**| FINISHED REVERSE GREEDY SEARCH> > #let the experimental condition be the cluster > # these experimental conditions are independent of one another > ds <- DesignSpace$new(des,experimental_condition = df$cl) > # now find the optimal 4 clusters to include > # approximately, finding the weights for each condition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted
Additional Issues
Check History
ERROR 4 OK · 2 NOTE · 0 WARNING · 8 ERROR · 0 FAILURE Mar 10, 2026
examples
Running examples in ‘glmmrOptim-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: DesignSpace
> ### Title: A GLMM Design Space
> ### Aliases: DesignSpace
>
> ### ** Examples
>
>
...[truncated]...
ndition
> opt <- ds$optimal(4,C=list(c(rep(0,5),1)))
Checking experimental condition correlations...
Experimental conditions uncorrelated, using second-order cone program
Error: 'solve' is not an exported object from 'namespace:CVXR'
Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: DesignSpace
> ### Title: A GLMM Design Space
> ### Aliases: DesignSpace
>
> ### ** Examples
>
>
...[truncated]...
ndition
> opt <- ds$optimal(4,C=list(c(rep(0,5),1)))
Checking experimental condition correlations...
Experimental conditions uncorrelated, using second-order cone program
Error: 'solve' is not an exported object from 'namespace:CVXR'
Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## ...[truncated]... ndition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## ...[truncated]... ndition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted
examples
Running examples in 'glmmrOptim-Ex.R' failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## ...[truncated]... ndition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted
examples
Running examples in ‘glmmrOptim-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: DesignSpace
> ### Title: A GLMM Design Space
> ### Aliases: DesignSpace
>
> ### ** Examples
>
>
...[truncated]...
ndition
> opt <- ds$optimal(4,C=list(c(rep(0,5),1)))
Checking experimental condition correlations...
Experimental conditions uncorrelated, using second-order cone program
Error: 'solve' is not an exported object from 'namespace:CVXR'
Execution halted
examples
Running examples in 'glmmrOptim-Ex.R' failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## ...[truncated]... ndition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted
installed package size
installed size is 45.7Mb
sub-directories of 1Mb or more:
libs 45.5Mb
installed package size
installed size is 46.0Mb
sub-directories of 1Mb or more:
libs 45.7Mb
examples
Running examples in 'glmmrOptim-Ex.R' failed The error most likely occurred in: > ### Name: DesignSpace > ### Title: A GLMM Design Space > ### Aliases: DesignSpace > > ### ** Examples > > > ## ------------------------------------------------ > ## ...[truncated]... ndition > opt <- ds$optimal(4,C=list(c(rep(0,5),1))) Checking experimental condition correlations... Experimental conditions uncorrelated, using second-order cone program Error: 'solve' is not an exported object from 'namespace:CVXR' Execution halted