Description Usage Arguments Examples
Fits a psychometric function
1 2 3 |
formula |
A formula that one would pass to 'glm' or similar |
data |
A data.frame object |
link |
A link function (either "logit" or "probit") |
adaptive_pooling |
Logical (FALSE by default) Specifies whether adaptive pooling should be used when fitting the model. Requires that both an intecept and at least one factor variable is included in the formula. |
... |
Other parameters to be passed to 'rstan::stan()'. |
sample |
Logical. Whether to sample from the model or just build the model without sampling |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Load the data
data_binomial <- Sample_Data_Binomial
data_bernoulli <- Sample_Data_Bernoulli
# Fit a full model using binomial response data. By default, it will only
# return the posterior samples for the coefficients
fit1.1 <- bayesPF(y|k ~ x1 + age + gender, data_binomial, "logit",
chains = 2, cores = 2, iter = 8000, warmup = 2000)
str(fit1.1)
# Fit a full model using binary response data. To get the fitted Stan
# model, specify `return_stan_fit = TRUE`. To get diagnostic information
# such as the Stan code and transformed data, specify `return_f2stan = TRUE`
fit1.2 <- bayesPF(y ~ x1 + age + gender, data_bernoulli, "probit",
return_f2stan = TRUE, return_stan_fit = TRUE)
str(fit1.2)
extract(fit1.2$fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.