# Simulate genetic values with 'AlphaSimR' for two additive + dominance traits
# in two environments based on a compound symmetry model.
# 1. Define the genetic architecture of the simulated traits.
# Mean genetic values and mean dominance degrees.
mean <- c(4.9, 5.4, 235.2, 228.5) # Trait 1 x 2 environments, Trait 2 x 2 environments
meanDD <- c(0.4, 0.4, 0.1, 0.1) # Trait 1 and 2, same value for both environments
# Additive genetic variances and dominance degree variances.
var <- c(0.08, 13) # Different values for Traits 1 and 2
varDD <- 0.2 # Same value for Traits 1 and 2
# Proportion of additive and dominance degree main effect variances.
prop.main <- c(0.4, 0.6) # Different values for Traits 1 and 2
prop.mainDD <- 0.4 # Same value for Traits 1 and 2
# Additive and dominance degree correlations between the two simulated traits.
corA <- matrix(c(
1.0, 0.5,
0.5, 1.0
), ncol = 2)
corDD <- diag(2) # Assuming independence
input_asr <- compsym_asr_input(
ntraits = 2,
nenvs = 2,
mean = mean,
var = var,
prop.main = prop.main,
corA = corA,
meanDD = meanDD,
varDD = varDD,
prop.mainDD = prop.mainDD,
corDD = corDD
)
Run the code above in your browser using DataLab