RStudio coding.

profileleosdesire
AssignmentinstructionsSTA3000Activity11.rtf

STA 3000 - Statistical Computing

In - class activity #1

Due September 29, 2019

Answer the following questions . Paste your R code as well as your actual answer .

Class survey

Read in the results of the class survey into R. You can find the file on Blackboard, under class documents.

  • How many students filled out the survey?
  • What is the percentage of students who have prior coding experience?
  • What percentage of students is from NYC?
  • Provide a table that gives the percentage of students who are from Manhattan, Brooklyn, Queens, the Bronx, and Staten Island.
  • Create a table that gives the percentage of students who prefer the Yankees, the Mets, or don’t care by borough. Do you think that the data indicates that there is some dependence between borough and the baseball team that you prefer?
  • What is the sport that most students seem to care about? Give the percentage of students who have a preference for a football, basketball, and baseball team.
  • What percentage of students speak only one language?
  • Hair length

    Are hair length and age related? The following questions use a dataset from a study that tries to answer that question.

    Data: http :// users . stat . ufl . edu /~ winner / data / hairlength . txt

    Description: http :// users . stat . ufl . edu /~ winner / data / hairlength . dat

    Read in the data and reformat it so that the variables are of the right type and have interpretable labels. Paste the code you used below.

  • Give the percentage of women in the sample that are in each age group. Given those percentages, do you think that the dataset is a representative sample of women in the US?
  • What is the percentage of women in the sample who have short, medium and long hair?
  • Provide a table that shows the percentage of women who have short, medium, and long hair given an age group. Do you see any trends? Explain what you see.
  • Out of all the women in the sample who have long hair, what percentage is in the youngest group?
  • Height , weight , and age of NBA players

    In this exercise, you’ll work with a sample of NBA players from the 2013-2014 season.

    You can find the dataset here: http :// users . stat . ufl . edu /~ winner / data / nba _ ht _ wt . csv

  • Convert the height variable from inches into meters.
  • Convert the weight variable from pounds into kilograms.
  • Create a column that contains the body mass index (BMI) of the players.
  • Which player has the maximum BMI in the sample?
  • What percentage of NBA players in the sample have a BMI over 25, which is considered “overweight”?
  • Create a boxplot of height by position. Do you see any association between the variables?
  • Create a boxplot of BMI by position. Do you see any association between the variables?