1
$\begingroup$

I have 4 geographic populations which are nested within 2 population types (sympatry vs allopatry). Geographic population 1 and 2 is nested in population type 1 (allopatry), geographic population 3 and 4 are nested in population type 2 (sympatry). I am curious as to how I would assign this nesting to these fixed effects (geographic population, population type). Is it just:

poptype  +  geopop:poptype 
$\endgroup$
0
$\begingroup$

Does this give you what you want:

library(tibble)
dat <- tribble(
  ~ geopop, ~ type, ~ y,
  "P1", "Allo", 1,
  "P1", "Allo", 1.5,
  "P2", "Allo", 2,
  "P3", "Sym",  3,
  "P4", "Sym",  3.25)
dat <- transform(dat, geopop=factor(geopop), type=factor(type))
library(asreml)

m1 <- asreml(y ~ type + geopop:type, data=dat)
wald(m1)
Wald tests for fixed effects.
Response: y
Terms added sequentially; adjusted for those above.

              Df Sum of Sq Wald statistic Pr(Chisq)    
(Intercept)    1   23.1125         184.90 < 2.2e-16 ***
type           1    3.1688          25.35 4.782e-07 ***
geopop:type    2    0.4063           3.25    0.1969    
residual (MS)       0.1250                             
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
$\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.