Question: Write your homework using R Markdown and submit it in HTML format via Canvas. Name your homework as HW#_LastName_FirstName, where# is the homework number (1,2,...).

Write your homework using R Markdown and submit it in HTML format via Canvas. Name your homework as "HW#_LastName_FirstName, where"#" is the homework number (1,2,...). In order to receive credits, you must include the necessary R codes, outputs and textual explanations in your submitted work. 1. Conditionals and iterations a. Load the data olympic as in Question 2 of Homework 2. Calculate the standard deviation (hint: use sd() ) for each column of olympic$tab . Use two methods: (i) the for loop; (ii) the function apply(). Display the results. b. Find the leap years between 1900 and 2018 using the for loop. You can look up the definition of leap year in Wikipedia. C. Calculate the values of the following Huber loss function at x = seq(-3,3, by=0.1). f(x) = 2[x] 1 if [x] > 1; f(x) = x if |x| 31 Save those values in a vector called y . Draw a plot of x against y using plot(x,y). Write your homework using R Markdown and submit it in HTML format via Canvas. Name your homework as "HW#_LastName_FirstName, where"#" is the homework number (1,2,...). In order to receive credits, you must include the necessary R codes, outputs and textual explanations in your submitted work. 1. Conditionals and iterations a. Load the data olympic as in Question 2 of Homework 2. Calculate the standard deviation (hint: use sd() ) for each column of olympic$tab . Use two methods: (i) the for loop; (ii) the function apply(). Display the results. b. Find the leap years between 1900 and 2018 using the for loop. You can look up the definition of leap year in Wikipedia. C. Calculate the values of the following Huber loss function at x = seq(-3,3, by=0.1). f(x) = 2[x] 1 if [x] > 1; f(x) = x if |x| 31 Save those values in a vector called y . Draw a plot of x against y using plot(x,y)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
