2. Load the DuckSurvival.txt data set into R.
(a) Calculate the mean, median, standard deviation, 20th percentile, and 70th percentile for survivaltime, weight, and length.
(b) Make two frequency tables, one for status and one for death, that include a Sum column. Report the resulting tables.
(c) Use the cor()function to find the correlation between the variables in the data set. Report your output.

Install and load the five thirtyeight package in R. Consider the comic characters data set. This dataset examines 23,272 comic book characters owned by publishers Marvel and DC Comics.
a Make a frequency table for the align variable. Report the resulting output.
b Make a contingency table comparing the eye and align variables. Report the resulting output.
c Find the mean and standard deviation for the number of appearances of the characters in the data set(using the appearances variables). You’ll need to remove missing values to do this.
d Find the correlation between the number of appearances (appearances) and the year a character was firstpublished (year). You’ll need to remove missing values to do this.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

cal.summary <- function(x){
xbar <- mean(x)
xmedian <- median(x)
xsd <- sd(x)
x20 <- quantile(x, 0.20)
x70 <- quantile(x, 0.70)
cat("Mean", xbar, "\n")
cat("Median", xmedian, "\n")
cat("Standard Deviation", xsd, "\n")
cat("20th Percentile", x20, "\n")
cat("70th Percentile", x70, "\n")

print("Survival Time:")



aggregate(. ~ status, data = dat, sum)

aggregate(. ~ death, data = dat, sum...

By purchasing this solution you'll be able to access the following files:
Solution.R and Solution1.R.

for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Statistics-R Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats