You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I originally posted this as a comment to another issue, but it should probably be a separate issue. #123 (comment)_
In the data frame returned by augment, the values .mu and rightwards are directly drawn from the model object.
This is still the case if newdata is used. In this case, these values (e.g. .mu) do not correspond to the newdata (which the user probably expects). If newdata has another length than the model data, a warning is shown.
library(lme4)
#> Loading required package: Matrix
library(broom.mixed)
d<-sleepstudyfm1<- lmer(Reaction~Days+ (Days|Subject), d)
d_rev<-d[nrow(d):1,]
d_rev_aug<- augment(fm1, newdata=d_rev)
d_rev_aug[, c(".fitted", ".mu")]
#> # A tibble: 180 × 2#> .fitted .mu#> <dbl> <dbl>#> 1 369. 254.#> 2 358. 273.#> 3 346. 293.#> 4 334. 313.#> 5 322. 332.#> 6 311. 352.#> 7 299. 372.#> 8 287. 391.#> 9 275. 411.#> 10 264. 431.#> # … with 170 more rows# newdata other length than model data
augment(fm1, newdata=d[-1,])
#> A tibble: 179 × 11#> [tibble ...] #> Warning message:#> In indices[which(stats::complete.cases(original))] <- seq_len(nrow(x)) :#> number of items to replace is not a multiple of replacement length
The text was updated successfully, but these errors were encountered:
I originally posted this as a comment to another issue, but it should probably be a separate issue. #123 (comment)_
In the data frame returned by
augment
, the values.mu
and rightwards are directly drawn from the model object.This is still the case if
newdata
is used. In this case, these values (e.g..mu
) do not correspond to thenewdata
(which the user probably expects). Ifnewdata
has another length than the model data, a warning is shown.The text was updated successfully, but these errors were encountered: