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