[fbf06f]: / partyMod / R / reweight.R

Download this file

18 lines (14 with data), 658 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S3 generic for re-fitting a model object with new weights
reweight <- function(object, weights, ...) UseMethod("reweight")
reweight.linearModel <- function(object, weights, ...) {
fit <- linearModel@fit
do.call("fit", c(list(object = object$ModelEnv, weights = weights), object$addargs))
}
reweight.glinearModel <- function(object, weights, ...) {
fit <- glinearModel@fit
do.call("fit", c(list(object = object$ModelEnv, weights = weights), object$addargs))
}
reweight.survReg <- function(object, weights, ...) {
fit <- survReg@fit
do.call("fit", c(list(object = object$ModelEnv, weights = weights), object$addargs))
}