weights(object, ...) ## Default S3 method: weights(object, ...) ## S3 method for class 'glm': weights(object, type = c("prior", "working"), ...)
object | An lm or glm object (the output of the lm() or glm() functions), or a list with a component named weights. |
... | arguments to be passed to or from future methods. (These are not used by the default or lm methods.) |
type | character object, specify type of returned weights, must be either "prior", the default, or "working". This is used only by the glm method: the default method returns the prior weights only (there are no "working" weights in least squares regression). |
library(Sdatasets) wlmfit <- lm(cost ~ age + type + car.age, data=Sdatasets::claims, weights=number, na.action=na.exclude) weights(wlmfit)glmfit <- glm(cbind(ncases, ncontrols) ~ agegp + C(tobgp, , 1) + C(alcgp, , 1), data = Sdatasets::esoph, family = binomial) weights(glmfit) weights(glmfit, type="working")