Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Calculus Early Transcendentals

Authors: James Stewart

7th edition

538497904, 978-0538497909

Students also viewed these Mathematics questions