Title: Assignment: OA 4 Transformation & Recoding
Course: PSYC 301 Statistical Methods in Psychol

In this Online Assignment you will be putting into practice Chapter 6 concepts about changing data values in systematic ways and examining the data in a clearer manner, maybe to detect patterns.

There are several reasons to transform and recode data:

- For ease of communication
- To fit statistical analyses better
- To eliminate the adverse effect of unusual values
- And other reasons.

In this assignment we will look at the soccer yellow/red card data from MP1. If you didn't retain that data, click here to get it again.

After opening the MP1.omv data file in jamovi the first thing to do is make a change to the measurement scale of one of the variables. Change the Year variable to be nominal (it is currently continuous, which is jamovi's term for ratio and interval data, because both of those data types can be treated the same for nearly all statistical methods). You do that by clicking on the ruler icon on the drop-down selector and moving to the nominal type which has an overlapping circles icon.

The first thing we are doing is creating a cross-tabulation of the variables Color and Year. Recall that a cross tabulation is a table of the number of combinations of each level of the two variables. So, the result will be the number of yellow cards in each year and the number of red cards in each year and should look something like this (but with different numbers).

Year | Yellow | Red | Total
1996 | 328 | 35 | 363
1997 | 271 | 15 | 286
1998 | 356 | 29 | 385

- and
- so on
- to last year in data

To do this follow these steps.

1. If you did not do it already based on the statement above, convert Year from Continuous to Nominal.
2. Select the Frequencies icon (four boxes in a square) and pull the menu down to "Independent Samples".
3. Put Year in the Rows box and Color in the Columns box.
4. In a few moments a table resembling the above should appear. This table will be used for answering questions at the end of the assignment.

Now we are going to do a recoding of data. The basis of this transformation is about the history of the league started in only 1996.

- 1996-2002 The early troubled years, with oddball rules, low attendance, playing in NFL stadiums, poor revenues
- 2003-2006 Standing on its own, with emphasis on soccer dedicated stadiums, use of international standard rules, more robust revenue structure
- 2006-2017 "MLS 2.0" with the league expanding nearly every season, better television exposure, attracting big name Europeans (e.g., David Beckham).

We are going to recode the Year variable to fit the above and then see if there are notable differences among the phases with respect to cards dealt out.

Steps:

1. Click on the Data tab
2. Click once on the header of the Year column, it should highlight the entire column
3. Click Transform icon, which will open a variable drop down box with the name Year (2).
4. In the variable name box, replace the Year (2) name with MLS Phase.
5. Notice that next to Source variable is the word Year with the overlapping circles and a icon. Don't change that.
6. Below that is using transformation with a clickable drop down menu, click it and select create new transform. (note, these steps are reviewed in your textbook, also).
7. You should see something that looks like this:
8. $source is the internal designator in jamovi saying 'whatever the source variable is', because a transformation can be used more than once, for instance, with another source variable. This naming keeps it flexible for such use. In this case, it's referring to the variable Year which was designated in the first drop down.
9. Click where +Add recode condition is written and a new fx type thing will appear above the initial one shown.
10. It will say "If $source" then ghosted "> and e.g. 17000" and further over "use e.g. B". What that is saying is "If the source variable meets this criteria (for instance, greater than 17000) then use this new value (for instance, B" in this new variable"
11. We want all years less 2003 to be recoded as "Early", years from 2003 through 2006 to be recoded as "Standing", and the rest of the years "MLS 2.0".
12. So we do this:
  1. There's a tiny downward pointing triangle above and right of the ghost > symbol. Click that box and select the less than, < , symbol (you'll see our old friend ==, by the way).
  2. Click to the right of the less than symbol (no longer a ghost) and type '2003', (note the single quotes are needed)
  3. Click to the right of "use" and type 'Early'. (note the single quotes are needed)
13. Click the Add Recode Condition again and another If $source line will appear. Make it read for years less than 2006 using the steps above. Don't worry about it. The way this works is if the first condition is satisfied, it doesn't even look at the remainder. If the first condition is not satisfied, it moves to the next line.
14. Then, in the lowest box, click to the right of "else use" and type 'MLS 2.0' (remember the single quotes!)
15. Hit the return or enter key.
16. Click on the downward and upward arrows to get rid of the variable characteristics boxes.
17. Select the Analyses Tab
18. Select Exploration, then Descriptives.
  1. Put Minute in the Variables box
  2. Put MLS Phase in the Split by box

In the submission text box for this assignment write answers to the following questions based on examining the output from this work:

1) Ignoring 2018, what year had the fewest yellow cards given, how many yellow cards was that?

2) Also ignoring 2018, what year had the fewest red cards given, how many red cards was that?

3) Look at the trends in the means and medians for the minute in which cards were given to players for the three MLS phases. Describe in a sentence or two an interpretation of that trend directly and simply, no speculation about why it's happening. Note: The means and medians are the minute at which cards were given on average (the two measures of 'average'), across all the games in those spans of time.

Done!