[R-sig-ME] Radio silence in re "newdata" argument of simulate.merMod(): PS2
John H Maindonald
jhm@|ndon@|d @end|ng |rom gm@||@com
Mon Aug 8 08:02:10 CEST 2022
Maybe I will get it right this time:
The imbalance in cbpp is a side issue. As I understand it, the issue
is that one has the choice of simulating for a new level of herd,
(existing levels of herd are then for purposes of simulation irrelevant),
or simulating for existing levels. Rolf’s X, has 1:15 existing, and 16:30 new.
At least with the cbpp data, it appears that the newdata argument only works
with allow.new.levels=TRUE. I assume that one gets a new level for each
new simulation.
The following is a bit worrying:
X <- data.frame(herd=rep('new',4), size=rep(40,4), period=1:4)
s.mer1 <- simulate(fit,nsim=2,newdata=X,allow.new.levels=TRUE)
> s.mer1
sim_1.incidence sim_1.V2 sim_2.incidence sim_2.V2
1 3 11 1 21
2 2 10 1 17
3 2 7 1 20
4 0 5 1 21
Warning message:
In format.data.frame(if (omit) x[seq_len(n0), , drop = FALSE] else x, :
corrupt data frame: columns will be truncated or padded with NAs
I have lme4_1.1-30 and Matrix_1.4-1.
John Maindonald
> On 8/08/2022, at 11:13, Rolf Turner <r.turner using auckland.ac.nz <mailto:r.turner using auckland.ac.nz>> wrote:
>
>
> Three days ago I sent an email to r-sig-mixed-models asking what I was
> doing wrong in my use of the "newdata" argument of simulate.merMod().
>
> So far I have received no response at all. This surprises me. I
> expected a quick reply, from Ben Bolker (or someone like him) to the
> effect of "You absolute ninny. *This* is (obviously!) the syntax that
> you should be using."
>
> Was my question unclear or too obscure or arcane? If so, are there any
> suggestions as to how I could be more perspicuous?
>
> I really would appreciate some help.
>
> cheers,
>
> Rolf Turner
>
> --
> Honorary Research Fellow
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
> _______________________________________________
> R-sig-mixed-models using r-project.org <mailto:R-sig-mixed-models using r-project.org> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models <https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list