Information Systems, Fall 2022 Homework 3. Due Thursday, November 3, 11:59 pm.

Information Systems, Fall 2022

Homework 3.

Due Thursday, November 3, 11:59 pm.

This homework is done using R/R-Studio.

Open the script containing the examples from the class of October 20.

Run the script (no need to install/update the library if you did it before).

Question 1 (5 points): Using existing variables from the class example, add the following:

Find shots against/shots for ratio per team. Only include the code (no table) in the answer. (4 points)

Report the average ratio for all teams (don’t round) (1 point)

Question 2 (10 points):

Similarly to the class example, construct tables containing average hits per team per period, both for and against. Only include your code in the answer. (7 points).

(3 points): Using both average hits and shots tables, construct the table with average ratio of hits per shot for each team per period.

Report the average ratio (the average of the resulting table). Answer must include both the code and the number. Don’t round.

(Hint: you don’t need both ‘for’ and ‘against’, only ‘for’)

Question 3 (10 points + 1 extra):

Construct tables containing total goals for and against each team (the event name is ‘Goal’) with team id (you need two tables, or may join them if you know how). Only show the code. (7 points)

Find goal differences for each team (for – against), total number of goals (R function is sum(vector)), and the average goal difference.

Report the code, total goals, and the average (not the table with differences). (3 points)

Extra 2 points. Does your observed average goal difference make sense? Explain why (think of a ‘league’ with two teams that play each other once…). Is there anything in the previous results that doesn’t make sense by the same logic? Why could it be like that?