# How to deal with various sample sizes in the calculation of a predictor variable?

Let's say one of the predictor variables in a regression model is 3-point shooting percentage. However, some of the observations (players) only have one or two attempts while others have several more. In a regression model, what are some techniques so the ability demonstrated over a large number of attempts will be awarded a relatively larger magnitude value than in cases where there are less attempts?

For example...

Player      3PA 3PM 3P%
Player 2    174 52  29.9%
Player 3    156 64  41.0%
Player 4    4   3   75.0%
Player 5    134 45  33.6%


Player #4's low sample size is not as reliable as the other observations but it's not meaningless. Are there transformations or other techniques for handling this?

• Typically in regression problems the predictors are assumed to be measured without error; errors-in-variables regression is often rather complicated ... I can't think of a really simple way of handling this. – Ben Bolker Sep 15 '18 at 1:42
• I agree with Ben's suggestion that you are looking at an error-in-variables setting. That said for something super-simple, why not directly use Wilson-type lower/upper CIs (or the CI width) as predictors too? This would allow encoding the "trust" in a particular measurement $x_i$ directly. Yes, it will attenuate the effect of the 3P% variable but it will give us relevant information to work with in a straightforward way. So for the 4 players shown, using $\alpha-0.05$ we get a new surrogate variable 3P%LCI=[..., 0.236, 0.336, 0.301, 0.261,...] for a conservative value of shooting ability. – usεr11852 says Reinstate Monic Sep 17 '18 at 21:18

In this particular case, perhaps you could try fitting a model of the form $$\texttt{Outcome}_i = \beta_0 + \beta_1 \texttt{PM}_i + \beta_2 \texttt{PA}_i + \varepsilon_i.$$ The interpretation of the regression coefficient $\beta_1$ will be what is the expected change in the $\texttt{Outcome}$ if $\texttt{PM}$ is increased by one unit but for players with the same $\texttt{PA}$.