Question: Question 9 (18 pts) Initialize a data frame named my_binon_stats with 18 rows and 2 columns. Name the first column y and the second column

Question 9 (18 pts) Initialize a data frame named my_binon_stats with 18 rows and 2 columns. Name the first column y and the second column pdf_y . Set the first column, y , to the possible outcomes from a Binom (size = 17, prob = 0.83) (BE CAREFUL WITH THIS STEP!), and fill pdf_y using the appropriate stats package funtion. Initialize a second, empty data frame named my_binom_loops with 18 rows and 2 columns. Name the first column y and the second column pdf_y . Then, using nested loops: . Iterate over the 18 rows. . Iterate over the 2 columns . IF the inner loop is on the first column, add the appropriate number to the y column. . OTHERWISE, fill pdf_y using the appropriate stats package funtion. Finally, use the all_equal () function (from the dplyr package) to confirm that the my_binom_stats and the my_binon_loops data frames are equivalent. # BRITE YOUR SOLUTION HERE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
