Anda di halaman 1dari 1

> hospital <-

+ readXL("C:/Users/wafaa/Documents/Deakin/Year 2/Trimester 1/RMADA/Assignments


and Pracs/Prac 2/sle251hospital.xlsx",
+ rownames=FALSE, header=TRUE, na="", sheet="sle251hospital.csv",
+ stringsAsFactors=TRUE)

> with(hospital, (t.test(patient, relative, alternative='two.sided',


+ conf.level=.95, paired=TRUE)))

Paired t-test

data: patient and relative


t = -1.8578, df = 12, p-value = 0.0879
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-1.0864039 0.0864039
sample estimates:
mean of the differences
-0.5

> stress <- stack(hospital[, c("patient","relative")])

> names(stress) <- c("anxiety", "familymember")

> Boxplot(anxiety~familymember, data=stress, id.method="y")

Anda mungkin juga menyukai