coef.rv: Statistical troubleshooting.

Description Usage Arguments Details Author(s) Examples

View source: R/revisit.R

Description

Functions to flag common statistical trouble spots.

Usage

1
2
t.test.rv(x,y,alpha=0.05,bonf=1) 
coef.rv(lmobj,alpha=0.05,usebonf=TRUE) 

Arguments

x

A numeric vector.

y

A numeric vector.

lmobj

An object of class 'lm' (including 'glm').

alpha

Significance level or 1 - confidence level.

bonf

Factor to use in Bonferroni correction.

usebonf

If true, apply Bonferroni correction.

Details

These functions search for common statistical trouble spots, such as small p-values that are associated with very small, possibly practically insignificant, effects, and issues with multiple inference.

The package aims to move users more toward using confidence intervals than p-values. A narrow confidence interval near 0 but not containing it may indicate lack of practically significance, while an interval containing 0 but mostly in "interesting" territory may be of some relevance.

The function t.test.rv is essentially a replacement for t.test, the standard R function for significance tests and confidence intervals for means. (Only the two-sample case is handled currently.) If the user anticipates making m intervals or tests, she should set bonf to m.

The function coef.rv is like the R function coef, which extracts coefficients from objects such as the value returned by lm and glm. This function again checks for misleadingly small p-values. If a Bonferroni adjustment is specified, then the Bonferroni factor is the length of the coefficient vector.

The output of coef.rv includes a warning column, which indicates that a small p-value may be of little or no practical significance in this particular case.

Computation of Bonferroni p-values is rudimentary; see the entry for R's p.adjust for other methods.

Methods for multiple inference other than Bonferroni are planned.

Author(s)

norm Matloff

Examples

1
2
3
4
lmout <- lm(mpg ~ .,data=mtcars) 
summary(lmout)  # the usual output
coef.rv(lmout,usebonf=FALSE)  # add confidence intervals
coef.rv(lmout,usebonf=TRUE)  # add Bonferroni

matloff/revisit documentation built on May 4, 2019, 4:23 p.m.