---
title: "S4R: Class 16 Sampling"
author: "Your Name Here"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
html_document:
toc: true
---
---
This assignment is separate from your project.
Include your answers in this document in the sections below the rubric.
Answer the questions with the three sampling/data examples.
```{r}
library(tidyverse)
```
--------------------------------------------------------------------------------
# Lego example 1, hand-drawn sample
## Draw samples, estimate the mean "cells" of 50 Lego assemblages
A "cell" is defined as a one-unit high square that includes a single lego circle.
Some assemblages have a 1/5-high base; ignore this, it is only for structure.
Procedure:
a. Select a "representative or random sample" of 5 assemblages out of the bin.
b. Count the number of cells for each assemblage.
c. Calculate the sample mean of the 5 (to estimate population mean of the 50); you can use this R code by replacing the numbers: `mean(c(1, 2, 3, 4, 5))`.
d. Write your mean cell-count estimate on a portable white board in big numbers (3 decimal places) and lay it on your table (so other tables don't see).
e. When all tables are done, hang up your board so everyone can see each table's cell-count estimate.
f. Record all the estimates in the R code chunk below and plot the estimate of the sampling distribution of the mean cell count based on $n = 5$.
```{R}
# enter list of cells means here
sam.lego %
group_by(PrimingNumber) %>%
summarize(UN_Percentage = mean(UN_Percentage)) %>%
ungroup()
mean.UN.Africa
# histogram using ggplot
library(ggplot2)
p