test 2 Flashcards

1
Q

how to solve this problem:

Find the fraction of smokers and nonsmokers with weights beyond 1σ and 2σ from the mean.

A
  1. calculate standard deviation:

sd.smoke <- sd(cdc[smoke100==1,]$weight)

  1. calculate mean:

mean.smoke <- mean(cdc[smoke100==1,]$weight)

  1. find threshold values for beyond mean:

mean.smoke + sd.smoke

  1. calculate the number of people beyond the threshold and find the proportion:

sum(weight[smoke100==1] > mean.smoke + sd.smoke)/sum(smoke100==1)

for proportions you divide by the total amount

  • this is also only for smokers but you have to repeat for nonsmokers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly