A study of iron deficiency in infants compared samples of infants whose mothers
ID: 3320574 • Letter: A
Question
A study of iron deficiency in infants compared samples of infants whose mothers chose different ways of feeding them. One group contained breast-fed infants. The children in another group were fed a standard baby formula without any iron supplements. Her are summary results on blood hemoglobin levels at 12 months of age: Group mean x Breast-fed 23 15.3 2.2 Formula 31 16.9 1.8 Part a: We want to see if the mean hemoglobin level is greater among formula-fed babies. State the hypotheses and perform the significance test on your hypothesis. Report the test statistic and p-value. State your conclusion in terms of the issue. Part b: Give a 95% confidence interval for the mean difference in hemoglobin level between the two populations of infants.Explanation / Answer
code
# m1, m2: the sample means
# s1, s2: the sample standard deviations
# n1, n2: the same sizes
# m0: the null value for the difference in means to be tested for. Default is 0.
# equal.variance: whether or not to assume equal variance. Default is FALSE.
t.test2 <- function(m1,m2,s1,s2,n1,n2,m0=0,equal.variance=FALSE)
{
if( equal.variance==FALSE )
{
se <- sqrt( (s1^2/n1) + (s2^2/n2) )
# welch-satterthwaite df
df <- ( (s1^2/n1 + s2^2/n2)^2 )/( (s1^2/n1)^2/(n1-1) + (s2^2/n2)^2/(n2-1) )
} else
{
# pooled standard deviation, scaled by the sample sizes
se <- sqrt( (1/n1 + 1/n2) * ((n1-1)*s1^2 + (n2-1)*s2^2)/(n1+n2-2) )
df <- n1+n2-2
}
t <- (m1-m2-m0)/se
dat <- c(m1-m2, se, t, 2*pt(-abs(t),df))
names(dat) <- c("Difference of means", "Std Error", "t", "p-value")
return(dat)
}
> t.test2 (15.3,16.9,2.2,1.8,23,31,equal.variance=FALSE)
Difference of means Std Error t p-value
-1.600000000 0.561204875 -2.851008734 0.006746228
b) confidence interval
(-2.733, -0.467)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.