predict_and_plot: Visualize model fit

Description Usage Arguments Value Examples

View source: R/modeling.R

Description

predict log-odds of /p/ responses based on just the fixed effects of the fitted model, and plot.

Usage

1
predict_and_plot(dat, fit, show_se = FALSE, ...)

Arguments

dat

Data suitable for calling lme4::predict.merMod (e.g. output of make_prediction_data).

fit

glmer fitted model.

show_se

(default: FALSE) whether or not to draw the confidence intervals (based on the standard error of the fixed effects).

Value

The ggplot2 plot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data_mod <- mutate_for_lmer(data_inc)
fit <- glmer(respP ~ vot_rel.s * bvotCond.s * supervised * trial.s +
             (vot_rel.s * trial.s | subject),
             data=data_mod, family='binomial',
             control= glmerControl(optimizer='bobyqa'))
data_pred <- make_prediction(data_inc, data_mod)
predict_and_plot(data_pred, fit, show_se=TRUE)

## End(Not run)

kleinschmidt/phonetic-sup-unsup documentation built on May 20, 2019, 12:33 p.m.