# bps6e-examp-19.2

data<-read.table("

attach(data)

names(data)

head(data)

boxplot(stand~group,col=c("red","green"))

mean(stand[1:10])

mean(stand[11:20])

sd(stand[1:10])

sd(stand[11:20])

mean(stand[1:10])-mean(stand[11:20])

#bps6e-xrs-19-25

data<-read.table("

attach(data)

names(data)

head(data)

boxplot(words~sex,col=c("red","green"))

EXAMPLE19.2Daily activity and obesity

STATE: People gain weight when they take in more energy from food than they expend. James Levine and his collaborators at the Mayo Clinic investigated the link between obesity and energy spent on daily activity.

Choose 20 healthy volunteers who don’t exercise. Deliberately choose 10 who are lean and 10 who are mildly obese but still healthy. Attach sensors that monitor the subjects’ every move for 10 days. Table19.1 presents data on the time (in minutes per day) that the subjects spent standing or walking, sitting, and lying down. Do lean and obese people differ in the average time they spend standing and walking?

PLAN: Examine the data and carry out a test of hypotheses. We suspect in advance that lean subjects (Group 1) are more active than obese subjects (Group 2), so we test the hypotheses

SOLVE (first steps): Are the conditions for inference met? The subjects are volunteers, so they are not SRSs from all lean and mildly obese adults. The study tried to recruit comparable groups: all worked in sedentary jobs, none smoked or were taking medication, and so on. Setting clear standards like these helps make up for the fact that we can’t reasonably get SRSs for so invasive a study. The subjects were not told that they were chosen from a larger group of volunteers because they did not exercise and were either lean or mildly obese. Because their willingness to volunteer isn’t related to the purpose of the experiment, we will treat them as two independent SRSs.

Calculating the group means confirms this:

The observed difference in mean time per day spent standing or walking is

1 − 2 = 525.751 − 373.269 = 152.482 minutes

To complete the “Solve” step, we must learn the details of inference for comparing two means.