66 questions
2
votes
1
answer
118
views
R.utils::withTimeout function not working with stan_glm
I am running many Bayesian models in parallel and want to skip models that take longer than a certain amount of time (e.g., 10 seconds).
To do this, I wrapped rstanarm::stan_glm() inside R.utils::...
0
votes
1
answer
37
views
Calculate fitted values from simulated posterior distribution for multiple factors in R
I am trying to simulate data from a liner mixed model in R using the sim() function from the arm package.
Here is a subset of my data.
> dput(data)
structure(list(id = c(989001026313185, ...
0
votes
0
answers
149
views
Error while fitting Bayesian cox pH model using rstanarm package in r
I was fitting the Cox PH model using the Bayesian approach in R software (Using rstanarm package). It shows mean error message "could not find function "stan_surv"".
bayes_cox <...
0
votes
1
answer
90
views
Formula difference specifying random effects on slope rstanarm
I believe the same syntax is used with the lme4 package as rstanarm, but I'm having trouble figuring out exactly what the differences are between the different options when fitting a grouped random ...
0
votes
0
answers
80
views
Is there an easy, error-free way to compute 400 Bayesian regression models at once in R?
I've been trying to run (RStudio) the following Bayesian regression model in a loop around 400 times to get the results for different parameters. After running it, I get the following error messages. ...
2
votes
0
answers
172
views
Can I specify a random intercept in a conditional logit model?
In conditional logit models, global intercepts cannot be estimated as they do not influence the conditional probability of a positive outcome within groups. I understand the intercept term gets ...
0
votes
0
answers
67
views
stan_betareg gets the error " Invalid stanfit object produced"?
I cannot run stan_betareg. Checked that all y variables are in hte proper support and updated the package. Still doesnt work? What else should I check?
Running
model<-stan_betareg(
linformula,
link=...
0
votes
1
answer
889
views
R package igraph cant install, needed for rstanarm. No gfortran found?
Rstanarm seems to install normally. But attempting to load:
> library(rstanarm)
Error: package or namespace load failed for ‘rstanarm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), ...
1
vote
0
answers
93
views
create sequence of predictor values to generate posterior predictions of simultaneous change in predictors
I am trying to create a data frame using (either tidyr::expand.grid or tibble::data_frame) in order to then generate posterior predictions using the tidybayes::epred_draws function from tidybayes (...
2
votes
0
answers
80
views
Specifying priors from different distributions in rstanarm
Is there a way in rstanarm to specify priors over model parameters (e.g. model coefficents) that are drawn from different probability distribution families (e.g. Cauchy, Gaussian, Geometric, etc.) ...
1
vote
0
answers
60
views
How to distribute Stan function definitions?
I'm creating an R package that contains a selection of new probablity distributions. In addition to implementing the density functions in R I have also implemented them as Stan functions. My idea is ...
0
votes
1
answer
104
views
How to specify lower bound as 0 on Bayesian priors
I am using rstanarm and want to create priors that are bound to be positive, so lower>0. How can I do this?
1
vote
0
answers
325
views
rstanarm - error when running Bayesian model
EDIT - I have managed to resolve this. See my comment below
I am running a Bayesian regression in R using rstanarm using priors I have set, using the following code:
priors <- rstanarm::normal(...
1
vote
1
answer
423
views
bayestestR for Bayesian Logistic Regression
I would like to perform Bayesian Logistic Regression using the bayestestR and rstanarm in R. The output, I believe, is in the log(odds ratio). Do you know of a way in which I can convert everything, i....
0
votes
1
answer
344
views
Obtain predicted probabilities from rstanarm in ordinal regression
How can I generate the posterior probability distribution for each outcome for each predictor in an ordinal regression?
e.g.
what I am looking for is this:
library(rstanarm)
fit_f <- MASS::polr(...