Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linear Algebra With Applications

Authors: Gareth Williams

8th Edition

1449679579, 9781449679576

More Books

Students also viewed these Mathematics questions

Question

=+b) What is the standard deviation of the sample range?

Answered: 1 week ago

Question

5. How can I help others in the network achieve their goals?

Answered: 1 week ago