[R-sig-ME] GLMM - Prediction
Cleber Iack
profiack at gmail.com
Fri Mar 2 01:09:07 CET 2018
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]]
More information about the R-sig-mixed-models
mailing list