I've noticed many R models allow a "weights" parameter (e.g. cart, loess, gam,...). Most of the help functions describe it as "prior weights" for the data, but what does that actually mean?
I have data with many repeated cases and a binary response. I was hoping I could use "weights" to encode how many times each combination of input and response occurs, but this doesn't seem to work. I've also tried making the response the proportion of successes, and the weight the total trials for each combination of covariates, but this doesn't seem to work either (at least for gam). I'm trying to do this for all of the model types listed above, but for starters, how to do this for gam [mgcv package]?
Weights for a binomial response have a natural interpretation: the number of trials corresponding to each observation. If you have
ntrials of whichpare successes, you fit this withThe same works with
gamin both thegamandmgcvpackages.