How can I change coef to exp(coef) in modelsummary table? - r

I am trying to create a summary table for my Cox model. However, when I use modelsummary function, it gives me a table that shows coef. But I want to display exp(coef) on my summary table. How can I change coef to exp(coef)?
I use this script to create a summary table:
modelsummary(model.1,
statistic='({conf.low}, {conf.high})',
stars=TRUE,
vcov = 'classical',
coef_omit = "Intercept",
coef_rename=c('ln_reb_capacity'='Relative rebel strength',
'terrcont'='Rebel territorial control', 'gdp'='Economic strength',
'bdbest'='Conflict intensity', 'roughterrain'='Rough terrain',
'loot'='Lootable resources', 'in_tpop'='Population size',
'powersharing'='Sharing Leadership'),
title = 'Table I.',
output='gt'
)
This is the summary table:
Table I.
─────────────────────────────────────────────────────────
Model 1
─────────────────────────────────────────────────────────
Relative rebel strength 0.125*
(0.016, 0.235)
Rebel territorial control -0.295+
(-0.638, 0.048)
Economic strength 0.000
(0.000, 0.000)
Conflict intensity 0.000
(0.000, 0.000)
Rough terrain 0.098
(-0.210, 0.405)
Lootable resources 0.105
(-0.298, 0.507)
Population size -0.119+
(-0.249, 0.011)
Sharing Leadership 0.046
(-0.393, 0.486)
─────────────────────────────────────────────────────────
Num.Obs. 260
AIC 1678.5
BIC 1707.0
RMSE 0.83
Std.Errors Classical
─────────────────────────────────────────────────────────
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
─────────────────────────────────────────────────────────
Column names: , Model 1
Here is my result for Cox model:
Call:
coxph(formula = Surv(month_duration, EndConflict) ~ ln_reb_capacity +
terrcont + gdp + bdbest + roughterrain + loot + in_tpop +
powersharing, data = df)
n= 260, number of events= 183
(108 observations deleted due to missingness)
coef exp(coef) se(coef) z Pr(>|z|)
ln_reb_capacity 0.125154562 1.133323609 0.055831926 2.242 0.0250 *
terrcont -0.295113621 0.744446997 0.174927860 -1.687 0.0916 .
gdp -0.000004416 0.999995584 0.000017623 -0.251 0.8021
bdbest -0.000010721 0.999989279 0.000016057 -0.668 0.5043
roughterrain 0.097602616 1.102524573 0.156809154 0.622 0.5337
loot 0.104686159 1.110362079 0.205406301 0.510 0.6103
in_tpop -0.119020975 0.887789179 0.066355450 -1.794 0.0729 .
powersharing 0.046026931 1.047102610 0.224229347 0.205 0.8374
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
ln_reb_capacity 1.1333 0.8824 1.0159 1.264
terrcont 0.7444 1.3433 0.5284 1.049
gdp 1.0000 1.0000 1.0000 1.000
bdbest 1.0000 1.0000 1.0000 1.000
roughterrain 1.1025 0.9070 0.8108 1.499
loot 1.1104 0.9006 0.7424 1.661
in_tpop 0.8878 1.1264 0.7795 1.011
powersharing 1.0471 0.9550 0.6747 1.625
Concordance= 0.617 (se = 0.023 )
Likelihood ratio test= 18.96 on 8 df, p=0.02
Wald test = 18.2 on 8 df, p=0.02
Score (logrank) test = 18.36 on 8 df, p=0.02
Thanks.

You could adjust the argument exponentiate. If it's TRUE, the estimate, conf.low, and conf.high statistics are exponentiated, and the std.error is transformed to exp(estimate)*std.error
(by the delta method).
modelsummary(model.1,
...,
exponentiate = TRUE
)

Related

Is there any way to split interaction effects in a linear model up?

I have a 2x2 factorial design: control vs enriched, and strain1 vs strain2. I wanted to make a linear model, which I did as follows:
anova(lmer(length ~ Strain + Insect + Strain:Insect + BW_final + (1|Pen), data = mydata))
Where length is one of the dependent variables I want to analyse, Strain and Insect as treatments, Strain:Insect as interaction effect, BW_final as covariate, and Pen as random effect.
As output I get this:
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
Strain 3.274 3.274 1 65 0.1215 0.7285
Insect 14.452 14.452 1 65 0.5365 0.4665
BW_final 45.143 45.143 1 65 1.6757 0.2001
Strain:Insect 52.813 52.813 1 65 1.9604 0.1662
As you can see, I only get 1 interaction term: Strain:Insect. However, I'd like to see 4 interaction terms: Strain1:Control, Strain1:Enriched, Strain2:Control, Strain2:Enriched.
Is there any way to do this in R?
Using summary instead of anova I get:
> summary(linearmer)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [lmerModLmerTest]
Formula: length ~ Strain + Insect + Strain:Insect + BW_final + (1 | Pen)
Data: mydata_young
REML criterion at convergence: 424.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.95735 -0.52107 0.07014 0.43928 2.13383
Random effects:
Groups Name Variance Std.Dev.
Pen (Intercept) 0.00 0.00
Residual 26.94 5.19
Number of obs: 70, groups: Pen, 27
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 101.646129 7.530496 65.000000 13.498 <2e-16 ***
StrainRoss 0.648688 1.860745 65.000000 0.349 0.729
Insect 0.822454 2.062696 65.000000 0.399 0.691
BW_final -0.005188 0.004008 65.000000 -1.294 0.200
StrainRoss:Insect -3.608430 2.577182 65.000000 -1.400 0.166
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) StrnRs Insect BW_fnl
StrainRoss 0.253
Insect -0.275 0.375
BW_final -0.985 -0.378 0.169
StrnRss:Ins 0.071 -0.625 -0.775 0.016
convergence code: 0
boundary (singular) fit: see ?isSingular```

Post hoc for binary GLMM (lme4) and plot

So I'm an R novice attempting a GLMM and post hoc analysis... help! I've collected binary data on 9 damselflys under 6 light levels, 1=response to movement of optomotor drum, 0=no response. My data was imported into R with the headings 'Animal_ID, light_intensity, response'. Animal ID (1-9) repeated for each light intensity (3.36-0.61) (see below)
Using the following code (lme4 package), I've performed a GLMM and found a light level to have a significant effect on response:
d = data.frame(id = data[,1], var = data$Light_Intensity, Response = data$Response)
model <- glmer(Response~var+(1|id),family="binomial",data=d)
summary(model)
Returns
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) [glmerMod]
Family: binomial ( logit )
Formula: Response ~ var + (1 | Animal_ID)
Data: d
AIC BIC logLik deviance df.resid
66 72 -30 60 51
Scaled residuals:
Min 1Q Median 3Q Max
-3.7704 -0.6050 0.3276 0.5195 1.2463
Random effects:
Groups Name Variance Std.Dev.
Animal_ID (Intercept) 1.645 1.283
Number of obs: 54, groups: Animal_ID, 9
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.7406 1.0507 -1.657 0.0976 .
var 1.1114 0.4339 2.561 0.0104 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
var -0.846
Then running:
m1 <- update(model, ~.-var)
anova(model, m1, test = 'Chisq')
Returns
Data: d
Models:
m1: Response ~ (1 | Animal_ID)
model: Response ~ var + (1 | Animal_ID)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
m1 2 72.555 76.533 -34.278 68.555
model 3 66.017 71.983 -30.008 60.017 8.5388 1 0.003477 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
I've installed the multcomp and lsmeans packages in an attempt at performing a Tukey post hoc to see where the difference is, but have run into difficulties with both.
Running:
summary(glht(m1,linfct=mcp("Animal_ID"="Tukey")))
Returns:
"Error in mcp2matrix(model, linfct = linfct) :
Variable(s) ‘Animal_ID’ have been specified in ‘linfct’ but cannot be found in ‘model’! "
Running:
lsmeans(model,pairwise~Animal_ID,adjust="tukey")
Returns:
"Error in lsmeans.character.ref.grid(object = new("ref.grid", model.info = list( :
No variable named Animal_ID in the reference grid"
I'm aware that I'm probably being very stupid here, but any help would be very much appreciated. My confusion is snowballing.
Also, does anyone have any suggestions as to how I might best visualize my results (and how to do this)?
Thank you very much in advance!
UPDATE:
New code-
Light <- c("3.36","3.36","3.36","3.36","3.36","3.36","3.36","3.36","3.36","2.98","2.98","2.98","2.98","2.98","2.98","2.98","2.98","2.98","2.73","2.73","2.73","2.73","2.73","2.73","2.73","2.73","2.73","2.15","2.15","2.15","2.15","2.15","2.15","2.15","2.15","2.15","1.72","1.72","1.72","1.72","1.72","1.72","1.72","1.72","1.72","0.61","0.61","0.61","0.61","0.61","0.61","0.61","0.61","0.61")
Subject <- c("1","2","3","4","5","6","7","8","9","1","2","3","4","5","6","7","8","9","1","2","3","4","5","6","7","8","9","1","2","3","4","5","6","7","8","9","1","2","3","4","5","6","7","8","9","1","2","3","4","5","6","7","8","9")
Value <- c("1","0","1","0","1","1","1","0","1","1","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","1","0","0","1","1","1","1","1","1","1","0","0","0","1","0","0","1","0","1","0","0","0","1","1","0","1","0","0")
data <- data.frame(Light, Subject, Value)
library(lme4)
model <- glmer(Value~Light+(1|Subject),family="binomial",data=data)
summary(model)
Returns:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) [
glmerMod]
Family: binomial ( logit )
Formula: Value ~ Light + (1 | Subject)
Data: data
AIC BIC logLik deviance df.resid
67.5 81.4 -26.7 53.5 47
Scaled residuals:
Min 1Q Median 3Q Max
-2.6564 -0.4884 0.2193 0.3836 1.2418
Random effects:
Groups Name Variance Std.Dev.
Subject (Intercept) 2.687 1.639
Number of obs: 54, groups: Subject, 9
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.070e+00 1.053e+00 -1.016 0.3096
Light1.72 -7.934e-06 1.227e+00 0.000 1.0000
Light2.15 2.931e+00 1.438e+00 2.038 0.0416 *
Light2.73 2.931e+00 1.438e+00 2.038 0.0416 *
Light2.98 4.049e+00 1.699e+00 2.383 0.0172 *
Light3.36 2.111e+00 1.308e+00 1.613 0.1067
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) Lg1.72 Lg2.15 Lg2.73 Lg2.98
Light1.72 -0.582
Light2.15 -0.595 0.426
Light2.73 -0.595 0.426 0.555
Light2.98 -0.534 0.361 0.523 0.523
Light3.36 -0.623 0.469 0.553 0.553 0.508
Then running:
m1 <- update(model, ~.-Light)
anova(model, m1, test= 'Chisq')
Returns:
Data: data
Models:
m1: Value ~ (1 | Subject)
model: Value ~ Light + (1 | Subject)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
m1 2 72.555 76.533 -34.278 68.555
model 7 67.470 81.393 -26.735 53.470 15.086 5 0.01 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Finally, running:
library(lsmeans)
lsmeans(model,list(pairwise~Light),adjust="tukey")
Returns (it actually works now!):
$`lsmeans of Light`
Light lsmean SE df asymp.LCL asymp.UCL
0.61 -1.070208 1.053277 NA -3.1345922 0.9941771
1.72 -1.070216 1.053277 NA -3.1345997 0.9941687
2.15 1.860339 1.172361 NA -0.4374459 4.1581244
2.73 1.860332 1.172360 NA -0.4374511 4.1581149
2.98 2.978658 1.443987 NA 0.1484964 5.8088196
3.36 1.040537 1.050317 NA -1.0180467 3.0991215
Results are given on the logit (not the response) scale.
Confidence level used: 0.95
$`pairwise differences of contrast`
contrast estimate SE df z.ratio p.value
0.61 - 1.72 7.933829e-06 1.226607 NA 0.000 1.0000
0.61 - 2.15 -2.930547e+00 1.438239 NA -2.038 0.3209
0.61 - 2.73 -2.930539e+00 1.438237 NA -2.038 0.3209
0.61 - 2.98 -4.048866e+00 1.699175 NA -2.383 0.1622
0.61 - 3.36 -2.110745e+00 1.308395 NA -1.613 0.5897
1.72 - 2.15 -2.930555e+00 1.438239 NA -2.038 0.3209
1.72 - 2.73 -2.930547e+00 1.438238 NA -2.038 0.3209
1.72 - 2.98 -4.048874e+00 1.699175 NA -2.383 0.1622
1.72 - 3.36 -2.110753e+00 1.308395 NA -1.613 0.5897
2.15 - 2.73 7.347728e-06 1.357365 NA 0.000 1.0000
2.15 - 2.98 -1.118319e+00 1.548539 NA -0.722 0.9793
2.15 - 3.36 8.198019e-01 1.302947 NA 0.629 0.9889
2.73 - 2.98 -1.118326e+00 1.548538 NA -0.722 0.9793
2.73 - 3.36 8.197945e-01 1.302947 NA 0.629 0.9889
2.98 - 3.36 1.938121e+00 1.529202 NA 1.267 0.8029
Results are given on the log odds ratio (not the response) scale.
P value adjustment: tukey method for comparing a family of 6 estimates
Your model specifies Animal_ID as a random effect. The glht and lsmeans functions work only for fixed-effect comparisons.

How to prevent summary output of glm model from showing all levels of categorical variable

I am running a logistic regression, with Gender as the predictor. My issue is that when including "School", which has levels A-X, into the model I obtain this in the summary output:
> glm.1=glm(Gender~Math.Scaled.Scores.2011+Math.Scaled.Scores.2012+Math.Scaled.Scores.2013+School, data= Ed, family=binomial)
> summary(glm.1)
Call:
glm(formula = Gender ~ Math.Scaled.Scores.2011 + Math.Scaled.Scores.2012 +
Math.Scaled.Scores.2013 + School, family = binomial, data = Ed)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.389 -1.212 1.058 1.138 1.376
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.331e-02 2.223e-01 0.150 0.8809
Math.Scaled.Scores.2011 -7.837e-04 5.401e-04 -1.451 0.1468
Math.Scaled.Scores.2012 5.279e-05 6.298e-04 0.084 0.9332
Math.Scaled.Scores.2013 9.878e-04 6.258e-04 1.579 0.1144
SchoolB 5.198e-03 2.091e-01 0.025 0.9802
SchoolC -3.341e-02 2.120e-01 -0.158 0.8748
SchoolD -6.354e-02 2.348e-01 -0.271 0.7867
SchoolE 9.032e-03 2.159e-01 0.042 0.9666
SchoolF -3.553e-01 2.322e-01 -1.530 0.1260
SchoolG -1.845e-01 2.325e-01 -0.794 0.4274
SchoolH -2.358e-01 2.308e-01 -1.022 0.3069
SchoolI 1.351e-02 2.162e-01 0.062 0.9502
SchoolJ 1.220e-01 2.395e-01 0.509 0.6105
SchoolK -3.845e-02 2.388e-01 -0.161 0.8721
SchoolL -1.637e-02 2.018e-01 -0.081 0.9354
SchoolML 1.051e-01 2.304e-01 0.456 0.6483
SchoolN 4.214e-02 2.310e-01 0.182 0.8552
SchoolO -1.764e-02 2.248e-01 -0.078 0.9374
SchoolP 3.455e-02 2.258e-01 0.153 0.8784
SchoolQ -2.496e-01 2.066e-01 -1.208 0.2270
SchoolR -4.046e-01 2.187e-01 -1.851 0.0642 .
SchoolS 1.483e-02 2.139e-01 0.069 0.9447
SchoolT -2.566e-01 2.334e-01 -1.100 0.2714
SchoolU -4.166e-02 2.088e-01 -0.199 0.8419
SchoolV -4.073e-01 2.246e-01 -1.813 0.0698 .
SchoolW 1.074e-03 2.203e-01 0.005 0.9961
SchoolX -1.056e-01 2.190e-01 -0.482 0.6298
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5997.2 on 4327 degrees of freedom
Residual deviance: 5971.4 on 4301 degrees of freedom
AIC: 6025.4
Number of Fisher Scoring iterations: 3
It gives all the coeffiecients for each school, but I want it to be "School" in general as a whole, not schoolA-Schoolz. So it looks like I have 24 predictors of school, when I really only want 1.

In RMarkdown, how to retrieve values from model output and put them in formatted LaTex?

As an example, I'm running several survival models, each one has a different set of covariates.
First model
> coxph = coxph(Surv(time, event) ~ tr.ma, data = first.data, method = "breslow")
> summary(coxph)
Call:
coxph(formula = Surv(time, event) ~ tr.ma, data = first.data,
method = "breslow")
n= 49, number of events= 46
(1 observation deleted due to missingness)
coef exp(coef) se(coef) z Pr(>|z|)
tr.ma 0.09520 1.09988 0.03906 2.437 0.0148 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
tr.ma 1.1 0.9092 1.019 1.187
Concordance= 0.694 (se = 0.058 )
Rsquare= 0.109 (max possible= 0.997 )
Likelihood ratio test= 5.68 on 1 df, p=0.01718
Wald test = 5.94 on 1 df, p=0.0148
Score (logrank) test = 5.93 on 1 df, p=0.01485
Second model
> coxph = coxph(Surv(time, event) ~ tr.ma + contag_per, data = first.data, method = "breslow")
> summary(coxph)
Call:
coxph(formula = Surv(time, event) ~ tr.ma + contag_per, data = first.data,
method = "breslow")
n= 49, number of events= 46
(1 observation deleted due to missingness)
coef exp(coef) se(coef) z Pr(>|z|)
tr.ma 0.09801 1.10297 0.04231 2.317 0.020518 *
contag_per -1.97309 0.13903 0.51683 -3.818 0.000135 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
tr.ma 1.103 0.9066 1.01521 1.1983
contag_per 0.139 7.1929 0.05049 0.3828
Concordance= 0.752 (se = 0.058 )
Rsquare= 0.348 (max possible= 0.997 )
Likelihood ratio test= 20.98 on 2 df, p=2.78e-05
Wald test = 19.33 on 2 df, p=6.357e-05
Score (logrank) test = 20.73 on 2 df, p=3.147e-05
The problem
I want to get exp(coef), Pr(>|z|) from the output of each model and gather them into a table formatted in LaTex to make a concise report. Something like:
Model covariates exp(coef) p-value
----------------------------------------
1 tr.ma 1.099 0.0148
2 tr.ma 1.103 0.0205
contag_per 0.139 0.00013
...
It would be fantastic if I can automate that, since I have about 25 models, and having to manually retrieving and entering the numbers in a table would be quite inconvenient and error-prone. Thanks.

Interaction not significant when using a logistic model but is significant using a poisson/negative binomial model

I ran an experiment in which participants were asked to pass a story along a 4 person 'transmission chain', a bit like the game Chinese Whispers. Person 1 reads the story and re-writes it for person 2, who does the same and it continues until all four people in the chain have read and reproduced the story. I'm interested it whether positive or negative information 'survives' better in the reproductions. I have modeled this two ways: one approach was to code each item in the original story as being either present (1) or absent (0) in the reproductions and model this using a logistic model:
survival.logit <- glmer(Present ~ Posn.c*mood.c*Valence.c + (1+Valence.c|mood.c/Chain.) + (1|Item), data = Survival.Analysis_restructureddata, family = binomial, glmerControl(optimizer="bobyqa", check.conv.grad=.makeCC("warning", 2e-3)))
The other approach is to count the number of each type of statement that is lost across the chains and model this data using a poisson or negative binomial model.
survival.count <- glmer.nb(Loss_across.Chain ~ Posn.c*mood.c*Valence.c + (1 + Valence.c|mood.c/Chain), data = FinalData_forpoisson, control = glmerControl(optimizer = "bobyqa", check.conv.grad = .makeCC("warning", 0.05)))
The fixed factors in each model are:
Posn.c - position in the chain (centered)
mood.c - mood condition (a between-groups factor, centered)
Valence.c - valence of the item (positive or negative, centered)
Both models return similar results with one key exception - the interaction between position in the chain and valence is not significant in the logistic model but is highly significant in the negative binomial model. Why might this be the case?? Graphing the data suggests that there is indeed an interaction, such that positive information is lost at a faster rate than negative across the chain.
Any help would be greatly appreciated!
Edit: Please see below the model output for the both models:
Logistic:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: Present ~ Posn.c * mood.c * Valence.c + (1 + Valence.c | mood.c/Chain.) + (1 | Item)
Data: Survival.Analysis_restructureddata
Control: glmerControl(optimizer = "bobyqa", check.conv.grad = .makeCC("warning", 0.002))
AIC BIC logLik deviance df.resid
5795.2 5895.4 -2882.6 5765.2 5873
Scaled residuals:
Min 1Q Median 3Q Max
-7.7595 -0.5744 0.1876 0.5450 5.5047
Random effects:
Groups Name Variance Std.Dev. Corr
Chain.:mood.c (Intercept) 7.550e-01 8.689e-01
Valence.c 1.366e+00 1.169e+00 0.47
Item (Intercept) 1.624e+00 1.274e+00
mood.c (Intercept) 3.708e-18 1.926e-09
Valence.c 7.777e-14 2.789e-07 1.00
Number of obs: 5888, groups: Chain.:mood.c, 92; Item, 16; mood.c, 2
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.43895 0.33331 1.317 0.1879
Posn.c -0.54789 0.03153 -17.378 <2e-16 ***
mood.c -0.23004 0.19436 -1.184 0.2366
Valence.c 1.64397 0.65245 2.520 0.0117 *
Posn.c:mood.c -0.07000 0.06141 -1.140 0.2543
Posn.c:Valence.c 0.06144 0.06301 0.975 0.3295
mood.c:Valence.c -0.05999 0.28123 -0.213 0.8311
Posn.c:mood.c:Valence.c 0.01498 0.12276 0.122 0.9029
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) Posn.c mood.c Vlnc.c Psn.:. Ps.:V. md.:V.
Posn.c -0.009
mood.c -0.001 0.009
Valence.c 0.025 -0.019 -0.002
Posn.c:md.c 0.001 0.007 -0.014 -0.001
Psn.c:Vlnc. -0.018 0.054 -0.002 -0.009 -0.024
md.c:Vlnc.c -0.002 -0.002 0.399 -0.001 -0.065 0.012
Psn.c:m.:V. -0.001 -0.024 -0.046 0.001 0.060 0.007 -0.019
Negative Binomial:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: Negative Binomial(5.0188) ( log )
Formula: Loss_across.Chain ~ Posn.c * mood.c * Valence.c + (1 + Valence.c | mood.c/Chain)
Data: FinalData_forpoisson
Control: ..3
AIC BIC logLik deviance df.resid
1901.3 1970.4 -935.7 1871.3 721
Scaled residuals:
Min 1Q Median 3Q Max
-1.3727 -0.7404 -0.5037 0.4609 7.3896
Random effects:
Groups Name Variance Std.Dev. Corr
Chain:mood.c (Intercept) 1.989e-13 4.46e-07
Valence.c 3.589e-13 5.99e-07 1.00
mood.c (Intercept) 0.000e+00 0.00e+00
Valence.c 1.690e-14 1.30e-07 NaN
Number of obs: 736, groups: Chain:mood.c, 92; mood.c, 2
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.19375 0.04797 -4.039 5.37e-05 ***
Posn.c -0.61020 0.04124 -14.798 < 2e-16 ***
mood.c 0.04862 0.09597 0.507 0.61242
Valence.c -0.27487 0.09594 -2.865 0.00417 **
Posn.c:mood.c -0.04232 0.08252 -0.513 0.60803
Posn.c:Valence.c 0.38080 0.08247 4.617 3.89e-06 ***
mood.c:Valence.c 0.13272 0.19194 0.691 0.48929
Posn.c:mood.c:Valence.c 0.05143 0.16504 0.312 0.75534
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) Posn.c mood.c Vlnc.c Psn.:. Ps.:V. md.:V.
Posn.c 0.491
mood.c -0.014 0.007
Valence.c 0.030 -0.090 -0.036
Posn.c:md.c 0.007 -0.008 0.492 -0.021
Psn.c:Vlnc. -0.090 0.063 -0.021 0.491 -0.030
md.c:Vlnc.c -0.036 -0.021 0.027 -0.014 -0.091 0.007
Psn.c:m.:V. -0.021 -0.030 -0.091 0.007 0.060 -0.008 0.492

Resources