diff --git a/README.md b/README.md index 91ba812..9eaa499 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,27 @@ Multinomial Random Effects This code solves multinomial mixed effects models. -A minimal example is: +## Installing -fit a binomial model +``` +devtools::install_github('bdilday/mnre') +``` + +## Binomial Example + +fit a binomial model using a formula interface + +``` +library(mnre) +ev = mnre_simulate_multinomial_data_factors(nfct=2, K_class = 2, nlev=50, nobs=20000) +mnre_mod = mnre_fit(y ~ 1 + (1|fct01) + (1|fct02), data=ev$fr, verbose=0) +mnre_mod$theta +[1] 0.9926043 0.9537682 +``` + +fit a binomial model using lower-level `nd_min_fun` ``` -devtools::install_github('bdilday/mnre') library(mnre) ev = mnre_simulate_multinomial_data_factors(nfct=2, K_class = 2, nlev=50, nobs=20000) nf = mnre::nd_min_fun(ev) @@ -28,6 +43,8 @@ glmer_mod@theta [1] 0.9925264 0.9537615 ``` +## Multinomial model + Fit a multinomial model ```