Learn R Programming

VizTest (version 0.4)

gen_z: Calculate z-score for Confidence Interval Overlap

Description

Calculates the z-score required such that confidence intervals do not overlap under the null hypothesis withe a specified probability.

Usage

gen_z(b, v, alpha = 0.05, df = Inf, ...)

Value

A list with two elements: ave_z: A data frame with one row for each estimate in b and the following variables:

  • vij: observation number

  • s_zb: standard deviation of the z-scores across all pairs of intervals containing that estimate.

  • min_zb, max_zb: The minimum and maximum z-scores for the pairs of intervals containing that estimate.

  • zb: The mean z-score for the pairs of intervals containing that estimate.

  • ci: The confidence level corresponding to zb. all_z: A data frame with one row for each pair of estimates in b and the following variables:

  • i, j: The indices of the two estimates in the pair.

  • s_i, s_j: The standard errors of the two estimates in the pair.

  • theta: The ratio of the standard errors of the two estimates.

  • rho: The correlation between the two estimates.

  • zb: The z-score for the pair of estimates.

  • ci : The confidence level corresponding to zb.

  • olap_ave The probability that the two intervals do not overlap under the null hypothesis.

  • olap_84 The probability that two 84% confidence intervals for the estimates in the pair would not overlap under the null hypothesis.

Arguments

b

A vector of estiamtes

v

The variance-covariance matrix for b.

alpha

The desired probability at which the confidence intervals do not overlap under the null hypothesis.

df

Degrees of freedom for the t-distribution, defaults to Inf indicating a normal distribution.

...

Other arguments passed down, currently not implemented.

References

Harvey Goldstein and Michael J.R. Healy. (1995) "The Graphical Presentation of A Collection of Means." Journal of the Royal Statistical Society, Series A 158(1): 175-177 doi:10.2307/2983411. David Afshartous and Richard A. Preston. (2010) "Confidence Intervals for Dependent Data: Equating Non-overlap with Statistical Significance." Computational Statistics and Data Analysis 54: 2296-2305 doi:10.1016/j.csda.2010.04.011

Examples

Run this code
data(mtcars)
mod <- lm(mpg ~ wt + hp + disp + vs, data=mtcars)
gen_z(coef(mod), vcov(mod))

Run the code above in your browser using DataLab