1
$\begingroup$

I used the model:

Model1 <- glm(disease ~ Distance_ue + Pop_density + Alt + Ave.temp + Ave.precip + 
                        Urban.Rural + (1| Sites), family=gaussian)

I then used the dredge function to obtain an AICc results table.

Model selection results for models predicting the effect of various predictor variables on disease (presence or absence) in birds in 10 research sites. Site was used as a random term. Predictor variables were classification of Urban / Rural (categorical - either labelled as urban or rural), distance to the urban edge (continuous), population density (continuous), altitude (continuous), average temperature (continuous) and average precipitation (continuous).

The issue I have is that in the results table there is no parameter estimate given for classification of urban or rural which is the categorical variable - it only gives a $\pm$ sign (please see image below for the results table). Is this normal? Why is it doing this?

AICc results table

$\endgroup$
  • 1
    $\begingroup$ When you use a function not in the vanilla distribution of R, please state the package it's from. I presume you mean the dredge function in package MuMin. Is that correct? $\endgroup$ – Glen_b -Reinstate Monica May 4 '14 at 21:15
2
$\begingroup$

This is normal and you need to use coefficients(Model1) like what I did in the example below to find the estimated parameters.

> require(MuMIn)
> counts <- c(18,17,15,20,10,20,25,13,12)
> outcome <- gl(3,1,9)
> treatment <- gl(3,3)
> glm.D93 <- glm(counts ~ outcome + treatment+outcome*treatment, family = poisson())
> d=dredge(glm.D93)
> print(d)
Global model call: glm(formula = counts ~ outcome + treatment + outcome * treatment, 
    family = poisson())
---
Model selection table 
  (Int) otc trt otc:trt df logLik  AICc   delta  weight
8 2.890 +   +   +       9  -20.816 -120.4   0.00 1     
1 2.813                 1  -26.107   54.8 175.15 0     
2 3.045 +               3  -23.381   57.6 177.93 0     
3 2.813     +           3  -26.107   63.0 183.38 0     
4 3.045 +   +           5  -23.381   76.8 197.13 0     
> coefficients(d)
  (Intercept)    outcome2   outcome3   treatment2   treatment3 outcome2:treatment2 outcome3:treatment2 outcome2:treatment3 outcome3:treatment3
8    2.890372 -0.05715841 -0.1823216 1.053605e-01 3.285041e-01          -0.6359888           0.1823216          -0.5967681          -0.5516476
1    2.813411          NA         NA           NA           NA                  NA                  NA                  NA                  NA
2    3.044522 -0.45425527 -0.2929871           NA           NA                  NA                  NA                  NA                  NA
3    2.813411          NA         NA 8.933946e-14 1.006395e-12                  NA                  NA                  NA                  NA
4    3.044522 -0.45425527 -0.2929871 8.716884e-16 4.557335e-16                  NA                  NA                  NA                  NA

You can try str to see what else you can extract like below:

> str(d)
Classes ‘model.selection’ and 'data.frame':     5 obs. of  9 variables:
 $ (Intercept)      : num  2.89 2.81 3.04 2.81 3.04
     $ outcome          : Factor w/ 1 level "+": 1 NA 1 NA 1
 $ treatment        : Factor w/ 1 level "+": 1 NA NA 1 1
     $ outcome:treatment: Factor w/ 1 level "+": 1 NA NA NA NA
 $ df               : num  9 1 3 3 5
     $ logLik           : num  -20.8 -26.1 -23.4 -26.1 -23.4
 $ AICc             : num  -120.4 54.8 57.6 63 76.8
     $ delta            : num  0 175 178 183 197
 $ weight           : num  1.00 9.25e-39 2.31e-39 1.51e-40 1.56e-43
     - attr(*, "calls")=List of 5
      ..$ 8: language glm(formula = counts ~ outcome + treatment + outcome:treatment + 1, family = poisson())
  ..$ 1: language glm(formula = counts ~ 1, family = poisson())
      ..$ 2: language glm(formula = counts ~ outcome + 1, family = poisson())
  ..$ 3: language glm(formula = counts ~ treatment + 1, family = poisson())
      ..$ 4: language glm(formula = counts ~ outcome + treatment + 1, family = poisson())
 - attr(*, "global")=List of 30
  ..$ coefficients     : Named num  2.8904 -0.0572 -0.1823 0.1054 0.3285 ...
      .. ..- attr(*, "names")= chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
      ..$ residuals        : Named num  -7.89e-16 -6.27e-16 -4.74e-16 -7.11e-16 -1.07e-15 ...
  .. ..- attr(*, "names")= chr  "1" "2" "3" "4" ...
  ..$ fitted.values    : Named num  18 17 15 20 10 ...
      .. ..- attr(*, "names")= chr  "1" "2" "3" "4" ...
      ..$ effects          : Named num  -34.8891 1.7379 1.4563 -0.0294 -0.0219 ...
  .. ..- attr(*, "names")= chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
  ..$ R                : num [1:9, 1:9] -12.2 0 0 0 0 ...
      .. ..- attr(*, "dimnames")=List of 2
      .. .. ..$ : chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
  .. .. ..$ : chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
      ..$ rank             : int 9
  ..$ qr               :List of 5
      .. ..$ qr   : num [1:9, 1:9] -12.247 0.337 0.316 0.365 0.258 ...
  .. .. ..- attr(*, "dimnames")=List of 2
  .. .. .. ..$ : chr  "1" "2" "3" "4" ...
      .. .. .. ..$ : chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
  .. ..$ rank : int 9
      .. ..$ qraux: num  1.35 1.61 1.52 1.54 1.2 ...
  .. ..$ pivot: int  1 2 3 4 5 6 7 8 9
      .. ..$ tol  : num 1e-11
  .. ..- attr(*, "class")= chr "qr"
  ..$ family           :List of 12
      .. ..$ family    : chr "poisson"
  .. ..$ link      : chr "log"
      .. ..$ linkfun   :function (mu)  
  .. ..$ linkinv   :function (eta)  
      .. ..$ variance  :function (mu)  
  .. ..$ dev.resids:function (y, mu, wt)  
      .. ..$ aic       :function (y, n, mu, wt, dev)  
  .. ..$ mu.eta    :function (eta)  
      .. ..$ initialize:  expression({     if (any(y < 0))          stop("negative values not allowed for the 'Poisson' family")     n <- rep.int(1, nobs)     mustart <- y + 0.1 })
  .. ..$ validmu   :function (mu)  
      .. ..$ valideta  :function (eta)  
  .. ..$ simulate  :function (object, nsim)  
      .. ..- attr(*, "class")= chr "family"
      ..$ linear.predictors: Named num  2.89 2.83 2.71 3 2.3 ...
  .. ..- attr(*, "names")= chr  "1" "2" "3" "4" ...
  ..$ deviance         : num 3.77e-15
      ..$ aic              : num 59.6
  ..$ null.deviance    : num 10.6
      ..$ iter             : int 3
  ..$ weights          : Named num  18 17 15 20 10 ...
      .. ..- attr(*, "names")= chr  "1" "2" "3" "4" ...
      ..$ prior.weights    : Named num  1 1 1 1 1 1 1 1 1
  .. ..- attr(*, "names")= chr  "1" "2" "3" "4" ...
  ..$ df.residual      : int 0
      ..$ df.null          : int 8
  ..$ y                : Named num  18 17 15 20 10 20 25 13 12
      .. ..- attr(*, "names")= chr  "1" "2" "3" "4" ...
      ..$ converged        : logi TRUE
  ..$ boundary         : logi FALSE
      ..$ model            :'data.frame':   9 obs. of  3 variables:
  .. ..$ counts   : num  18 17 15 20 10 20 25 13 12
      .. ..$ outcome  : Factor w/ 3 levels "1","2","3": 1 2 3 1 2 3 1 2 3
  .. ..$ treatment: Factor w/ 3 levels "1","2","3": 1 1 1 2 2 2 3 3 3
      .. ..- attr(*, "terms")=Classes 'terms', 'formula' length 3 counts ~ outcome + treatment + outcome * treatment
      .. .. .. ..- attr(*, "variables")= language list(counts, outcome, treatment)
      .. .. .. ..- attr(*, "factors")= int [1:3, 1:3] 0 1 0 0 0 1 0 1 1
      .. .. .. .. ..- attr(*, "dimnames")=List of 2
      .. .. .. .. .. ..$ : chr [1:3] "counts" "outcome" "treatment"
  .. .. .. .. .. ..$ : chr [1:3] "outcome" "treatment" "outcome:treatment"
      .. .. .. ..- attr(*, "term.labels")= chr [1:3] "outcome" "treatment" "outcome:treatment"
      .. .. .. ..- attr(*, "order")= int [1:3] 1 1 2
      .. .. .. ..- attr(*, "intercept")= int 1
      .. .. .. ..- attr(*, "response")= int 1
      .. .. .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
      .. .. .. ..- attr(*, "predvars")= language list(counts, outcome, treatment)
      .. .. .. ..- attr(*, "dataClasses")= Named chr [1:3] "numeric" "factor" "factor"
      .. .. .. .. ..- attr(*, "names")= chr [1:3] "counts" "outcome" "treatment"
      ..$ call             : language glm(formula = counts ~ outcome + treatment + outcome * treatment, family = poisson())
  ..$ formula          :Class 'formula' length 3 counts ~ outcome + treatment + outcome * treatment
      .. .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
      ..$ terms            :Classes 'terms', 'formula' length 3 counts ~ outcome + treatment + outcome * treatment
  .. .. ..- attr(*, "variables")= language list(counts, outcome, treatment)
  .. .. ..- attr(*, "factors")= int [1:3, 1:3] 0 1 0 0 0 1 0 1 1
  .. .. .. ..- attr(*, "dimnames")=List of 2
  .. .. .. .. ..$ : chr [1:3] "counts" "outcome" "treatment"
      .. .. .. .. ..$ : chr [1:3] "outcome" "treatment" "outcome:treatment"
  .. .. ..- attr(*, "term.labels")= chr [1:3] "outcome" "treatment" "outcome:treatment"
  .. .. ..- attr(*, "order")= int [1:3] 1 1 2
  .. .. ..- attr(*, "intercept")= int 1
  .. .. ..- attr(*, "response")= int 1
  .. .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
  .. .. ..- attr(*, "predvars")= language list(counts, outcome, treatment)
  .. .. ..- attr(*, "dataClasses")= Named chr [1:3] "numeric" "factor" "factor"
  .. .. .. ..- attr(*, "names")= chr [1:3] "counts" "outcome" "treatment"
  ..$ data             :<environment: R_GlobalEnv> 
      ..$ offset           : NULL
  ..$ control          :List of 3
      .. ..$ epsilon: num 1e-08
  .. ..$ maxit  : num 25
      .. ..$ trace  : logi FALSE
  ..$ method           : chr "glm.fit"
      ..$ contrasts        :List of 2
  .. ..$ outcome  : chr "contr.treatment"
      .. ..$ treatment: chr "contr.treatment"
  ..$ xlevels          :List of 2
      .. ..$ outcome  : chr  "1" "2" "3"
  .. ..$ treatment: chr  "1" "2" "3"
      ..- attr(*, "class")= chr  "glm" "lm"
     - attr(*, "global.call")= language glm(formula = counts ~ outcome + treatment + outcome * treatment, family = poisson())
     - attr(*, "terms")= atomic  (Intercept) outcome treatment outcome:treatment
      ..- attr(*, "interceptLabel")= chr "(Intercept)"
     - attr(*, "rank")=function (x)  
      ..- attr(*, "call")= language AICc(x)
      ..- attr(*, "class")= chr  "function" "ICWithCall"
     - attr(*, "rank.call")= language AICc(x)
     - attr(*, "beta")= logi FALSE
     - attr(*, "call")= language dredge(global.model = glm.D93)
     - attr(*, "coefTables")=List of 5
      ..$ : coefTable [1:9, 1:3] 2.8904 -0.0572 -0.1823 0.1054 0.3285 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
      .. .. ..$ : chr  "Estimate" "Std. Error" "df"
  .. ..- attr(*, "class")= chr  "coefTable" "matrix"
  ..$ : coefTable [1, 1:3] 2.8134 0.0816 8
      .. ..- attr(*, "dimnames")=List of 2
      .. .. ..$ : chr "(Intercept)"
  .. .. ..$ : chr  "Estimate" "Std. Error" "df"
      .. ..- attr(*, "class")= chr  "coefTable" "matrix"
      ..$ : coefTable [1:3, 1:3] 3.045 -0.454 -0.293 0.126 0.202 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr  "(Intercept)" "outcome2" "outcome3"
      .. .. ..$ : chr  "Estimate" "Std. Error" "df"
  .. ..- attr(*, "class")= chr  "coefTable" "matrix"
  ..$ : coefTable [1:3, 1:3] 2.81 8.93e-14 1.01e-12 1.41e-01 2.00e-01 ...
      .. ..- attr(*, "dimnames")=List of 2
      .. .. ..$ : chr  "(Intercept)" "treatment2" "treatment3"
  .. .. ..$ : chr  "Estimate" "Std. Error" "df"
      .. ..- attr(*, "class")= chr  "coefTable" "matrix"
      ..$ : coefTable [1:5, 1:3] 3.04 -4.54e-01 -2.93e-01 8.72e-16 4.56e-16 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr  "(Intercept)" "outcome2" "outcome3" "treatment2" ...
      .. .. ..$ : chr  "Estimate" "Std. Error" "df"
  .. ..- attr(*, "class")= chr  "coefTable" "matrix"
 - attr(*, "nobs")= int 9
> 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.