Instantly share code, notes, and snippets.

@mGalarnyk

mGalarnyk / quiz4.md

  • Download ZIP
  • Star ( 4 ) 4 You must be signed in to star a gist
  • Fork ( 4 ) 4 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
  • Save mGalarnyk/54d147b6b7e3ae874db646ec456966f6 to your computer and use it in GitHub Desktop.

R Programming Quiz 4

github repo for rest of specialization: Data Science Coursera

What is produced at the end of this snippet of R code?

A vector with the numbers 1, 1, 2, 4, 1

What R function can be used to generate standard Normal random variables?

When simulating data, why is using the set.seed() function important?

It ensures that the sequence of random numbers is reproducible.

Which function can be used to evaluate the inverse cumulative distribution function for the Poisson distribution?

Explanation

Probability distribution functions beginning with the q prefix are used to evaluate the quantile function.

What does the following code do?

Generate data from a Normal linear model

What R function can be used to generate Binomial random variables?

What aspect of the R runtime does the profiler keep track of when an R expression is evaluated?

the function call stack

Consider the following R code

(Assume that y, x1, and x2 are present in the workspace.) Without running the code, what percentage of the run time is spent in the lm function, based on the by.total method of normalization shown in summaryRprof() ?

When using by.total normalization, the top-level function (in this case, lm() ) always takes 100% of the time.

When using system.time() , what is the user time?

It is the time spent by the CPU evaluating an expression

Question 10

If a computer has more than one available processor and R is able to take advantage of that, then which of the following is true when using system.time() ?

Elapsed time may be smaller than user time

@BENFRANKOL

BENFRANKOL commented Jun 22, 2023

Sorry, something went wrong.

R programming Assignment 3 week 4

Course 2 r programming, assignment 3 (week 4), under data science by johns hopkins university, 1 plot the 30-day mortality rates for heart attack, 3 ranking hospitals by outcome in a state, 4 ranking hospitals in all states.

coursera r programming week 4 assignment answers

R Programming (JHU Coursera, Course 2)

Michael Galarnyk

Michael Galarnyk

Towards Data Science

The second course in the data science specialization, “R Programming” is an introductory course teaching users the basics of R. While I did think it went over the basics well, the assignment difficulty was a bit too much for true beginners to R. In result, I decided to post all my code on my github .

I did this course with a bit of a twist. Instead of working purely with data.frames, I decided to use the highly popular data.table package instead of just relying on data.frame which isn’t as widely used as data.table for large datasets.

Week 1 Highlights: Removing and Subsetting Data is a highly useful skill. The teaching of vectors, lists, matrices, and factors was superb. Wasn’t too difficult.

Week 2 Highlights: Lexical scoping as the reason why all objects must be stored in memory. Programming assignment is useful. As seen below, I have decided to do as much of the specialization in data.table syntax as possible since it is widely used in industry.

Week 2 Horrors: Lots of users have complained about the considerable increase in difficulty for this weeks project. That is partly why I decided to put all my work on my github.

Week 3 Highlights: Opportunity to Practice my data.table skills (or lack thereof) on the quiz below. It is good to see the use of common datasets used as they are easy to manipulate. The assignment wasn’t too bad.

Week 4 Highlights: The quiz wasn’t bad. Lectures on R Profiler. There was a good note on optimization being a priority when the code is designed, working, and understandable. Figuring out best hospital by state by ordering, groupby etc was fun. The assignment was a bit much in my opinion considering it is a beginner specialization. The thumbnail image is what I generated in the early portion of this assignment.

Overall, this was a highly useful course for industry as it teaches people to take data files and manipulate them. It did however expect too much too fast for beginners. Please let me know if you have any questions by leaving a comment!

Also, please see my Course 3 Getting and Cleaning Data Review !

Michael Galarnyk

Written by Michael Galarnyk

Data Scientist https://www.linkedin.com/in/michaelgalarnyk/

Text to speech

  • Coursera: R programming Week 2 Assignment
  • by Lingyun Gao
  • Last updated about 7 years ago
  • Hide Comments (–) Share Hide Toolbars

Twitter Facebook Google+

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

COMMENTS

  1. 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.

  2. R Programming, week (1-4) All Quiz Answers with Assignments

    course link: https://www.coursera.org/learn/r-programming?Friends support me to give you more useful videos.Subscribe me and comment me whatever courses you...

  3. RPubs

    R Pubs. by RStudio. Sign in Register. Coursera R programming week 4 assignment 3. by Haolei Fang. Last updated over 8 years ago. Comments (-)

  4. PDF Week.4.Quiz._.Coursera-Answers.pdf

    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.

  5. R Programming Quiz 4 (Week 4) John Hopkins Data Science ...

    If a computer has more than one available processor and R is able to take advantage of that, then which of the following is true when using system.time()? Answer Elapsed time may be smaller than user time

  6. R Programming

    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 necessar...

  7. HolubievIllya/Data-Analysis-with-R-Programming-Google

    This repository contains the answers for coursera's course "Data Analysis with R Programming" Module 1 : Programming and data analytics Module 2 : Programming using RStudio Module 3 : Working with data in R Module 4 : More about visualizations, aesthetics, and annotations Module 5 : Documentation and reports

  8. Week 4 Quiz >> R Programming

    Save my name, email, and website in this browser for the next time I comment. Week 4 Quiz >> R Programming 1. What is produced at the end of this snippet of R code? set.seed (1) rpois (5, 2) A vector with the numbers 1, 4, 1, 1, 5A vector with the numbers 1, 1, 2, 4, 1It is impossible to tell because the result is randomA….

  9. R programming Assignment 3 week 4

    R programming Assignment 3 week 4 Fan Ouyang 8/21/2017. Course 2 R Programming, Assignment 3 (Week 4), under Data Science by Johns Hopkins University. 1 Plot the 30-day mortality rates for heart attack

  10. Coursera Data Analysis with R Programming

    #Google#googleDataanalytics#Google_Data_Analytics #datascience #tools #final_assessmentCoursera - Data Analysis with R Programming -Module 4 challenge answer...

  11. Assignment for week 4 programming coursera

    Assignment for week 4 programming coursera. Please see pdf file "_2a0d228f9a48b3de85eedf022225fac9_ProgAssignment3.pdf" for the assignment brief.

  12. PDF {"payload":{"allShortcutsEnabled":false,"fileTree":{"R-Programming/Week

    {"payload":{"allShortcutsEnabled":false,"fileTree":{"R-Programming/Week-4":{"items":[{"name":"img","path":"R-Programming/Week-4/img","contentType":"directory"},{"name ...

  13. R Programming

    Ryan Tillis - R Programming - Data Science - Quiz 4 - Coursera. by Ryan Tillis. Last updated almost 8 years ago.

  14. R Programming (JHU Coursera, Course 2)

    Histogram Showing Mortality Rates (Part of Week 4 Assignment) The second course in the data science specialization, "R Programming" is an introductory course teaching users the basics of R. While I did think it went over the basics well, the assignment difficulty was a bit too much for true beginners to R.

  15. R Programming

    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. ... 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 ...

  16. R Programming Coursera Quiz Answers, Week (1-4) All Quiz Answers With

    R Programming Coursera Quiz Answers, Week (1-4) All Quiz Answers With Assignment You audit this course free on coursera but if you want certif...

  17. GitHub

    Programming Assignment 3 Instructions. ####Data The zip file containing the data for this assignment can be downloaded here: Programming Assignment 3 Data. For this assignment you will need to unzip this file in your working directory. Grading This assignment will be graded using unit tests executed via the submit script that you run on your ...

  18. 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 ...

  19. 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.

  20. RPubs

    R Pubs. by RStudio. Sign in Register. R Programming - Week 3 Assignment. by Ken Wood. Last updated almost 4 years ago. Comments (-) Share.

  21. Google Data Analytics Professional Certificate (Coursera)

    Quizzes & Assignment Solutions for Google Data Analytics Professional Certificate on Coursera. Also included a few resources on side that I found helpful. ... Spreadsheets, SQL, Tableau and R Programming. In addition to expert training and hands-on projects, you'll complete a case study that you can share with potential employers to showcase ...

  22. RPubs

    R Pubs. by RStudio. Sign in Register. Coursera: R programming Week 2 Assignment. by Lingyun Gao. Last updated about 7 years ago. Comments (-)