A health study is being conducted on a population of 60 women and 40 men. (a) La
ID: 3273445 • Letter: A
Question
A health study is being conducted on a population of 60 women and 40 men. (a) Label the women 1 through 60 and the men 61 through 100. Estimate many women are in a simple random sample of size 20. (b) Determine ten simple random samples of size 20 and record the number of women in each of the samples. (c) Find the mean and the standard deviation of the number of women in the samples. How does this conform to your estimate? (d) Perform a stratified random sample having 10 women and 10 men and display your answer. (e) Perform 12 samples of 10 women and for each woman, record the number samples in which she appears. (f) Find the mean and standard deviation of this data set. Why is the mean exactly equal to 2? (g) Make a histogram showing the number of women that appear 0, 1, 2, , times.Explanation / Answer
Please see the R snippet as shown below
###
##### simple example #####
# creating a data sample
number = seq(1:100)
df1 <- data.frame(number,
Gender = ifelse(number<=61,"Female","Male") )
## take samples of each data
set.seed(1)
sample.df <- function(df, n) df[sample(nrow(df), n), , drop = FALSE]
numbers<- lapply(rep(20,10),sample.df,df=df1)
names(numbers) <- seq(1:10)
all <- do.call("rbind",numbers)
all$id <- rep(names(numbers), sapply(numbers, nrow))
## frequency of women in each sample
library(dplyr)
all %>% group_by(id,Gender) %>%
summarise (n = n()) %>%
mutate(freq = n / sum(n))
# mean and standard deviaiton
women <- all %>% group_by(id,Gender) %>% filter(Gender=="Female") %>%
summarise (n = n())
mean(women$n)
sd(women$n)
The results are
# A tibble: 20 x 4
# Groups: id [10]
id Gender n freq
<chr> <fctr> <int> <dbl>
1 1 Female 17 0.85
2 1 Male 3 0.15
3 10 Female 11 0.55
4 10 Male 9 0.45
5 2 Female 13 0.65
6 2 Male 7 0.35
7 3 Female 13 0.65
8 3 Male 7 0.35
9 4 Female 12 0.60
10 4 Male 8 0.40
11 5 Female 13 0.65
12 5 Male 7 0.35
13 6 Female 14 0.70
14 6 Male 6 0.30
15 7 Female 15 0.75
16 7 Male 5 0.25
17 8 Female 11 0.55
18 8 Male 9 0.45
19 9 Female 11 0.55
20 9 Male 9 0.45
> mean(women$n)
[1] 13
> sd(women$n)
[1] 1.943651
Please note that we can answer only 4 subparts of a question at a time
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.