Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please use R to solve this question For the data set low bwt used before, systol

ID: 3176125 • Letter: P

Question

Please use R to solve this question

For the data set low bwt used before, systolic blood pressure measurements for 100 low birth weight infants are saved under variable sbp, gender is saved under variable sex and toxemia (during pregnancy for the child's mother) is saved under the variable tox. We wish to see whether mean systolic blood pressure is the same for low birth weight boys and girls. Use R to produce ANOVA tables: one with toxemia status as blocking variable and one without any blocking. What is the p-value for gender effect on systolic blood pressure with the blocking? What is the p-value for gender effect on systolic blood pressure without the blocking? Hypothetically, if you have a data set with randomized block design (the data set low bwt is not) for testing difference among two groups. That is, each block has two subjects randomly assigned to the two groups. Is the ANOVA F-test without blocking equivalent to the independent two-sample t-test? Is the ANOVA F-test with blocking equivalent to the paired two-sample t-test?

Explanation / Answer

R outout

a) #read data in R

>data = read.table("C:/Users/mayur/Desktop/lowbwt.txt", header=TRUE);

>attach(data)

Anova with bocking
> lm.out=lm(sbp~sex+tox,data=data)

>anova(lm.out)

Analysis of Variance Table

Response: sbp
Df Sum Sq Mean Sq F value Pr(>F)
sex 1 48.2 48.250 0.3668 0.5461
tox 1 66.8 66.761 0.5076 0.4779
Residuals 97 12758.3 131.529

#ANOVA WITHOUT BLOCKING   

> lm.out=lm(sbp~sex,data=data)
> anova(lm.out)
Analysis of Variance Table

Response: sbp
Df Sum Sq Mean Sq F value Pr(>F)
sex 1 48.2 48.25 0.3687 0.5451
Residuals 98 12825.1 130.87

b) p-value =0.5461 for gender (sex) effects on blood pressure with blocking

, p-value =0.5451 for gender (sex) effects on blood pressure without blocking

c)yes. ANOVA F test Without blocking equivalent to the independent two sample test, with blocking is same as paired two sample test