drizopoulos / GLMMadaptive

GLMMs with adaptive Gaussian quadrature
https://drizopoulos.github.io/GLMMadaptive/
60 stars 14 forks source link

A problem with the censored.normal() family? #44

Closed noambard closed 2 years ago

noambard commented 2 years ago

Dear Prof. Rizopoulos, I cannot seem to get the truncated normal family to work in a study I am performing.

To recreate the problem, I use the following toy example: set.seed(123) fake_data <- data.frame(Y = rnorm(1000), X = rbinom(1000, 1, 0.4), ID = rep(1:500, 2)) fit <- mixed_model(fixed = Y ~ X, random = ~ 1 | ID, data = fake_data, family = censored.normal())

This, just as the real data I am using, returns "Error in y[, 2L] : incorrect number of dimensions".

I am using version 0.8-5 of the package.

Would be grateful for assistance. Noam

drizopoulos commented 2 years ago

Check the example here: https://drizopoulos.github.io/JMbayes2/articles/Non_Gaussian_Mixed_Models.html#censored-linear-mixed-models

noambard commented 2 years ago

That worked. Thank you.