R/reweight.R

Defines functions reweight.survReg reweight.glinearModel reweight.linearModel reweight

Documented in reweight reweight.glinearModel reweight.linearModel

## 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))
}

Try the party package in your browser

Any scripts or data that you put into this service are public.

party documentation built on March 31, 2023, 11:56 p.m.