Accounting for sampling effort of independent variables in a regression analysis I would like the test whether the frequency of a cellular structure on a histology section is associated with (binary) patient outcomes. This would be a simple logistic regression of i.e. glm(outcome ~ structure_frequency). However, the size of the histology sections vary between patients, and I want to properly account for this difference in sampling effort (more structures will be counted on larger sections).
Offsets are used to account for sampling effort in the dependent variable, but how can I achieve a similar effect for independent variables?


the size of the histology sections vary between patients, and I want to properly account for this difference in sampling effort (more structures will be counted on larger sections)

The issue here is that the precision of a value for your structure_frequency predictor could depend on the area of the histological section examined. A standard way to deal with that is to specify weights for the observations that are inversely related to the estimated variances of the predictor observations. If your structure_frequency is based on some type of repeatedly measured Bernoulli-distributed variable like the fraction of cells showing some particular structure, then the variance of an estimated fraction $\hat p$ could be estimated by $\hat p(1-\hat p)/n$, where $n$ is the number of cells examined.
Be very, very careful before you do that, however. For one, the observations from which you calculate structure_frequency might not be independently distributed across the sections, as assumed above. For another, it might be that the size of the section is itself an outcome predictor. For example, you might have much larger sections available from late-stage tumors than from a early-stage tumors. In that case you might be overweighting the late-stage cases if you try to account for the imprecision of structure_frequency estimates this way.
