Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create thegaltondataset using the code below: library(tidyverse) library(HistData) data(GaltonFamilies) set.seed( 1 ) # if you are using R 3.5 or earlier set.seed( 1 , sample.kind
Create thegaltondataset using the code below:
library(tidyverse) library(HistData) data("GaltonFamilies") set.seed(1) # if you are using R 3.5 or earlier set.seed(1, sample.kind = "Rounding") # if you are using R 3.6 or later galton <- GaltonFamilies %>% group_by(family, gender) %>% sample_n(1) %>% ungroup() %>% gather(parent, parentHeight, father:mother) %>% mutate(child = ifelse(gender == "female", "daughter", "son")) %>% unite(pair, c("parent", "child")) galton
Group bypairand summarize the number of observations in each group.
1) How many father-daughter pairs are in the dataset?
2) How many mother-son pairs are in the dataset?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started