Skip to contents

Applies glmnet coefficients to single-match box-score stats. This is the per-game equivalent of PSR — how valuable was this player's stat line in this specific match?

Usage

calculate_psv(player_game_data, coef_df, exposure_adjust = TRUE, center = TRUE)

Arguments

player_game_data

data.table from load_player_game_data.

coef_df

data.frame with columns stat_name and beta.

exposure_adjust

Logical. If TRUE (default), divide raw counts by balls to get per-ball rates matching the scale coefficients were trained on.

center

Logical. If TRUE (default), subtract per-match mean so PSV represents value above average player in that match.

Value

data.table with identifier columns plus psv_raw and psv.