Yes, a MNL (Multinomial Logit) model can be run on raw data from an Elo-based system. However, it's important to note that Elo ratings are not designed to be used as a discrete variable, but rather as a continuous measure of skill. Therefore, when using Elo ratings as a predictor in a MNL model, it's important to first transform the ratings into a discrete variable.
One common way to do this is to bin the Elo ratings into a certain number of groups, such as quartiles. For example, you could divide the ratings into four groups, with each group representing a certain range of ratings. This would allow you to use the Elo ratings as a discrete predictor in a MNL model.
Here's an example of how you could do this in Python using the statsmodels library:
from sklearn.preprocessing import KBinsDiscretizer
import pandas as pd
import numpy as np
from statsmodels.discrete.discrete_model import MNLogit
# Load the raw data
df = pd.read_csv("chess_ratings.csv")
# Bin the Elo ratings into four groups
encoder = KBinsDiscretizer(n_bins=4, encode="ordinal")
df["rating_group"] = encoder.fit_transform(df[["rating"]])
# Select the dependent variable and predictor variables
y = df["result"]
X = df[["rating_group", "white_age", "white_gender", "black_age", "black_gender"]]
# Fit the MNL model
model = MNLogit(y, X)
results = model.fit()
# Print the results
print(results.summary())
In this example, the dependent variable is the result of the chess game (win, loss or draw), and the predictor variables are the Elo rating group, the age and gender of the white player, and the age and gender of the black player. The MNL model is then fit to the data, and the results are printed.
It's important to note that this is just an example, and the specific approach you take will depend on the nature of your data and the research question you are trying to answer. It's also important to carefully consider the assumptions of the MNL model and whether they are appropriate for your data.