Learn R Programming

IHW (version 1.0.2)

plot,ihwResult-method: Convenience function to plot weights learned by ihw method

Description

Convenience function to plot weights learned by ihw method

Usage

"plot"(x, x_axis = "group", scale = covariate_type(x))

Arguments

x
ihwResult Object
x_axis
Character, currently only "group" supported.
scale
Character, "ordinal" or "nominal"

Value

A ggplot2 object.

Examples

Run this code

   save.seed <- .Random.seed; set.seed(1)
   X   <- runif(20000, min=0.5, max=4.5) #covariate
   H   <- rbinom(20000,1,0.1)            #hypothesis true or false
   Z   <- rnorm(20000, H*X)              #Z-score
   .Random.seed <- save.seed
   pvalue <- 1-pnorm(Z)                  #pvalue
   ihw_res <- ihw(pvalue, X, .1)
   plot(ihw_res)

Run the code above in your browser using DataLab