Question: using R -Studio can i get help with questions 1-5? The dataset below contains information on Olympic athletes. The unit-of-observation is athleteyear. This is just

using R -Studio
can i get help with questions 1-5?
using R -Studio can i get help with questions 1-5? The dataset
below contains information on Olympic athletes. The unit-of-observation is athleteyear. This is

The dataset below contains information on Olympic athletes. The unit-of-observation is athleteyear. This is just a snapshot of the data: the actual data contains 32,171 observations. 1. The data frame above contains data for the 1992 Olympics, 1996 Olympics, and 2000 Olympics. Construct a vector named "year" that has three entries, where each entry is one of these years. 2. Write code that loops over the vector you created above and takes that average height across all observations in a given year. 3. Write code that generates a new variable called either_1992_or_1996, which is equal to 1 if the observation is in 1992 or 1996 and zero otherwise. 4. We decide we would like to study variation across different countries in terms of the height of their athletes. Using tidyverse and pipe operators, write code that (1) first. restricts to observations from 2000 and (2) then constructs a dataset that contains the average height of Olympic athletes within each country. The variable "NOC" contains information on the country of origin for each athlete. 5. Imagine you want to study the evolution of average age of U.S. athletes. Write code below to generate a dataframe that for each year, contains the average age of U.S. athletes in that year. The dataset below contains information on Olympic athletes. The unit-of-observation is athleteyear. This is just a snapshot of the data: the actual data contains 32,171 observations. 1. The data frame above contains data for the 1992 Olympics, 1996 Olympics, and 2000 Olympics. Construct a vector named "year" that has three entries, where each entry is one of these years. 2. Write code that loops over the vector you created above and takes that average height across all observations in a given year. 3. Write code that generates a new variable called either_1992_or_1996, which is equal to 1 if the observation is in 1992 or 1996 and zero otherwise. 4. We decide we would like to study variation across different countries in terms of the height of their athletes. Using tidyverse and pipe operators, write code that (1) first. restricts to observations from 2000 and (2) then constructs a dataset that contains the average height of Olympic athletes within each country. The variable "NOC" contains information on the country of origin for each athlete. 5. Imagine you want to study the evolution of average age of U.S. athletes. Write code below to generate a dataframe that for each year, contains the average age of U.S. athletes in that year

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!