Import Libraries

library(MuMIn)
library(ggplot2)
library(lme4)
library(extrafont)
library(ggbeeswarm)
options(scipen=999)

Cognition Analysis

learning <- read.csv("mazeData.csv")

# Did pheasants learn the maze task (errors)

m1 <- glmer(NumErrors ~ TrialNumber + Sex + Group + (1|Bird), data=learning, family = poisson(link=log), na.action="na.fail")
summary(m1)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: poisson  ( log )
## Formula: NumErrors ~ TrialNumber + Sex + Group + (1 | Bird)
##    Data: learning
## 
##      AIC      BIC   logLik deviance df.resid 
##   4603.9   4626.1  -2297.0   4593.9      619 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.8277 -1.5327 -0.5791  0.6057 13.1994 
## 
## Random effects:
##  Groups Name        Variance Std.Dev.
##  Bird   (Intercept) 0.2944   0.5426  
## Number of obs: 624, groups:  Bird, 78
## 
## Fixed effects:
##                    Estimate Std. Error z value             Pr(>|z|)    
## (Intercept)        1.484583   0.111783  13.281 < 0.0000000000000002 ***
## TrialNumber       -0.050948   0.008641  -5.896        0.00000000372 ***
## SexM              -0.061897   0.130985  -0.473                0.637    
## GroupExperimental  0.058010   0.131821   0.440                0.660    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) TrlNmb SexM  
## TrialNumber -0.327              
## SexM        -0.531  0.000       
## GrpExprmntl -0.491  0.000 -0.048
output <- dredge(m1)
output
## Global model call: glmer(formula = NumErrors ~ TrialNumber + Sex + Group + (1 | 
##     Bird), data = learning, family = poisson(link = log), na.action = "na.fail")
## ---
## Model selection table 
##   (Intrc) Group Sex    TrlNm df    logLik   AICc delta weight
## 5   1.481           -0.05095  3 -2297.158 4600.4  0.00  0.511
## 7   1.509         + -0.05095  4 -2297.057 4602.2  1.82  0.205
## 6   1.456     +     -0.05095  4 -2297.071 4602.2  1.85  0.202
## 8   1.485     +   + -0.05095  5 -2296.960 4604.0  3.66  0.082
## 1   1.258                     2 -2314.405 4632.8 32.47  0.000
## 3   1.286         +           3 -2314.303 4634.6 34.29  0.000
## 2   1.234     +               3 -2314.318 4634.7 34.32  0.000
## 4   1.262     +   +           4 -2314.207 4636.5 36.12  0.000
## Models ranked by AICc(x) 
## Random terms (all models): 
## '1 | Bird'
est.output<-model.avg(output, subset= delta < 2, revised.var = TRUE)
summary(est.output)
## 
## Call:
## model.avg(object = output, subset = delta < 2, revised.var = TRUE)
## 
## Component model call: 
## glmer(formula = NumErrors ~ <3 unique rhs>, data = learning, family = 
##      poisson(link = log), na.action = na.fail)
## 
## Component models: 
##    df   logLik    AICc delta weight
## 3   3 -2297.16 4600.36  0.00   0.56
## 23  4 -2297.06 4602.18  1.82   0.22
## 13  4 -2297.07 4602.21  1.85   0.22
## 
## Term codes: 
##       Group         Sex TrialNumber 
##           1           2           3 
## 
## Model-averaged coefficients:  
## (full average) 
##                    Estimate Std. Error Adjusted SE z value            Pr(>|z|)
## (Intercept)        1.481487   0.086937    0.087100  17.009 <0.0000000000000002
## TrialNumber       -0.050947   0.008641    0.008658   5.884 <0.0000000000000002
## SexM              -0.013220   0.066629    0.066741   0.198               0.843
## GroupExperimental  0.012133   0.065997    0.066111   0.184               0.854
##                      
## (Intercept)       ***
## TrialNumber       ***
## SexM                 
## GroupExperimental    
##  
## (conditional average) 
##                    Estimate Std. Error Adjusted SE z value            Pr(>|z|)
## (Intercept)        1.481487   0.086937    0.087100  17.009 <0.0000000000000002
## TrialNumber       -0.050947   0.008641    0.008658   5.884 <0.0000000000000002
## SexM              -0.059137   0.130932    0.131188   0.451               0.652
## GroupExperimental  0.055070   0.131930    0.132188   0.417               0.677
##                      
## (Intercept)       ***
## TrialNumber       ***
## SexM                 
## GroupExperimental    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(data=learning)+
    geom_beeswarm(aes(x=TrialNumber,y=NumErrors),size=0.005, cex=0.1)+
    geom_smooth(aes(x=TrialNumber, y=NumErrors), col="grey4", method="lm")+
    scale_x_continuous(expand=c(0,0),name="Trial Number", limits=c(0,9), breaks=seq(1,8,1))+
    scale_y_continuous(name="Number of Errors", limits=c(-2,max(learning$NumErrors)),breaks=seq(0,45,5), expand=c(0,0))+
    theme(text=element_text(family="Calibri"))+
    guides(col=F)+
    theme_classic()

## Did birds vary in orientation strategy? ##

orient<- read.csv("mazeRotationResults.csv")

g1 <- glm(binStrat~Sex*Group, family=binomial(link="logit"),data=orient, na.action="na.fail")
summary(g1)
## 
## Call:
## glm(formula = binStrat ~ Sex * Group, family = binomial(link = "logit"), 
##     data = orient, na.action = "na.fail")
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.2278  -0.6039  -0.5701   1.1278   1.9479  
## 
## Coefficients:
##                        Estimate Std. Error z value Pr(>|z|)   
## (Intercept)             -1.6094     0.5477  -2.938   0.0033 **
## SexM                    -0.1252     0.8319  -0.150   0.8804   
## GroupExperimental        1.7272     0.7322   2.359   0.0183 * 
## SexM:GroupExperimental   0.1252     1.0790   0.116   0.9077   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 97.852  on 77  degrees of freedom
## Residual deviance: 85.552  on 74  degrees of freedom
## AIC: 93.552
## 
## Number of Fisher Scoring iterations: 3
dredge(g1)
## Global model call: glm(formula = binStrat ~ Sex * Group, family = binomial(link = "logit"), 
##     data = orient, na.action = "na.fail")
## ---
## Model selection table 
##     (Int) Grp Sex Grp:Sex df  logLik  AICc delta weight
## 2 -1.6650   +              2 -42.787  89.7  0.00  0.684
## 4 -1.6420   +   +          3 -42.783  91.9  2.16  0.233
## 8 -1.6090   +   +       +  4 -42.776  94.1  4.37  0.077
## 1 -0.7514                  1 -48.926  99.9 10.17  0.004
## 3 -0.7673       +          2 -48.924 102.0 12.27  0.001
## Models ranked by AICc(x)
#summary top model - treatment only
summary(glm(binStrat~Group, family=binomial(link="logit"),data=orient))
## 
## Call:
## glm(formula = binStrat ~ Group, family = binomial(link = "logit"), 
##     data = orient)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.2278  -0.5887  -0.5887   1.1278   1.9174  
## 
## Coefficients:
##                   Estimate Std. Error z value  Pr(>|z|)    
## (Intercept)        -1.6650     0.4122  -4.040 0.0000535 ***
## GroupExperimental   1.7828     0.5366   3.322  0.000892 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 97.852  on 77  degrees of freedom
## Residual deviance: 85.574  on 76  degrees of freedom
## AIC: 89.574
## 
## Number of Fisher Scoring iterations: 3
## Plots ##

ggplot(data=orient, aes(x=Group, fill=Strat))+
    geom_bar(position="dodge", size=0)+
    scale_fill_manual(values=c("royalblue","gold3"))+
    scale_y_continuous(expand=c(0,0), limits=c(0,50))+
    #facet_grid(cols=vars(Group))+
    xlab("Condition")+
    ylab("Number of Birds") + 
    theme_classic() +
    theme(legend.position="none",text=element_text(family="Calibri"))

orient2 <- orient[orient$Group=="Experimental",]

ggplot(data=orient2, aes(x=Diff, fill=Strat))+
    geom_histogram(breaks=seq(-10,30,by=1), size=0)+
    scale_fill_manual(values=c("royalblue","gold3"))+
    scale_y_continuous(expand=c(0,0), limits=c(0,8), breaks=seq(0,8,1))+
    scale_x_continuous(expand=c(0,0), limits=c(-10,35), breaks=seq(-10,30,5))+
    xlab("Difference in Errors \n(Probe Trial - Final Training Trial)")+
    ylab("Number of Birds") + 
    theme_classic() +
    theme(legend.position="none",text=element_text(family="Calibri"))

Habitat Selection analysis

# Habitat selection
set.seed(106)

all_RSS <- read.csv("habitatOrientation_coefs.csv") #coefs and logrss values for each ind
all_RSS$strategy <- factor(all_RSS$strategy, levels= c("Egocentric", "Allocentric")) # change reference level to get allocentric estimates instead of mixed/ego birds. Clearer to explain. 
all_avail <- read.csv("habitatOrientation_avail.csv") #availability of habitats for each ind

# selection  (RSS)
rss_data <- all_RSS[all_RSS$key=="log_RSS_wood2other",]
rss_data <- merge(rss_data, all_avail, by = "id")
rss_data$fig_strategy <- factor(rss_data$strategy, levels=c("Allocentric", "Egocentric"))

ggplot(data= rss_data, aes(x=fig_strategy, y=mean, col=strategy)) +
  geom_boxplot(show.legend = F, outlier.shape = NA)+
  geom_pointrange(aes(ymin = lq, ymax = uq, alpha = inv_se), size=0.3,
                  position=position_jitterdodge(), show.legend = F) +
  scale_color_manual(values=c( "gold3","royalblue"))+
  theme_classic()+
  theme(text=element_text(family="Calibri"), axis.text.x = element_text(size=7))+
  scale_x_discrete(labels=c("Allocentric" = "Allocentric", "Egocentric" = "Mixed/Egocentric"))+
  geom_hline(yintercept = 0, lty = 2) +
  labs(x = "Strategy", y = "log-RSS")

habitat_glm <- glm(mean ~ sex * strategy + Avail_Habitat_other, data = rss_data, weight = inv_se, na.action="na.fail")
habitat_output <- dredge(habitat_glm, fixed = c("Avail_Habitat_other"))
habitat_output
## Global model call: glm(formula = mean ~ sex * strategy + Avail_Habitat_other, data = rss_data, 
##     weights = inv_se, na.action = "na.fail")
## ---
## Model selection table 
##     (Int) Avl_Hbt_oth sex str sex:str df logLik  AICc delta weight
## 1 -0.5593  0.00001277                  3 14.510 -21.5  0.00  0.564
## 3 -0.5830  0.00001251       +          4 15.243 -19.8  1.70  0.241
## 2 -0.5647  0.00001227   +              4 14.621 -18.6  2.95  0.129
## 4 -0.5984  0.00001150   +   +          5 15.636 -17.0  4.53  0.058
## 8 -0.5809  0.00001163   +   +       +  6 15.747 -13.0  8.49  0.008
## Models ranked by AICc(x)
habitat_est.output <- model.avg(habitat_output, subset= delta < 2, revised.var = TRUE)
summary(habitat_est.output)
## 
## Call:
## model.avg(object = habitat_output, subset = delta < 2, revised.var = TRUE)
## 
## Component model call: 
## glm(formula = mean ~ <2 unique rhs>, data = rss_data, weights = inv_se, 
##      na.action = na.fail)
## 
## Component models: 
##    df logLik   AICc delta weight
## 1   3  14.51 -21.52   0.0    0.7
## 12  4  15.24 -19.82   1.7    0.3
## 
## Term codes: 
## Avail_Habitat_other            strategy 
##                   1                   2 
## 
## Model-averaged coefficients:  
## (full average) 
##                         Estimate   Std. Error  Adjusted SE z value
## (Intercept)         -0.566382312  0.052888617  0.056612392  10.005
## Avail_Habitat_other  0.000012691  0.000002836  0.000003044   4.170
## strategyAllocentric  0.015152736  0.033633985  0.035007083   0.433
##                                 Pr(>|z|)    
## (Intercept)         < 0.0000000000000002 ***
## Avail_Habitat_other            0.0000305 ***
## strategyAllocentric                0.665    
##  
## (conditional average) 
##                         Estimate   Std. Error  Adjusted SE z value
## (Intercept)         -0.566382312  0.052888617  0.056612392  10.005
## Avail_Habitat_other  0.000012691  0.000002836  0.000003044   4.170
## strategyAllocentric  0.050629435  0.044538001  0.047943212   1.056
##                                 Pr(>|z|)    
## (Intercept)         < 0.0000000000000002 ***
## Avail_Habitat_other            0.0000305 ***
## strategyAllocentric                0.291    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
What about that outlier that does not select for woodland?
rss_data2 <- rss_data[rss_data$mean<0,]

ggplot(data= rss_data2, aes(x=fig_strategy, y=mean, col=strategy)) +
    geom_boxplot(show.legend = F, outlier.shape = NA)+
    geom_pointrange(aes(ymin = lq, ymax = uq, alpha = inv_se), size=0.3,
                    position=position_jitterdodge(), show.legend = F) +
    scale_color_manual(values=c( "gold3","royalblue"))+
    theme_classic()+
    theme(text=element_text(family="Calibri"), axis.text.x = element_text(size=7))+
    scale_x_discrete(labels=c("Allocentric" = "Allocentric", "Egocentric" = "Mixed/Egocentric"))+
    geom_hline(yintercept = 0, lty = 2) +
    labs(x = "Strategy", y = "log-RSS", tag="a")

habitat_glm <- glm(mean ~ sex * strategy + Avail_Habitat_other, data = rss_data2, weight = inv_se, na.action="na.fail")
habitat_output <- dredge(habitat_glm, fixed = c("Avail_Habitat_other"))
habitat_output
## Global model call: glm(formula = mean ~ sex * strategy + Avail_Habitat_other, data = rss_data2, 
##     weights = inv_se, na.action = "na.fail")
## ---
## Model selection table 
##     (Int) Avl_Hbt_oth sex str sex:str df logLik  AICc delta weight
## 1 -0.5780  0.00001370                  3 20.380 -33.2  0.00  0.552
## 3 -0.5977  0.00001346       +          4 21.316 -31.8  1.39  0.276
## 2 -0.5800  0.00001350   +              4 20.409 -30.0  3.20  0.111
## 4 -0.6065  0.00001285   +   +          5 21.563 -28.5  4.65  0.054
## 8 -0.5926  0.00001295   +   +       +  6 21.688 -24.4  8.78  0.007
## Models ranked by AICc(x)
habitat_est.output <- model.avg(habitat_output, subset= delta < 2, revised.var = TRUE)
summary(habitat_est.output)
## 
## Call:
## model.avg(object = habitat_output, subset = delta < 2, revised.var = TRUE)
## 
## Component model call: 
## glm(formula = mean ~ <2 unique rhs>, data = rss_data2, weights = 
##      inv_se, na.action = na.fail)
## 
## Component models: 
##    df logLik   AICc delta weight
## 1   3  20.38 -33.16  0.00   0.67
## 12  4  21.32 -31.77  1.39   0.33
## 
## Term codes: 
## Avail_Habitat_other            strategy 
##                   1                   2 
## 
## Model-averaged coefficients:  
## (full average) 
##                         Estimate   Std. Error  Adjusted SE z value
## (Intercept)         -0.584529560  0.040240575  0.043229689  13.521
## Avail_Habitat_other  0.000013623  0.000002142  0.000002308   5.901
## strategyAllocentric  0.014253783  0.027821499  0.028922734   0.493
##                                Pr(>|z|)    
## (Intercept)         <0.0000000000000002 ***
## Avail_Habitat_other <0.0000000000000002 ***
## strategyAllocentric               0.622    
##  
## (conditional average) 
##                         Estimate   Std. Error  Adjusted SE z value
## (Intercept)         -0.584529560  0.040240575  0.043229689  13.521
## Avail_Habitat_other  0.000013623  0.000002142  0.000002308   5.901
## strategyAllocentric  0.042749291  0.033215808  0.035926358   1.190
##                                Pr(>|z|)    
## (Intercept)         <0.0000000000000002 ***
## Avail_Habitat_other <0.0000000000000002 ***
## strategyAllocentric               0.234    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# speed
speed_data <- all_RSS[all_RSS$key%in% c("mean_speed_wood", "mean_speed_other"),]
speed_data$key <- factor(speed_data$key, levels=c("mean_speed_wood", "mean_speed_other"), labels = c("Wood", "Other"))

ggplot(data= speed_data, aes(x=sex, y=mean, col=key)) +
  geom_boxplot()+
  geom_pointrange(aes(ymin = lq, ymax = uq, alpha = inv_se),
                  size = 0.3, position=position_jitterdodge(), show.legend = F) +
  scale_color_manual(values=c("forestgreen", "purple"))+
  theme_classic()+
  theme(legend.position = "none",text=element_text(family="Calibri"))+
  scale_y_continuous(limits=c(0,60), expand= c(0,0))+
  guides(col = guide_legend(title="Habitat"))+
  labs(x = "Sex", y = "Mean Displacement Distance (m/5min)")

speed_glm <- glm(mean~ sex * strategy * key, data=speed_data, weight= inv_se,na.action="na.fail")
speed_output <- dredge(speed_glm)
speed_output #only 1 model
## Global model call: glm(formula = mean ~ sex * strategy * key, data = speed_data, 
##     weights = inv_se, na.action = "na.fail")
## ---
## Model selection table 
##     (Int) key sex str key:sex key:str sex:str key:sex:str df   logLik  AICc
## 12  20.91   +   +           +                              5  -67.565 146.9
## 16  21.00   +   +   +       +                              6  -67.447 149.4
## 48  21.12   +   +   +       +               +              7  -67.296 152.1
## 32  21.02   +   +   +       +       +                      7  -67.431 152.4
## 4   20.60   +   +                                          4  -72.310 153.8
## 64  21.12   +   +   +       +       +       +              8  -67.293 155.2
## 8   20.70   +   +   +                                      5  -72.195 156.2
## 128 20.99   +   +   +       +       +       +           +  9  -66.593 157.2
## 40  20.86   +   +   +                       +              6  -71.987 158.5
## 24  20.68   +   +   +               +                      6  -72.173 158.9
## 56  20.83   +   +   +               +       +              7  -71.928 161.4
## 2   21.54   +                                              3  -82.644 172.0
## 6   21.73   +       +                                      4  -82.291 173.7
## 22  21.70   +       +               +                      5  -82.272 176.3
## 3   21.76       +                                          3 -110.359 227.4
## 7   21.72       +   +                                      4 -110.355 229.9
## 39  21.84       +   +                       +              5 -110.336 232.4
## 1   23.36                                                  2 -114.727 233.8
## 5   23.48           +                                      3 -114.701 236.1
##     delta weight
## 12   0.00  0.672
## 16   2.55  0.188
## 48   5.20  0.050
## 32   5.47  0.044
## 4    6.87  0.022
## 64   8.34  0.010
## 8    9.26  0.007
## 128 10.29  0.004
## 40  11.63  0.002
## 24  12.00  0.002
## 56  14.46  0.000
## 2   25.06  0.000
## 6   26.83  0.000
## 22  29.42  0.000
## 3   80.49  0.000
## 7   82.96  0.000
## 39  85.54  0.000
## 1   86.88  0.000
## 5   89.17  0.000
## Models ranked by AICc(x)
speed_glm <- glm(mean~ sex * key, data=speed_data, weight= inv_se,na.action="na.fail")
summary(speed_glm)
## 
## Call:
## glm(formula = mean ~ sex * key, data = speed_data, weights = inv_se, 
##     na.action = "na.fail")
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -119.334   -33.184     3.744    29.514   146.101  
## 
## Coefficients:
##               Estimate Std. Error t value             Pr(>|t|)    
## (Intercept)    20.9135     0.2730  76.614 < 0.0000000000000002 ***
## sexM            1.2174     0.3814   3.192              0.00293 ** 
## keyOther        4.1919     0.6057   6.921         0.0000000417 ***
## sexM:keyOther   2.3189     0.7469   3.105              0.00370 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for gaussian family taken to be 3544.053)
## 
##     Null deviance: 1348702  on 39  degrees of freedom
## Residual deviance:  127586  on 36  degrees of freedom
## AIC: 145.13
## 
## Number of Fisher Scoring iterations: 2
#directionality

dir_data <- all_RSS[all_RSS$key%in% c("cos_ta_", "habitat_start_cos_ta"),]
dir_data$key <- factor(dir_data$key, levels=c("cos_ta_", "habitat_start_cos_ta"), labels = c("Wood", "Other"))


ggplot(data= dir_data, aes(x=sex, y=mean, col=key)) +
  geom_boxplot()+
  geom_pointrange(aes(ymin = lq, ymax = uq, alpha = inv_se),
                  size = 0.3, position=position_jitterdodge(), show.legend = F) +
  scale_color_manual(values=c("forestgreen", "purple"))+
  theme_classic()+
  theme(legend.position = "none",text=element_text(family="Calibri"))+
  guides(col = guide_legend(title="Habitat"))+
  geom_hline(yintercept = 0, lty = 2) +
  labs(x = "Sex", y = expression(paste("iSSA cos(turning angle) ", beta ," coefficient")))

dir_glm <- glm(mean~ strategy * key * sex, data=dir_data, weights = inv_se,na.action="na.fail")
dir_output <- dredge(dir_glm)
dir_output
## Global model call: glm(formula = mean ~ strategy * key * sex, data = dir_data, weights = inv_se, 
##     na.action = "na.fail")
## ---
## Model selection table 
##       (Int) key sex str key:sex key:str sex:str key:sex:str df logLik  AICc
## 4   -0.8168   +   +                                          4 14.681 -20.2
## 12  -0.7974   +   +           +                              5 15.311 -18.9
## 8   -0.8029   +   +   +                                      5 14.819 -17.9
## 16  -0.7834   +   +   +       +                              6 15.455 -16.4
## 40  -0.7733   +   +   +                       +              6 15.126 -15.7
## 24  -0.7965   +   +   +               +                      6 14.865 -15.2
## 48  -0.7540   +   +   +       +               +              7 15.768 -14.0
## 32  -0.7725   +   +   +       +       +                      7 15.566 -13.6
## 3   -0.7785       +                                          3  9.741 -12.8
## 56  -0.7717   +   +   +               +       +              7 15.134 -12.8
## 64  -0.7496   +   +   +       +       +       +              8 15.812 -11.0
## 7   -0.7650       +   +                                      4  9.841 -10.5
## 39  -0.7351       +   +                       +              5 10.085  -8.4
## 128 -0.7693   +   +   +       +       +       +           +  9 16.166  -8.3
## 2   -0.7064   +                                              3  6.117  -5.6
## 6   -0.6792   +       +                                      4  6.585  -4.0
## 22  -0.6706   +       +               +                      5  6.647  -1.5
## 1   -0.6260                                                  2  0.257   3.8
## 5   -0.5963           +                                      3  0.691   5.3
##     delta weight
## 4    0.00  0.434
## 12   1.36  0.220
## 8    2.35  0.134
## 16   3.86  0.063
## 40   4.51  0.045
## 24   5.03  0.035
## 48   6.18  0.020
## 32   6.59  0.016
## 3    7.40  0.011
## 56   7.45  0.010
## 64   9.24  0.004
## 7    9.68  0.003
## 39  11.81  0.001
## 128 11.89  0.001
## 2   14.65  0.000
## 6   16.19  0.000
## 22  18.69  0.000
## 1   24.03  0.000
## 5   25.50  0.000
## Models ranked by AICc(x)
dir_est.output<-model.avg(dir_output, subset= delta < 2, revised.var = TRUE)
summary(dir_est.output)
## 
## Call:
## model.avg(object = dir_output, subset = delta < 2, revised.var = TRUE)
## 
## Component model call: 
## glm(formula = mean ~ <2 unique rhs>, data = dir_data, weights = inv_se, 
##      na.action = na.fail)
## 
## Component models: 
##     df logLik   AICc delta weight
## 12   4  14.68 -20.22  0.00   0.66
## 123  5  15.31 -18.86  1.36   0.34
## 
## Term codes: 
##     key     sex key:sex 
##       1       2       3 
## 
## Model-averaged coefficients:  
## (full average) 
##               Estimate Std. Error Adjusted SE z value             Pr(>|z|)    
## (Intercept)   -0.81032    0.03977     0.04106  19.736 < 0.0000000000000002 ***
## keyOther       0.11620    0.06690     0.06863   1.693             0.090419 .  
## sexM           0.18887    0.05173     0.05332   3.542             0.000397 ***
## keyOther:sexM  0.03409    0.07281     0.07426   0.459             0.646168    
##  
## (conditional average) 
##               Estimate Std. Error Adjusted SE z value             Pr(>|z|)    
## (Intercept)   -0.81032    0.03977     0.04106  19.736 < 0.0000000000000002 ***
## keyOther       0.11620    0.06690     0.06863   1.693             0.090419 .  
## sexM           0.18887    0.05173     0.05332   3.542             0.000397 ***
## keyOther:sexM  0.10147    0.09457     0.09786   1.037             0.299758    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1