Create only one script file for this assignment. To be able to test the code, I should be able to execute the "bestFitFu

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create only one script file for this assignment. To be able to test the code, I should be able to execute the "bestFitFu

Post by answerhappygod »

Create Only One Script File For This Assignment To Be Able To Test The Code I Should Be Able To Execute The Bestfitfu 1
Create Only One Script File For This Assignment To Be Able To Test The Code I Should Be Able To Execute The Bestfitfu 1 (46.7 KiB) Viewed 16 times
Create Only One Script File For This Assignment To Be Able To Test The Code I Should Be Able To Execute The Bestfitfu 2
Create Only One Script File For This Assignment To Be Able To Test The Code I Should Be Able To Execute The Bestfitfu 2 (38.92 KiB) Viewed 16 times
Create Only One Script File For This Assignment To Be Able To Test The Code I Should Be Able To Execute The Bestfitfu 3
Create Only One Script File For This Assignment To Be Able To Test The Code I Should Be Able To Execute The Bestfitfu 3 (39.85 KiB) Viewed 16 times
Create only one script file for this assignment. To be able to test the code, I should be able to execute the "bestFitFun ()" function, which for this assignment serves as the equivalent of "main ()" in other languages. You may create other functions if you wish, but we will only use that one function to launch your code for marking. Tasks You are given a file called "assignment2.xlsx" that contains data on the COVID-19 pandemic in Canada. • A user will provide a file name (see below). o You must verify that this file exists. ▪ If it does not, report an error to the user and have them try again. No other error-checking is required for this assignment. Read that data in your script, and save it as "COVID19_data". Use the summary() function to show the o minimum, o 1st quartile o median, o mean o 3rd quartile, and
o the maximum of all columns. except the first two. Those are to be ignored. Find the best-fit function of the total vaccinations administered on a daily basis. The function has the form TV = a xebt Where TV is the total vaccinations, a and b are constants, and t is the day. • Write R code to calculate the value of these two constants using non-linear regression. Hint: Refer to the example given in the lecture, and follow the steps to transform the data to linear regression. • Your code must present two menus to the user. The first should look like this: MENU 1. Exponential Fit 2. Quit If the user selects 1, they should see this Please enter the name of the file to open: The user will enter "assignment2.xslx", at which point your code will load the script. Use the file name provided by the user. Once loaded, prompt the user for some start and end dates: Please enter the start date (dd/mm/yyyy): Please enter the end date (dd/mm/yyyy) : These start and end dates must fall between 01/02/2021 and 01/05/2021. The end date must be at least 60 days greater than the start date. • The code will find the best fit using the exponential function and then print the function to the user. Then, the user will be prompted with the second menu: MENU 1. Extrapolation 2. Main Menu If the user selects 2, go back one menu. If the user selects 1, the code will ask the user what date they would like to extrapolate to:
4 of 4 MENU 1. Extrapolation 2. Main Menu • If the user selects 2, go back one menu. If the user selects 1, the code will ask the user what date they would like to extrapolate to: Please enter the date to extrapolate to (dd/mm/yyyy) : • Calculate the estimated total vaccinations on that date and print the result. Plot the total vaccinations during the entered range, and plot the best-fit function on the same graph. You must use the right titles for the graph, x-axis and y-axis. . Finally, save the plot as total_vacc.pdf.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply