test.extract: Test statistic extractor.

Description Usage Arguments Details Value Author(s)

View source: R/testsummary.R

Description

A function to extract a test statistic or summary from different test and fitted model objects, and return in a standard format.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'htest'
test.extract(object, partial = NULL)
## S3 method for class 'survdiff'
test.extract(object, partial = NULL)
## S3 method for class 'lm'
test.extract(object, partial = NULL)
## S3 method for class 'glm'
test.extract(object, partial = NULL)
## S3 method for class 'coxph'
test.extract(object, partial = NULL)

Arguments

object

a fitted model object.

partial

character name of coefficient for partial test.

Details

The partial argument only works for numeric terms, not factors. Two level factors should be recoded as 0/1. Factors with more than two levels could in principle be detected and handled appropriately, but this is not currently implemented.

test.extract is implemented as a generic function, but handling of different tests of class htest requires if-else-if

The returned effect might be an effect size, but its main purpose is to indicate effect direction.

The df returned is always the df in the LRT sense, i.e. the number of additional free parameters. Hence not the same as the df reported by some htest, e.g. not the same as the df for a t-test.

Value

A named real vector with three elements, named “pval”, “effect” and “df”.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com


tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.