Create a histogram using r function

Assignment Help Applied Statistics
Reference no: EM132297054

Public Health Assignment Questions -

Q1. Apply the following questions to titanic_train (a dataset from package titanic).

a. Create a plot to show the male and female portion in different class.

b. Create a plot to show the male and female portion in survived passengers (Survived column).

c. Remove missing values in Age column. Then create a boxplot to show the age (Age column) in survived passengers (Survived column).

d. Create a scatter plot to show the age (Age column) in survived passengers (Survived column).

e. What is your conclusion from the six plots you generated? For example, gender difference in survived passengers.

Q2. a. Subset titanic_train with columns named "Survived", "Pclass", "Sex", "Age", and "Fare" into titanic_train.2.

Survived

Pclass

Sex

Age

Fare

0

3

male

22

7.2500

1

1

female

38

71.2833

1

3

female

26

7.9250

1

1

female

35

53.1000

0

3

male

35

8.0500

0

3

male

NA

8.4583

b. Subset titanic_train with columns named "Survived", "Pclass", and "Age" into titanic_train.3. Then melt titanic_train.3 into titanic_train.3_m using columns named "Survived" and "Pclass".

head (titanic_train.3)

 

head (titanic_train.3_m)

Survived

Pclass

Age

 

Survived

Pclass

variable

value

0

3

22

 

0

3

Age

22

1

1

38

 

1

1

Age

38

1

3

26

 

1

3

Age

26

1

1

35

 

1

1

Age

35

0

3

35

 

0

3

Age

35

0

3

NA

 

0

1

Age

54

c. dcast titanic_train.3_m into titanic_train.3_d using mean.

Survived

Age

0

30.62618

1

28.34369

d. Use r to confirm your mean in Q2.c is correct.

e. Tally the number of male and female in both survived and not survived passengers and see if it matches the plot in Q1.b.

Survived

Sex

female

male

0

81

468

1

233

109

Q3.

a. Generate 1,000,000 random numbers from normal distribution with standard deviation equal to 2 and mean equal to 10.

b. Create a histogram using r function (not ggplot2).

974_figure.png

c. Create a histogram using ggplot2. If there is an error, please explain it.

d. Correct the error and create a histogram using ggplot2 and bins=30.

1780_figure1.png

e. Compare the standard deviation and mean in your data to the parameters you used to create your data in Q3.a.

Q4. a. Generate 15 random numbers from 1 to 100 with and without replacement.

b. Apply a t-test to the two group of numbers from Q4.a and Q4.b assuming different variance and not paired t-test.

c. If you plan to generate exactly same random numbers in Q4.a later, what will you do differently in your codes?

Q5. Apply the following questions to trees (an R dataset).

a. Make a scatter plot to show the relationship between Volume and Height.

2368_figure2.png

b. Build a linear model with Volume as the predictor and Height as the response.

c. Based on the linear model in Q5.b, what is the Height if the Volume is 30?

d. Draw a trend line with abline with red color.

Attachment:- Assignment File.rar

Reference no: EM132297054

Questions Cloud

The quantitative viewpoint in management theories : Describe three major approaches within the quantitative viewpoint in management theories.
Compare the government system between turkey and norway : Compare the government system between Turkey and Norway. Compare the population of Turkey and Norway.
Personal life be taken into account when we celebrate them : Should a president's personal life be taken into account when we celebrate them?
Elements and issues for assessing international environment : Discuss the four main elements and issues for assessing the international environment. Give an example for each of these four main elements.
Create a histogram using r function : Generate 1,000,000 random numbers from normal distribution with standard deviation equal to 2 and mean equal to 10. Create a histogram using r function
Describe reward systems and organizational goals : Identify the relationship among any reward systems and organizational goals and what positive or negative effect there is on employee productivity.
Evolution of global non-communicable disease epidemic : HMG7120 - Global Challenge - Non-Communicable Disease - Victoria University - Write an essay on Evolution of global non-communicable disease epidemic
What actions can be taken to overcome the barriers : If a firm has a truly diverse workforce with respect to all of the standard measures of diversity, what barriers might still remain with respect to global.
What you found particularly compelling about this vision : Identify a company in the news during that last 12 months that has expressed what you believe to be a compelling vision for the future. Identify what you found.

Reviews

Write a Review

Applied Statistics Questions & Answers

  Hypothesis testing

What assumptions about the number of pedestrians passing the location in an hour are necessary for your hypothesis test to be valid?

  Calculate the maximum reduction in the standard deviation

Calculate the maximum reduction in the standard deviation

  Calculate the expected value, variance, and standard deviati

Calculate the expected value, variance, and standard deviation of the total income

  Determine the impact of social media use on student learning

Research paper examines determine the impact of social media use on student learning.

  Unemployment survey

Find a statistics study on Unemployment and explain the five-step process of the study.

  Statistical studies

Locate the original poll, summarize the poling procedure (background on how information was gathered), the sample surveyed.

  Evaluate the expected value of the total number of sales

Evaluate the expected value of the total number of sales

  Statistic project

Identify sample, population, sampling frame (if applicable), and response rate (if applicable). Describe sampling technique (if applicable) or experimental design

  Simple data analysis and comparison

Write a report on simple data analysis and comparison.

  Analyze the processed data in statistical survey

Analyze the processed data in Statistical survey.

  What is the probability

Find the probability of given case.

  Frequency distribution

Accepting Manipulation or Manipulating

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd