Description Usage Arguments Details Value Examples
Takes statistics returned from adjust_park_factors() and turns them into MLEs
1 |
stats |
data.frame of player statistics. Obtained from adjust_park_factors() |
mles |
data.frame of multipliers for MLEs. Must be in proper form. |
type |
character. Whether these are batting or pitching data. Defaults to batting |
stats
are left joined with mles
. If any MLEs are
missing, they are set to average (which is 1). The statistics are turned
into long format using gather
from the tidyr
package.
For batters statistics are adjusted by multiplying by the multiplier
adjusted = Count * MLE
. For pitchers, statistics are divided by the multiplier
adjusted = Count / MLE
. Extraneous columns are discarded
then the data are returned to a wide format using spread
from
the tidyr
package.
Since the same multiplier is used for batters and pitchers, it is assumed that the transition from one level to the next is the same for batters and pitchers. That is, this assumes that strikeouts increase for batters and decrease for pitchers at the same rate when changing level. Additional research could be done to see if this assumption is valid.
tbl_df
of statistics that have been adjusted for level
effects.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.