Learn R Programming

psycho (version 0.4.91)

analyze.stanreg: Analyze stanreg objects.

Description

Analyze stanreg objects.

Usage

# S3 method for stanreg
analyze(x, CI = 90, index = "overlap",
  ROPE_bounds = NULL, effsize = FALSE, effsize_rules = "cohen1988",
  ...)

Arguments

x

A stanreg model.

CI

Credible interval bounds.

index

Index of effect existence to report. Can be 'overlap' or 'ROPE'.

ROPE_bounds

Bounds of the ROPE. If NULL and effsize is TRUE, than the ROPE. will have default values c(-0.1, 0.1) and computed on the standardized posteriors.

effsize

Compute Effect Sizes according to Cohen (1988). For linear models only.

effsize_rules

Grid for effect size interpretation. See interpret_d.

...

Arguments passed to or from other methods.

Value

Contains the following indices:

  • the Median of the posterior distribution of the parameter (can be used as a point estimate, similar to the beta of frequentist models).

  • the Median Absolute Deviation (MAD), a robust measure of dispertion (could be seen as a robust version of SD).

  • the Credible Interval (CI) (by default, the 90% CI; see Kruschke, 2018), representing a range of possible parameter.

  • the Maximum Probability of Effect (MPE), the probability that the effect is positive or negative (depending on the median<U+00E2><U+20AC><U+2122>s direction).

  • the Overlap (O), the percentage of overlap between the posterior distribution and a normal distribution of mean 0 and same SD than the posterior. Can be interpreted as the probability that a value from the posterior distribution comes from a null distribution.

  • the ROPE, the proportion of the 95% CI of the posterior distribution that lies within the region of practical equivalence.

See Also

"get_R2.stanreg" "bayes_R2.stanreg"

Examples

Run this code
# NOT RUN {
library(psycho)
library(rstanarm)

data <- attitude
fit <- rstanarm::stan_glm(rating ~ advance + privileges, data = data)

results <- analyze(fit, effsize = TRUE)
summary(results)
print(results)
plot(results)


fit <- rstanarm::stan_lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data = iris)
results <- analyze(fit)
summary(results)

fit <- rstanarm::stan_glm(Sex ~ Adjusting,
  data = psycho::affective, family = "binomial"
)
results <- analyze(fit)
summary(results)

fit <- rstanarm::stan_glmer(Sex ~ Adjusting + (1 | Salary),
  data = psycho::affective, family = "binomial"
)
results <- analyze(fit)
summary(results)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab