[R-sig-ME] GLMM - Prediction

Thierry Onkelinx thierry.onkelinx at inbo.be
Fri Mar 2 10:46:20 CET 2018


Dear Iack,

Look at the re.form argument of ?lme4::predict.merMod. This allows you the
make predictions without the ID random effect.

Best regards,


ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>

2018-03-02 1:09 GMT+01:00 Cleber Iack <profiack at gmail.com>:

> Dear,
>
> I have n different companies with different characteristics and each
> company of this has the same positions
> I selected data from several members of each position of each Company, and
> there were behavioral variables ranging from 0 to 10, which to facilitate I
> will call x1, x2, x3, these variables were collected more than once for
> each person.
>
> The objective is to predict the probability of occurrence of a fact, and
> each person was also noted if this fact occurred or not. (0 or 1)
>
> Using
>
> formMod1= fato~  x1+x2+x3+(1 | company / position)
> Mod1 <- glmer( formMod1 , data = dadosord , family = binomial,
>                      control = glmerControl(optimizer="bobyqa"))
>
> This model I can make a prediction without "problems"
>
> n11 <-  data.frame(company =factor("M1", levels =
> levels(dadosord$company ),ordered=FALSE),
>                    position=factor("P1", levels =
> levels(dadosord$position),ordered=FALSE),
>                    x1=1, x2=7,x3=7)
> predict( Mod1 , n11, type="response")
>
> But I was worried because I have more than one observation of the
> characteristics per individual, if I would not have to put it also as
> random
> or somehow analyze this structure of possible correlation
>
> Thinking about the first case I did
>
> formMod2= fato~  x1+x2+x3+(1 | company / position) + (1 | ID)
> Mod2 <- glmer( formMod2 , data = dadosord , family = binomial,
>                      control = glmerControl(optimizer="bobyqa"))
>
> But in this case when trying to predict the probability of the fact, the
> function "predict" asks me who is the proposed id, which is out of
> interest, since I must study for a random person who has the same features
> x1, x2, x3, company and position.
>
> And the second form, if any, I do not know how I would do
>
> Thanks for the help of my friends.
>
> Iack
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list