if(require(fda, quietly=TRUE)) {
# Heights of boys and girls at age 10
f.a <- growth$hgtf["10",] # girls at age 10
m.a <- growth$hgtm["10",] # boys at age 10
# Empirical cumulative distribution functions
plot(ecdf(f.a))
plot(ecdf(m.a), col='grey70', add=TRUE)
# Create a list of the data
fm.list <- list(Girls=f.a, Boys=m.a)
# \donttest{
res_m <- GET.distrequal(fm.list)
plot(res_m)
res_c <- GET.distrequal(fm.list, contrasts=TRUE)
plot(res_c)
# }
# \dontshow{
# The test with lower number of simulations
res_m <- GET.distrequal(fm.list, nsim=4, alpha=0.2)
plot(res_m)
res_c <- GET.distrequal(fm.list, contrasts=TRUE, nsim=4, alpha=0.2)
plot(res_c)
# }
# Heights of boys and girls at age 14
f.a <- growth$hgtf["14",] # girls at age 14
m.a <- growth$hgtm["14",] # boys at age 14
# Empirical cumulative distribution functions
plot(ecdf(f.a))
plot(ecdf(m.a), col='grey70', add=TRUE)
# Create a list of the data
fm.list <- list(Girls=f.a, Boys=m.a)
# \donttest{
res_m <- GET.distrequal(fm.list)
plot(res_m)
res_c <- GET.distrequal(fm.list, contrasts=TRUE)
plot(res_c)
# }
# \dontshow{
# The test with lower number of simulations
res_m <- GET.distrequal(fm.list, nsim=4, alpha=0.2)
plot(res_m)
res_c <- GET.distrequal(fm.list, contrasts=TRUE, nsim=4, alpha=0.2)
plot(res_c)
# }
}
Run the code above in your browser using DataLab