Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8. Reading spreadsheet data into R Data files we use in this class will be provided as .csv les. We have provided example code that
8. Reading spreadsheet data into R Data files we use in this class will be provided as .csv les. We have provided example code that uses the read_csv( ) function to read the patient data (Patient_Data.csv) into R, creating a tibble. We also included code to turn the categorical variable Sex into a factor variable (factor variables will be important when we build models), count the number of observations for each Sex and to create a new subset of data that only contains the observations for females. Lastly, the glimpse function is used to display information about the subset. Modify the code we provided to do the following: a) Use the count function to count the number of observations in each of the MartitalStat categories. What percentage of patients are widowed? [Use R as a calculator to get the percentage] b) Create a subset of data that includes all observations for patients that are married. Include a call to g1 imps e to show the summary of the data. c) Of the married patients, what percentage are male? [Add a line of code to get this number]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started