res <- pmgRepeatTrials(rnorm(1))
hist(res)
g = data.frame(
father = c(78.5, 78.5, 77.5, 76.0, 75.5),
mother = c(67.0, 68.0, 66.0, 65.5, 62.0),
sex = c("M", "M", "F", "F", "M"),
nkids = c(4, 4, 1, 2, 5)
)
res <- pmgRepeatTrials(coef(lm(father~ sex + sample(nkids),data=g)),100)
print(res)
Run the code above in your browser using DataLab