Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the capacity to deal with random structure #6

Open
beckyfisher opened this issue May 28, 2020 · 2 comments
Open

Add the capacity to deal with random structure #6

beckyfisher opened this issue May 28, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@beckyfisher
Copy link
Collaborator

No description provided.

@dbarneche dbarneche added the enhancement New feature or request label May 30, 2020
@beckyfisher
Copy link
Collaborator Author

This capacity is now implemented in the experimental branch random_effects. This is achieved through two additional arguments. The first, random, is a named list containing model formula for the random effects that you want to include. This can include all/any of the non-liner parameters, and bayesnec will automatically use the ones relevant to a given model. The second is a character vector specifying the columns in data that contain the random effects. Below is an example of the code for implementing the random effects, where "genotype" is added as a random effect on the "nec" parameter and "chamber" is added as an offset term (ost). Note that for random offsets, the syntax requires the random list includes this as element "ost", and that "ost" is used in the model formula. Note also that this example is likely to be a sensible model, and that use of the random effects structures needs to be carefully considered, explored and validated by the user.

random_term <- list( nec = as.formula(nec ~ (1|genotype)),
ost = as.formula(ost ~ (1|chamber)))

temp5<- bnec(data = surv_24h_data,
x_var = "log.x",
y_var = "y",
trials_var = "trials",
model = "ecxll4",
iter=2e3,
random = random_term, random_vars = c("genotype", "chamber")

@beckyfisher
Copy link
Collaborator Author

Note this has been re-written in version 2.0 such that the random structure is closer to the brms syntax.
Still requires vignette to demonstrate usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants