Question

In: Math

For this exercise, you will need to use the package `mosaic` to find numerical and graphical...

For this exercise, you will need to use the package `mosaic` to find numerical and graphical summaries.

```{r warning=FALSE, message=FALSE}
# install packages if necessary
if (!require(mosaic)) install.packages(`mosaic`)
if (!require(dplyr)) install.packages(`dplyr`)
if (!require(gapminder)) install.packages(`gapminder`)
# load the package in R
library(mosaic) # load the package mosaic to use its functions
library(dplyr) # load the package dplyr to use its functions
library(gapminder) # load the package gapminder for question 1
```


1. Using the gapminder data in the lesson, do the following:
i) use `filter` to select all countries with the following arguments:
a) life expectancy larger than 60 years.   
b) United Kingdom and Vietnam and years greater than 1990.
ii) use `arrange` and `slice` to select the countries with the top 15 GDP per capital `gdpPercap`. Use the pipe `%>%` operator to string multiple functions.
iii) use `mutate` to create a new variable called `gdpPercap_lifeExp` which is the quotient of `gdpPercap` and `lifeExp` and display the output.
iv) use `summarise` to find the average or mean value of the variable `gdpPercap_lifeExp` created in part (iii).   
v) use `group_by` to group the countries by `continent`; and `summarise` to compute the average life expectancy `lifeExp` within each continent. Use the pipe `%>%` operator to string multiple functions.
  
  

### Code chunk
```{r}
# load the necessary packages
library(mosaic)
library(dplyr)
library(gapminder)

# last R code line
```

Solutions

Expert Solution

The detailed code and result is given below.


Related Solutions

Make a numerical and graphical summary of the data, commenting on any features that you find...
Make a numerical and graphical summary of the data, commenting on any features that you find interesting. Limit the output you present to a quality that a busy reader would find sufficient to get a basic understanding of the data. PLEASE SHOW ME HOW TO USE R TO SOLVE THIS. race - racial composition in percent minority fire - fires per 100 housing units theft - theft per 1000 population age - percent of housing units built before 1939 volact...
To complete this exercise you need a software package that allows you to generate data from...
To complete this exercise you need a software package that allows you to generate data from the uniform and normal distributions. (i) Start by generating 500 observations xi - the explanatory variable - from the uniform distribution with range [0,10]. (Most statistical packages have a command for the Uniform[0,1] distribution; just multiply those observations by 10.) What are the sample mean and sample standard deviation of the xi? (ii) Randomly generate 500 errors, ui, from the Normal[0,36] distribution. (If you...
Graphical Analysis and Techniques ​ Procedure The goal of this exercise is for you to determine...
Graphical Analysis and Techniques ​ Procedure The goal of this exercise is for you to determine the relationship and constant of proportionality between the radius and area of a circle. You may already know what this relationship is, but here you will attempt to “prove” it to yourself. You'll be provided the diameters of several circles, from which you can find the respective radii. The areas of the circles will be found by an independent method. If we then plot...
Use the four-step process to find the derivative for: You need to use:  
Use the four-step process to find the derivative for: You need to use:  
Use the graphical method for linear programming to find the optimal solution for the following problem....
Use the graphical method for linear programming to find the optimal solution for the following problem. Maximize P = 4x + 5 y subject to 2x + 4y ≤ 12                 5x + 2y ≤ 10 and      x ≥ 0, y ≥ 0. graph the feasible region
1) Explain what it means to solve something by analytical, numerical, and graphical methods. What is...
1) Explain what it means to solve something by analytical, numerical, and graphical methods. What is the value and limitation of each method?
Find numerical examples of energy usage and thermodynamic computations of efficiency. Use the web to compare...
Find numerical examples of energy usage and thermodynamic computations of efficiency. Use the web to compare the efficiencies of several power production processes. Which are in use and which are planned? Be sure to cite your sources. Wikipedia, while useful, is not a primary source, and you should not cite it. To earn the maximum number of points for this discussion, you must: Post your response of at least 150 words
I need this in R code please: Use the dataset ’juul’ in package ’ISwR’ to answer...
I need this in R code please: Use the dataset ’juul’ in package ’ISwR’ to answer the question. (1) Conduct one-way ANOVA test to test if the mean of igf1 of each level of tanner are the same? (2) What is the mean of igf1 in each level of tanner? (3) If there is any difference, which ones appear to be different? (Use pairwise t test for each pair of level with bonferroni method)
Find the linear regression line for the following table of values. You will need to use...
Find the linear regression line for the following table of values. You will need to use a calculator, spreadsheet, or statistical software. Enter your answer in the form y=mx+b, with m and b both rounded to two decimal places. x y 3 6.03 4 9.65 5 11.49 6 11.57 7 12.96 8 14.97 9 16.31 10 17.43 11 18.55
i NEED TO FIND AN ARTICLE ABOUT USING OF ENERGY IN SUCH AS WORKING, EXERCISE, OR...
i NEED TO FIND AN ARTICLE ABOUT USING OF ENERGY IN SUCH AS WORKING, EXERCISE, OR BEING SEDENTRY THEN SUMMERIZE IT please help me to find an article and summarize it t( the using of energy such as working, being sedentary etc) Please find an article in the news related specifically to the use of energy (working, exercise, being sedentary, etc.) and summarize it in your own words for the class! Include the name of the article and the source...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT