Programming Assignment 3: Hospital Quality

My code repository for coursera data science specialization by john hopkins university, assignment instructions.

The data for this assignment come from the Hospital Compare web site (http://hospitalcompare.hhs.gov) run by the U.S. Department of Health and Human Services. The purpose of the web site is to provide data and information about the quality of care at over 4,000 Medicare-certified hospitals in the U.S. This dataset es- sentially covers all major U.S. hospitals. This dataset is used for a variety of purposes, including determining whether hospitals should be fined for not providing high quality care to patients (see http://goo.gl/jAXFX for some background on this particular topic).

The Hospital Compare web site contains a lot of data and we will only look at a small subset for this assignment. The zip file for this assignment contains three files

  • outcome-of-care-measures.csv: Contains information about 30-day mortality and readmission rates for heart attacks, heart failure, and pneumonia for over 4,000 hospitals.
  • hospital-data.csv: Contains information about each hospital.
  • Hospital_Revised_Flatfiles.pdf: Descriptions of the variables in each file (i.e the code book).

A description of the variables in each of the files is in the included PDF file named Hospital_Revised_Flatfiles.pdf. This document contains information about many other files that are not included with this programming assignment. You will want to focus on the variables for Number 19 (“Outcome of Care Measures.csv”) and Number 11 (“Hospital Data.csv”). You may find it useful to print out this document (at least the pages for Tables 19 and 11) to have next to you while you work on this assignment. In particular, the numbers of the variables for each table indicate column indices in each table (i.e. “Hospital Name” is column 2 in the outcome-of-care-measures.csv file)

More information about the assignment here

Data zip file - link

1 Plot the 30-day mortality rates for heart attack - outcome.R

histogram for heart attack

2 Finding the best hospital in a state - best.R

Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specified outcome in that state. The hospital name is the name provided in the Hospital.Name variable. The outcomes can be one of “heart attack”, “heart failure”, or “pneumonia”. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

3 Ranking hospitals by outcome in a state - rankhospital.R

Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a state (state), an outcome (outcome), and the ranking of a hospital in that state for that outcome (num). The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the ranking specified by the num argument. For example, the call rankhospital(“MD”, “heart failure”, 5) would return a character vector containing the name of the hospital with the 5th lowest 30-day death rate for heart failure. The num argument can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

4 Ranking hospitals in all states - rankall.R

Write a function called rankall that takes two arguments: an outcome name (outcome) and a hospital ranking (num). The function reads the outcome-of-care-measures.csv file and returns a 2-column data frame containing the hospital in each state that has the ranking specified in num. For example the function call rankall(“heart attack”, “best”) would return a data frame containing the names of the hospitals that are the best in their respective states for 30-day heart attack death rates. The function should return a value for every state (some may be NA). The first column in the data frame is named hospital, which contains the hospital name, and the second column is named state, which contains the 2-character abbreviation for the state name. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

R Programming Assignment 3: Hospital Quality

Introduction.

Download the file ProgAssignment3-data.zip file containing the data for Programming Assignment 3 from the Coursera web site. Unzip the file in a directory that will serve as your working directory. When you start up R make sure to change your working directory to the directory where you unzipped the data.

The data for this assignment come from the Hospital Compare web site ( http://hospitalcompare.hhs.gov ) run by the U.S. Department of Health and Human Services. The purpose of the web site is to provide data and information about the quality of care at over 4,000 Medicare-certified hospitals in the U.S. This dataset essentially covers all major U.S. hospitals. This dataset is used for a variety of purposes, including determining whether hospitals should be fined for not providing high quality care to patients (see http://goo.gl/jAXFX for some background on this particular topic).

The Hospital Compare web site contains a lot of data and we will only look at a small subset for this assignment. The zip file for this assignment contains three files:

  • outcome-of-care-measures.csv : Contains information about 30-day mortality and readmission rates for heart attacks, heart failure, and pneumonia for over 4,000 hospitals.
  • hospital-data.csv : Contains information about each hospital.
  • Hospital_Revised_Flatfiles.pdf : Descriptions of the variables in each file (i.e the code book).

A description of the variables in each of the files is in the included PDF file named Hospital_Revised_Flatfiles.pdf . This document contains information about many other files that are not included with this programming assignment. You will want to focus on the variables for Number 19 (“Outcome of Care Measures.csv”) and Number 11 (“Hospital Data.csv”). You may find it useful to print out this document (at least the pages for Tables 19 and 11) to have next to you while you work on this assignment. In particular, the numbers of the variables for each table indicate column indices in each table (i.e. “Hospital Name” is column 2 in the outcome-of-care-measures.csv file).

Part 1: Plot the 30-day mortality rates for heart attack

Read the outcome data into R via the read.csv function and look at the first few rows.

There are many columns in this dataset. You can see how many by typing ncol(outcome) (you can see the number of rows with the nrow function). In addition, you can see the names of each column by typing names(outcome) (the names are also in the PDF document).

To make a simple histogram of the 30-day death rates from heart attack (column 11 in the outcome dataset), run

Because we originally read the data in as character (by specifying colClasses = “character” we need to coerce the column to be numeric. You may get a warning about NAs being introduced but that is okay.

There is nothing to submit for this part.

Part 2: Finding the best hospital in a state

Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specified outcome in that state. The hospital name is the name provided in the Hospital.Name variable. The outcomes can be one of “heart attack”, “heart failure”, or “pneumonia”. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Handling ties. If there is a tie for the best hospital for a given outcome, then the hospital names should be sorted in alphabetical order and the first hospital in that set should be chosen (i.e. if hospitals “b”, “c”, and “f” are tied for best, then hospital “b” should be returned).

The function should use the following template.

The function should check the validity of its arguments. If an invalid state value is passed to best , the function should throw an error via the stop function with the exact message “invalid state”. If an invalid outcome value is passed to best , the function should throw an error via the stop function with the exact message “invalid outcome”.

Here is some sample output from the function.

Save your code for this function to a file named best.R .

Part 3: Ranking hospitals by outcome in a state

Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a state ( state ), an outcome ( outcome ), and the ranking of a hospital in that state for that outcome ( num ). The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the ranking specified by the num argument. For example, the call

would return a character vector containing the name of the hospital with the 5th lowest 30-day death rate for heart failure. The num argument can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA . Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Handling ties . It may occur that multiple hospitals have the same 30-day mortality rate for a given cause of death. In those cases ties should be broken by using the hospital name. For example, in Texas (“TX”), the hospitals with lowest 30-day mortality rate for heart failure are shown here.

Note that Cypress Fairbanks Medical Center and Detar Hospital Navarro both have the same 30-day rate (8.7). However, because Cypress comes before Detar alphabetically, Cypress is ranked number 3 in this scheme and Detar is ranked number 4. One can use the order function to sort multiple vectors in this manner (i.e. where one vector is used to break ties in another vector).

The function should check the validity of its arguments. If an invalid state value is passed to rankhospital , the function should throw an error via the stop function with the exact message “invalid state”. If an invalid outcome value is passed to rankhospital , the function should throw an error via the stop function with the exact message “invalid outcome”.

Save your code for this function to a file named rankhospital.R .

Part 4: Ranking hospitals in all states

Write a function called rankall that takes two arguments: an outcome name ( outcome ) and a hospital ranking ( num ). The function reads the outcome-of-care-measures.csv file and returns a 2-column data frame containing the hospital in each state that has the ranking specified in num . For example the function call rankall(“heart attack”, “best”) would return a data frame containing the names of the hospitals that are the best in their respective states for 30-day heart attack death rates. The function should return a value for every state (some may be NA ). The first column in the data frame is named hospital , which contains the hospital name, and the second column is named state , which contains the 2-character abbreviation for the state name. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Handling ties . The rankall function should handle ties in the 30-day mortality rates in the same way that the rankhospital function handles ties.

NOTE : For the purpose of this part of the assignment (and for efficiency), your function should NOT call the rankhospital function from the previous section.

The function should check the validity of its arguments. If an invalid outcome value is passed to rankall , the function should throw an error via the stop function with the exact message “invalid outcome”. The num variable can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA .

Save your code for this function to a file named rankall.R .

My Solution

A good tutorial.

Link: https://github.com/DanieleP/PA3-tutorial

  • 1. Introduction
  • 2. Part 1: Plot the 30-day mortality rates for heart attack
  • 3. Part 2: Finding the best hospital in a state
  • 4. Part 3: Ranking hospitals by outcome in a state
  • 5. Part 4: Ranking hospitals in all states
  • 6. My Solution
  • 8. A Good Tutorial
  • Top Courses
  • Online Degrees
  • Find your New Career
  • Join for Free

Johns Hopkins University

  • R Programming

This course is part of multiple programs. Learn more

This course is part of multiple programs

Taught in English

Some content may not be translated

Roger D. Peng, PhD

Instructors: Roger D. Peng, PhD +2 more

Instructors

Instructor ratings

We asked all learners to give feedback on our instructors based on the quality of their teaching style.

Financial aid available

709,543 already enrolled

Coursera Plus

(22,173 reviews)

Recommended experience

Intermediate level

Familiarity with regression is recommended.

What you'll learn

Understand critical programming language concepts

Configure statistical programming software

Make use of R loop functions and debugging tools

Collect detailed information using R profiler

Skills you'll gain

  • Data Analysis

Details to know

programming assignment 3 hospital quality

Add to your LinkedIn profile

See how employees at top companies are mastering in-demand skills

Placeholder

Build your subject-matter expertise

  • Learn new concepts from industry experts
  • Gain a foundational understanding of a subject or tool
  • Develop job-relevant skills with hands-on projects
  • Earn a shareable career certificate

Placeholder

Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV

Share it on social media and in your performance review

Placeholder

There are 4 modules in this course

In this course you will learn how to program in R and how to use R for effective data analysis. You will learn how to install and configure software necessary for a statistical programming environment and describe generic programming language concepts as they are implemented in a high-level statistical language. The course covers practical issues in statistical computing which includes programming in R, reading data into R, accessing R packages, writing R functions, debugging, profiling R code, and organizing and commenting R code. Topics in statistical data analysis will provide working examples.

Week 1: Background, Getting Started, and Nuts & Bolts

This week covers the basics to get you started up with R. The Background Materials lesson contains information about course mechanics and some videos on installing R. The Week 1 videos cover the history of R and S, go over the basic data types in R, and describe the functions for reading and writing data. I recommend that you watch the videos in the listed order, but watching the videos out of order isn't going to ruin the story.

What's included

28 videos 9 readings 1 quiz 7 programming assignments

28 videos • Total 129 minutes

  • Installing R on a Mac • 1 minute • Preview module
  • Installing R on Windows • 3 minutes
  • Installing R Studio (Mac) • 1 minute
  • Writing Code / Setting Your Working Directory (Windows) • 7 minutes
  • Writing Code / Setting Your Working Directory (Mac) • 7 minutes
  • Introduction • 1 minute
  • Overview and History of R • 16 minutes
  • Getting Help • 13 minutes
  • R Console Input and Evaluation • 4 minutes
  • Data Types - R Objects and Attributes • 4 minutes
  • Data Types - Vectors and Lists • 6 minutes
  • Data Types - Matrices • 3 minutes
  • Data Types - Factors • 4 minutes
  • Data Types - Missing Values • 2 minutes
  • Data Types - Data Frames • 2 minutes
  • Data Types - Names Attribute • 1 minute
  • Data Types - Summary • 0 minutes
  • Reading Tabular Data • 5 minutes
  • Reading Large Tables • 7 minutes
  • Textual Data Formats • 4 minutes
  • Connections: Interfaces to the Outside World • 4 minutes
  • Subsetting - Basics • 4 minutes
  • Subsetting - Lists • 4 minutes
  • Subsetting - Matrices • 2 minutes
  • Subsetting - Partial Matching • 1 minute
  • Subsetting - Removing Missing Values • 3 minutes
  • Vectorized Operations • 3 minutes
  • Introduction to swirl • 1 minute

9 readings • Total 90 minutes

  • Welcome to R Programming • 10 minutes
  • About the Instructor • 10 minutes
  • Pre-Course Survey • 10 minutes
  • Syllabus • 10 minutes
  • Course Textbook • 10 minutes
  • Course Supplement: The Art of Data Science • 10 minutes
  • Data Science Podcast: Not So Standard Deviations • 10 minutes
  • Getting Started and R Nuts and Bolts • 10 minutes
  • Practical R Exercises in swirl Part 1 • 10 minutes

1 quiz • Total 30 minutes

  • Week 1 Quiz • 30 minutes

7 programming assignments • Total 1,260 minutes

  • swirl Lesson 1: Basic Building Blocks • 180 minutes
  • swirl Lesson 2: Workspace and Files • 180 minutes
  • swirl Lesson 3: Sequences of Numbers • 180 minutes
  • swirl Lesson 4: Vectors • 180 minutes
  • swirl Lesson 5: Missing Values • 180 minutes
  • swirl Lesson 6: Subsetting Vectors • 180 minutes
  • swirl Lesson 7: Matrices and Data Frames • 180 minutes

Week 2: Programming with R

Welcome to Week 2 of R Programming. This week, we take the gloves off, and the lectures cover key topics like control structures and functions. We also introduce the first programming assignment for the course, which is due at the end of the week.

13 videos 3 readings 2 quizzes 3 programming assignments

13 videos • Total 90 minutes

  • Control Structures - Introduction • 0 minutes • Preview module
  • Control Structures - If-else • 1 minute
  • Control Structures - For loops • 4 minutes
  • Control Structures - While loops • 3 minutes
  • Control Structures - Repeat, Next, Break • 4 minutes
  • Your First R Function • 10 minutes
  • Functions (part 1) • 9 minutes
  • Functions (part 2) • 7 minutes
  • Scoping Rules - Symbol Binding • 10 minutes
  • Scoping Rules - R Scoping Rules • 8 minutes
  • Scoping Rules - Optimization Example (OPTIONAL) • 9 minutes
  • Coding Standards • 8 minutes
  • Dates and Times • 10 minutes

3 readings • Total 30 minutes

  • Week 2: Programming with R • 10 minutes
  • Practical R Exercises in swirl Part 2 • 10 minutes
  • Programming Assignment 1 INSTRUCTIONS: Air Pollution • 10 minutes

2 quizzes • Total 60 minutes

  • Week 2 Quiz • 30 minutes
  • Programming Assignment 1: Quiz • 30 minutes

3 programming assignments • Total 540 minutes

  • swirl Lesson 1: Logic • 180 minutes
  • swirl Lesson 2: Functions • 180 minutes
  • swirl Lesson 3: Dates and Times • 180 minutes

Week 3: Loop Functions and Debugging

We have now entered the third week of R Programming, which also marks the halfway point. The lectures this week cover loop functions and the debugging tools in R. These aspects of R make R useful for both interactive work and writing longer code, and so they are commonly used in practice.

8 videos 2 readings 1 quiz 2 programming assignments 1 peer review

8 videos • Total 61 minutes

  • Loop Functions - lapply • 9 minutes • Preview module
  • Loop Functions - apply • 7 minutes
  • Loop Functions - mapply • 4 minutes
  • Loop Functions - tapply • 3 minutes
  • Loop Functions - split • 9 minutes
  • Debugging Tools - Diagnosing the Problem • 12 minutes
  • Debugging Tools - Basic Tools • 6 minutes
  • Debugging Tools - Using the Tools • 8 minutes

2 readings • Total 20 minutes

  • Week 3: Loop Functions and Debugging • 10 minutes
  • Practical R Exercises in swirl Part 3 • 10 minutes
  • Week 3 Quiz • 30 minutes

2 programming assignments • Total 360 minutes

  • swirl Lesson 1: lapply and sapply • 180 minutes
  • swirl Lesson 2: vapply and tapply • 180 minutes

1 peer review • Total 60 minutes

  • Programming Assignment 2: Lexical Scoping • 60 minutes

Week 4: Simulation & Profiling

This week covers how to simulate data in R, which serves as the basis for doing simulation studies. We also cover the profiler in R which lets you collect detailed information on how your R functions are running and to identify bottlenecks that can be addressed. The profiler is a key tool in helping you optimize your programs. Finally, we cover the str function, which I personally believe is the most useful function in R.

6 videos 4 readings 2 quizzes 3 programming assignments

6 videos • Total 42 minutes

  • The str Function • 6 minutes • Preview module
  • Simulation - Generating Random Numbers • 7 minutes
  • Simulation - Simulating a Linear Model • 4 minutes
  • Simulation - Random Sampling • 2 minutes
  • R Profiler (part 1) • 10 minutes
  • R Profiler (part 2) • 10 minutes

4 readings • Total 40 minutes

  • Week 4: Simulation & Profiling • 10 minutes
  • Practical R Exercises in swirl Part 4 • 10 minutes
  • Programming Assignment 3 INSTRUCTIONS: Hospital Quality • 10 minutes
  • Post-Course Survey • 10 minutes
  • Week 4 Quiz • 30 minutes
  • Programming Assignment 3: Quiz • 30 minutes
  • swirl Lesson 1: Looking at Data • 180 minutes
  • swrl Lesson 2: Simulation • 180 minutes
  • swirl Lesson 3: Base Graphics • 180 minutes

programming assignment 3 hospital quality

The mission of The Johns Hopkins University is to educate its students and cultivate their capacity for life-long learning, to foster independent and original research, and to bring the benefits of discovery to the world.

Recommended if you're interested in Data Analysis

programming assignment 3 hospital quality

Johns Hopkins University

Data Science: Foundations using R

Specialization

programming assignment 3 hospital quality

The Data Scientist’s Toolbox

programming assignment 3 hospital quality

Getting and Cleaning Data

programming assignment 3 hospital quality

Reproducible Research

Why people choose coursera for their career.

programming assignment 3 hospital quality

Learner reviews

Showing 3 of 22173

22,173 reviews

Reviewed on Apr 28, 2016

This course fully meets my expectations. It provides a concise starting point and even manages to introduce advanced concepts such as the 'apply' family. The final assignment is fully appropriate.

Reviewed on Mar 5, 2021

It was a great course with an excellent teacher (Prof.Peng) who teaches all of the contents with extra details. However, I think it would have been better to bring more examples during teaching time.

Reviewed on Feb 3, 2016

The content is superbly designer for a beginner. The Swirl assignments need to make compulsory. Infact they contributed more to the learning process. More Swirl contents will make the course richer.

New to Data Analysis? Start here.

Placeholder

Open new doors with Coursera Plus

Unlimited access to 7,000+ world-class courses, hands-on projects, and job-ready certificate programs - all included in your subscription

Advance your career with an online degree

Earn a degree from world-class universities - 100% online

Join over 3,400 global companies that choose Coursera for Business

Upskill your employees to excel in the digital economy

Frequently asked questions

When will i have access to the lectures and assignments.

Access to lectures and assignments depends on your type of enrollment. If you take a course in audit mode, you will be able to see most course materials for free. To access graded assignments and to earn a Certificate, you will need to purchase the Certificate experience, during or after your audit. If you don't see the audit option:

The course may not offer an audit option. You can try a Free Trial instead, or apply for Financial Aid.

The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.

What will I get if I subscribe to this Specialization?

When you enroll in the course, you get access to all of the courses in the Specialization, and you earn a certificate when you complete the work. Your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile. If you only want to read and view the course content, you can audit the course for free.

What is the refund policy?

If you subscribed, you get a 7-day free trial during which you can cancel at no penalty. After that, we don’t give refunds, but you can cancel your subscription at any time. See our full refund policy Opens in a new tab .

Is financial aid available?

Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.

More questions

R Programming Assignment Three

Fraser stark, coursera r programming - hospital care outcomes, introduction.

The data for this assignment come from the Hospital Compare web site ( http://hospitalcompare.hhs.gov ) run by the U.S. Department of Health and Human Services. The purpose of the web site is to provide data and information about the quality of care at over 4,000 Medicare-certified hospitals in the U.S. This dataset essentially covers all major U.S. hospitals. This dataset is used for a variety of purposes, including determining whether hospitals should be fined for not providing high quality care to patients (see http://goo.gl/jAXFX for some background on this particular topic).

Read the data

1. plot the 30-day mortality rates for heart attack, 2. finding the best hospital in a state.

Write a function called best that take two arguments: the 2-character abbreviated name of a state and an outcome name. The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the best (i.e. lowest) 30-day mortality for the specified outcome in that state. The hospital name is the name provided in the Hospital.Name variable. The outcomes can be one of “heart attack”, “heart failure”, or “pneumonia”. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Some sample outputs

3. Ranking hospitals by outcome in a state

Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a state (state), an outcome (outcome), and the ranking of a hospital in that state for that outcome (num). The function reads the outcome-of-care-measures.csv file and returns a character vector with the name of the hospital that has the ranking specified by the num argument. For example, the call rankhospital(“MD”, “heart failure”, 5) would return a character vector containing the name of the hospital with the 5th lowest 30-day death rate for heart failure. The num argument can take values “best”, “worst”, or an integer indicating the ranking (smaller numbers are better). If the number given by num is larger than the number of hospitals in that state, then the function should return NA. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Sample outputs

4. Ranking hospitals in all states

Write a function called rankall that takes two arguments: an outcome name (outcome) and a hospital ranking (num). The function reads the outcome-of-care-measures.csv file and returns a 2-column data frame containing the hospital in each state that has the ranking specified in num. For example the function call rankall(“heart attack”, “best”) would return a data frame containing the names of the hospitals that are the best in their respective states for 30-day heart attack death rates. The function should return a value for every state (some may be NA). The first column in the data frame is named hospital, which contains the hospital name, and the second column is named state, which contains the 2-character abbreviation for the state name. Hospitals that do not have data on a particular outcome should be excluded from the set of hospitals when deciding the rankings.

Instantly share code, notes, and snippets.

@psgganesh

psgganesh / assignment3.md

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.
  • Learn more about clone URLs

R Programming Project 3

github repo for rest of specialization: Data Science Coursera

The zip file containing the data can be downloaded here: Assignment 3 Data

Part 1 Plot the 30-day mortality rates for heart attack ( outcome.R )

programming assignment 3 hospital quality

Part 2 Finding the best hospital in a state ( best.R )

Part 3 ranking hospitals by outcome in a state ( rankhospital.r ), part 4 ranking hospitals in all states ( rankall.r ).

Programming Assignment 3: Quiz >> R Programming

1. What result is returned by the following code?

  • CAROLINAS HOSPITAL SYSTEM
  • MCLEOD MEDICAL CENTER – DARLINGTON
  • MUSC MEDICAL CENTER
  • MARY BLACK MEMORIAL HOSPITAL
  • LAKE CITY COMMUNITY HOSPITAL
  • GRAND STRAND REG MED CENTER

2. What result is returned by the following code?

  • MAIMONIDES MEDICAL CENTER
  • NORTHERN DUTCHESS HOSPITAL
  • HOSPITAL FOR SPECIAL SURGERY
  • KINGSBROOK JEWISH MEDICAL CENTER
  • BROOKS MEMORIAL HOSPITAL
  • CROUSE HOSPITAL

3. What result is returned by the following code?

  • PROVIDENCE ALASKA MEDICAL CENTER
  • ALASKA NATIVE MEDICAL CENTER
  • YUKON KUSKOKWIM DELTA REG HOSPITAL
  • CENTRAL PENINSULA GENERAL HOSPITAL
  • CORDOVA COMMUNITY MEDICAL CENTER
  • MT EDGECUMBE HOSPITAL

4. What result is returned by the following code?

  • CATAWBA VALLEY MEDICAL CENTER
  • WAYNE MEMORIAL HOSPITAL
  • WAKEMED, CARY HOSPITAL
  • SPRUCE PINE COMMUNITY HOSPITAL
  • CAROLINAS MEDICAL CENTER-NORTHEAST
  • THOMASVILLE MEDICAL CENTER

5. What result is returned by the following code?

  • YAKIMA VALLEY MEMORIAL HOSPITAL
  • KENNEWICK GENERAL HOSPITAL
  • ST ANTHONY HOSPITAL
  • KADLEC REGIONAL MEDICAL CENTER
  • JEFFERSON HEALTHCARE HOSPITAL
  • TACOMA GENERAL ALLENMORE HOSPITAL

6. What result is returned by the following code?

  • WEST HOUSTON MEDICAL CENTER
  • SETON SMITHVILLE REGIONAL HOSPITAL
  • MEMORIAL HERMANN NORTHEAST
  • PROVIDENCE MEMORIAL HOSPITAL
  • UNIVERSITY OF TEXAS HEALTH SCIENCE CENTER AT TYLER
  • SCENIC MOUNTAIN MEDICAL CENTER

7. What result is returned by the following code?

  • FOREST HILLS HOSPITAL
  • NASSAU UNIVERSITY MEDICAL CENTER
  • BELLEVUE HOSPITAL CENTER
  • UNIVERSITY HOSPITAL S U N Y HEALTH SCIENCE CENTER
  • FLUSHING HOSPITAL MEDICAL CENTER
  • ADIRONDACK MEDICAL CENTER

8. What result is returned by the following code?

  • NORTH COUNTRY HOSPITAL AND HEALTH CENTER
  • CASTLE MEDICAL CENTER
  • SANFORD USD MEDICAL CENTER
  • ST FRANCIS MEDICAL CENTER
  • PARKLAND HEALTH AND HOSPITAL SYSTEM
  • CLARK REGIONAL MEDICAL CENTER

9. What result is returned by the following code?

  • POTTSTOWN MEMORIAL MEDICAL CENTER
  • BERGEN REGIONAL MEDICAL CENTER
  • LAURENS COUNTY HEALTHCARE SYSTEM
  • TERREBONNE GENERAL MEDICAL CENTER
  • BAY AREA HOSPITAL
  • LAKES REGION GENERAL HOSPITAL

10. What result is returned by the following code?

  • HAWAII MEDICAL CENTER EAST
  • RENOWN SOUTH MEADOWS MEDICAL CENTER
  • CARY MEDICAL CENTER
  • CARONDELET ST JOSEPHS HOSPITAL
  • YORK GENERAL HOSPITAL

Related Questions & Answers:

  • Week 1 Quiz >> R Programming Week 1 Quiz >> R Programming 1. R was developed by statisticians working at Microsoft Johns Hopkins University The University ... Read more...
  • Week 2 Quiz >> R Programming Week 2 Quiz >> R Programming 1. Suppose I define the following function in R cube <- function(x, n) {         ... Read more...
  • Week 3 Quiz >> R Programming Week 3 Quiz >> R Programming 1. Take a look at the ‘iris’ dataset that comes with R. The data ... Read more...
  • Week 4 Quiz >> R Programming Week 4 Quiz >> R Programming 1. What is produced at the end of this snippet of R code? set.seed(1) ... Read more...
  • Programming Assignment 1: Quiz >> R Programming Programming Assignment 1: Quiz >> R Programming 1. What value is returned by the following call to pollutantmean()? You should ... Read more...
  • Graded Quiz: Functions, Sub-Queries, Multiple Tables Graded Quiz: Functions, Sub-Queries, Multiple Tables >> Databases and SQL for Data Science with Python 1.Which of the following queries ... Read more...

Leave a Comment Cancel reply

Save my name, email, and website in this browser for the next time I comment.

Please Enable JavaScript in your Browser to Visit this Site.

  • Programming Assignment 3 - R Programming
  • by Wagner Pinheiro
  • Last updated over 7 years ago
  • Hide Comments (–) Share Hide Toolbars

Twitter Facebook Google+

Or copy & paste this link into an email or IM:

IMAGES

  1. Programming Assignment 3 Instructions Hospital Quality

    programming assignment 3 hospital quality

  2. Programming Assignment 3 Instructions Hospital Quality

    programming assignment 3 hospital quality

  3. Programming Assignment 3 Instructions Hospital Quality

    programming assignment 3 hospital quality

  4. GitHub

    programming assignment 3 hospital quality

  5. Programming Assignment 3 Instructions Hospital Quality

    programming assignment 3 hospital quality

  6. Programming Assignment 3 Instructions Hospital Quality

    programming assignment 3 hospital quality

VIDEO

  1. When and Where?

  2. NPTEL Programming In Java Week 7 Programming Assignment 3 Answers l March 2024

  3. Hospital Management Books 📚|1st Semester Book List+ Syllabus +Notes💗|Easy Or Hard? Personal Opinion

  4. #3 Hospital Management System Project Tutorial Login Module

  5. Hospital Management System

  6. 3. Project 2 Health Insurance Cost Prediction End To End Machine Learning Project

COMMENTS

  1. Programming Assignment 3: Hospital Quality

    This document contains information about many other files that are not included with this programming assignment. You will want to focus on the variables for Number 19 ("Outcome of Care Measures.csv") and Number 11 ("Hospital Data.csv"). You may find it useful to print out this document (at least the pages for Tables 19 and 11) to have ...

  2. akshaykher/Programming-Assignment-3-Hospital-Quality

    There are 3 tests that need to be passed for this part of the assignment. #3. Ranking hospitals by outcome in a state Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a state (state), an outcome (outcome), and the ranking of a hospital in that state for that outcome (num).

  3. SmitaVerma/Programming-Assignment-3

    Programming Assignment 3: Hospital Quality: Instructions Introduction Download the le ProgAssignment3-data.zip le containing the data for Programming Assignment 3 from the Coursera web site. Unzip the le in a directory that will serve as your working directory.

  4. R Programming Assignment 3: Hospital Quality // 小默的博客

    Introduction. Download the file ProgAssignment3-data.zipfile containing the data for Programming Assignment 3 from the Coursera web site. Unzip the file in a directory that will serve as your working directory. When you start up R make sure to change your working directory to the directory where you unzipped the data.

  5. R programming Assignment 3 week 4

    r programming assignment 3 week 4 fan ouyang 8/21/2017. ... ## hospital state ## ak <na> ak ## al d w mcmillan memorial hospital al ## ar arkansas methodist medical center ar ## az john c lincoln deer valley hospital az ## ca sherman oaks hospital ca ## co sky ridge medical center co ## ct midstate medical center ct ## dc <na> dc ## de <na> de ...

  6. Coursera

    Coursera - R Programming - Assignment 3 (Hospital Quality) test suites Raw. best-tests.R This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. ...

  7. Hospital Quality Project

    Hospital Quality Project nthehai01 2/9/2022. Introduction. Download the file ProgAssignment3-data.zip file containing the data for Programming Assignment 3 from the Coursera web site. Unzip the file in a directory that will serve as your working directory. When you start up R make sure to change your working directory to the directory where you ...

  8. RPubs

    Or copy & paste this link into an email or IM:

  9. R Programming-Assignment-3--Hospital-Quality

    R Programming-Assignment-3--Hospital-Quality. Contribute to basmaNasser/Programming-Assignment-3--Hospital-Quality development by creating an account on GitHub.

  10. R Programming Programming Assignment 3 (Week 4) John Hopkins Data

    And this course makes me do this for every assignment!!!!! By the way, I have a decent knowledge of programming where I gain from learning Python. I thought this class would be easy for me (after quickly going through the lecture videos), yet from the first assignment I began to scratch my head for an answer.

  11. GitHub

    If there is a tie for the best hospital for a given outcome, then the hospital names should\nbe sorted in alphabetical order and the first hospital in that set should be chosen (i.e. if hospitals "b", "c",\nand "f" are tied for best, then hospital "b" should be returned).

  12. Programming assignment 3 for Coursera "R Programming" course by Johns

    Star 2. Fork 26. Programming assignment 3 for Coursera "R Programming" course by Johns Hopkins University. Raw. best.R. best <- function (state, outcome) {. ## Read outcome data. ## Check that state and outcome are valid. ## Return hospital name in that state with lowest 30-day death.

  13. R Programming

    Week 1 Quiz • 30 minutes. 7 programming assignments • Total 1,260 minutes. swirl Lesson 1: Basic Building Blocks • 180 minutes. swirl Lesson 2: Workspace and Files • 180 minutes. swirl Lesson 3: Sequences of Numbers • 180 minutes. swirl Lesson 4: Vectors • 180 minutes. swirl Lesson 5: Missing Values • 180 minutes.

  14. R Programming Course (Johns Hopkins)

    13 videos 3 readings 2 quizzes 3 programming assignments. ... Programming Assignment 3 INSTRUCTIONS: Hospital Quality ... I am pleasantly surprised with the quality of this course. For a beginner, the Swirl exercises are incredibly helpful and I was able to build confidence in working with R because of them. ...

  15. R Programming Assignment Three

    R Programming Assignment Three Fraser Stark 20/09/2019. Coursera R Programming - Hospital Care Outcomes. Introduction. The data for this assignment come from the Hospital Compare web site ... The purpose of the web site is to provide data and information about the quality of care at over 4,000 Medicare-certified hospitals in the U.S. This ...

  16. Programming Assignment 3 INSTRUCTIONS: Hospital Qualityent

    RPubs - Programming Assignment 3 INSTRUCTIONS: Hospital Qualityent. Programming Assignment 3 INSTRUCTIONS: Hospital Qualityent. by Guilherme Nunes. Last updated over 3 years ago.

  17. RPubs

    Or copy & paste this link into an email or IM:

  18. R Programming Programming Assignment 3 (Week 4) John Hopkins Data

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window.

  19. kismaelci/Programming-Assignment-3-INSTRUCTIONS-Hospital-Quality

    Contribute to kismaelci/Programming-Assignment-3-INSTRUCTIONS-Hospital-Quality development by creating an account on GitHub. ... kismaelci/Programming-Assignment-3-INSTRUCTIONS-Hospital-Quality. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. ...

  20. Programming-Assignment-3-Hospital-Quality/rankhospital.R at master

    Programming-Assignment-3-Hospital-Quality / rankhospital.R Go to file Go to file T; Go to line L; Copy path Copy permalink; This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. Cannot retrieve contributors at this time.

  21. Programming Assignment 3: Quiz >> R Programming

    Programming Assignment 3: Quiz >> R Programming 1. What result is returned by the following code? best ("SC", "heart attack") CAROLINAS HOSPITAL SYSTEMMCLEOD MEDICAL CENTER - DARLINGTONMUSC MEDICAL CENTERMARY BLACK MEMORIAL HOSPITALLAKE CITY COMMUNITY HOSPITALGRAND STRAND REG MED CENTER 2. What result is returned by the following code? best ...

  22. GitHub

    A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior.

  23. RPubs

    Password. Forgot your password? Sign InCancel. RPubs. by RStudio. Sign inRegister. Programming Assignment 3 - R Programming. by Wagner Pinheiro. Last updatedover 7 years ago.