Skip to content
Prev 1310 / 20628 Next

binomial fixed-effect p-values by simulation

On Mon, Aug 25, 2008 at 8:56 AM, Ben Bolker <bolker at ufl.edu> wrote:
(covers face and runs away screaming).

Umm, please don't use grep on names to determine which coefficients
are associated with a given factor.  That's what the terms and assign
attributes are for.

You split the fixed effects according to assign, as in the code for
the anova method.  For example
Classes 'terms', 'formula' length 3 r2 ~ btype + situ + mode + Gender * Anger
  ..- attr(*, "variables")= language list(r2, btype, situ, mode, Gender, Anger)
  ..- attr(*, "factors")= int [1:6, 1:6] 0 1 0 0 0 0 0 0 1 0 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:6] "r2" "btype" "situ" "mode" ...
  .. .. ..$ : chr [1:6] "btype" "situ" "mode" "Gender" ...
  ..- attr(*, "term.labels")= chr [1:6] "btype" "situ" "mode" "Gender" ...
  ..- attr(*, "order")= int [1:6] 1 1 1 1 1 2
  ..- attr(*, "intercept")= int 1
  ..- attr(*, "response")= int 1
  ..- attr(*, ".Environment")=<environment: R_GlobalEnv>
  ..- attr(*, "predvars")= language list(r2, btype, situ, mode, Gender, Anger)
  ..- attr(*, "dataClasses")= Named chr [1:6] "factor" "factor"
"factor" "factor" ...
  .. ..- attr(*, "names")= chr [1:6] "r2" "btype" "situ" "mode" ...
[1] 0 1 1 2 3 4 5 6

The assign attribute indicates that the first coefficient is the
intercept, the next two are associated with the first-order term
"btype", the next is associated with the first-order term "situ", ...,
the eighth is associated with the second-order term "Gender:Anger".