fit_model: Internal regression functions

Description Usage Arguments Details Value See Also

View source: R/ICP-fitters.R

Description

The fit_model function is a generic function meant for internal use in the ICPSurv package, and as such it is not exported to the namespace.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
fit_model(method, Y, X, subset, ...)

## Default S3 method:
fit_model(method, Y, X, subset = NULL, ...)

## S3 method for class 'lm'
fit_model(method, Y, X, subset = NULL, ...)

## S3 method for class 'glm'
fit_model(method, Y, X, subset = NULL, ...)

## S3 method for class 'ph'
fit_model(method, Y, X, subset = NULL, ...)

## S3 method for class 'ah'
fit_model(method, Y, X, subset = NULL, ...)

## S3 method for class 'hazard'
fit_model(method, Y, X, subset = NULL, ...)

fit_nonparam_model(method, Y, X, subset, ...)

## Default S3 method:
fit_nonparam_model(method, Y, X, subset = NULL, ...)

## S3 method for class 'ph'
fit_nonparam_model(method, Y, X, subset = NULL, id = NULL, ...)

## S3 method for class 'ah'
fit_nonparam_model(method, Y, X, subset = NULL, id = NULL, ...)

Arguments

method

a method object created by the method_obj function.

Y

a vector or Surv object describing the target variable.

X

a matrix, vector or data frame describing the covariates.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

...

additional arguments to be passed to lower level functions.

id

for timevarying covariates the variable must associate each record with the id of a subject.

Details

The fit_model.X and fit_nonparam_model.X functions are internal fitter functions. They are usually all quite simple as their main functionality apart from fitting the model is ensureing that the output is compatible with the plausible_predictor_tests.

All fit_model methods must return the following:

All fit_nonparam_model methods must return the following:

Morover if n.sim in the method is non-zero then the fit_nonparam_model also returnes the following

Value

Both the fit_model and fit_nonparam_model methods return a list.

fit_model methods must return the following:

coefficients

The estimated regression coefficients.

deviance

The deviance of the fitted model, i.e. -2 log(likelihood)

df

Degrees of freedom in fitted model.

scale

Scale.

fit_nonparam_model methods return the following:

cum

Cumulative regression coefficient.

cum.var

Cumulative variance of regression effects.

sup

Kolmogorov–Smirnov test (only returned if n.sim not zero).

int

Cramér–von Mises test (only returned if n.sim not zero).

See Also

ICP, plausible_predictor_test for the full wrapper functions.


Laksafoss/ICPSurv documentation built on Feb. 26, 2020, 11:32 a.m.