Evening all,
I’m hoping I can get some help understanding a few things in the stan_glm() command so that I can finalize my models. Any pointers would be appreciated. I spent a bunch of time digging through this article on priors, a another rstan article on priors and their options, and the stan_glm() info page, but I’m still unclear on a few things. Some of the language/terms are just over my head right now…I’m very new to this.
Specifically, could anyone help explain what the following do?
-
X
-
Y
-
Prior_PD
-
QR
-
Sparse
I’m also not clear on exactly what autoscale’s function is, but running a model with and without it produced almost exactly the same results, so I figured as long as I’m specifying priors myself its ok to turn it off.
The bottom piece of code is a test model where I’ve slowly been adding in bits as I figure them out. The top code is my current model (copy-pasted from a vignette), and works just fine. But I don’t want to rely on the package defaults as a crutch.
Info on variables to aid model interpretation: Discount is a 3-level categorical variable representing the percentage reduction between a threatened trial sentence and the plea bargain they have been offered (20%, 50%, and 70%). PTS is the Potential Trial Sentence that the defendant is threatened with and has two levels only (5 years; 25 years). The IV is whether or not the plea deal was accepted or rejected.
#Current model
Discountmodel <- stan_glm(
Accept_Reject ~ Discount + PTS,
data = pubdata,
family = binomial(link = "logit"),
prior_intercept = NULL,
cores=3,
QR = FALSE,
chains = 3, iter = 50000,
diagnostic_file=file.path(tempdir(), "df.csv"))
#model for test runs
testmodel1=stan_glm(Accept_Reject~Discount + PTS,
family = binomial(link = "logit"),
data=pubdata,
#x = FALSE,
#y = TRUE,
prior = normal(location = 1.1,scale = 2.5,autoscale = FALSE),
#prior_intercept = normal(),
#prior_PD = FALSE,
algorithm = c("sampling"),
mean_PPD = TRUE,
adapt_delta = 0.95,
#QR = FALSE,
#sparse = FALSE,
chains=3,iter=1000,cores=3)