Description Usage Arguments Value Author(s) See Also Examples
This function computes the predicted values from the fixed effects of a mixed effects model.
1 2 3 4 5 6 7 8 |
fit |
Fitted |
to_predict |
Optional data frame containing the fixed effects design to predict. If absent, the function will assume that the full design from the provided fitted model is requested. |
numeric_res |
Integer value specifying the sampling resolution of any numeric fixed effect. Has no effect if non-NULL value supplied to |
boot |
Logical. If TRUE (default), bootstrapping will be used to generate sample predictions. |
iterations |
Integer value specifying the number of bootstrap iterations to employ if |
zero_intercept_variance |
Logical. If TRUE (default), bootstrap samples will be obtained after setting the intercept variance and covariances to zero. This makes sense only when, prior to fitting the model, the predictor variables were set up with contrasts that make the intercept orthogonal to effects of interest (e.g. |
A data frame containing the prediction value (and estimated variance of this value) for each cell in the fixed effects design.
Michael A. Lawrence mike.lwrnc@gmail.com
Visit the ez
development site at http://github.com/mike-lawrence/ez
for the bug/issue tracker and the link to the mailing list.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | library(lme4)
#Read in the ANT data (see ?ANT).
data(ANT)
head(ANT)
#fit a mixed effects model to the rt data
rt_fit = lmer(
formula = rt ~ cue*flank*group + (1|subnum)
, data = ANT[ANT$error==0,]
)
#obtain the predictions from the model
rt_preds = ezPredict(
fit = rt_fit
)
#visualize the predictions
ezPlot2(
preds = rt_preds
, x = flank
, row = cue
, col = group
, y_lab = 'RT (ms)'
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.