CIprop {RCPA3}R Documentation

Confidence intervals of a dataset variable's sample proportions in table and figure

Description

Reports the confidence interval of sample proportions in table and plot. Default is 95% CI but use can raise or lower confidence level.

Usage

CIprop(x, w, data, digits = 3, level = 95, printC = FALSE, plot = TRUE,
  main, xlab, xlim, ...)

Arguments

x

A nominal or ordinal variable (factor), should be in dataset$var form unless dataset specified in optional data argument.

w

(Optional) Sampling weights of variable, must be numeric; should be in dataset$weightvar form unless dataset specified in optional data argument.

data

(Optional) Name of dataset that contains x (and w) variable.

digits

(Optional) Number of decimal places reported in result (defaults to 3).

level

(Optional) A single number equal to the desired confidence level (i.e. 95, 99, 90, etc.). Default value is 95 percent confidence level.

printC

(Optional) Do you want results printed to .html file in your working directory? Default is FALSE. Set to TRUE to print results.

plot

(Optional) Do you want a plot of the confidence interval? Default is TRUE.

main

(Optional) Change the main title of plot. Default title generated from level, x, and w.

xlab

(Optional) Label for x-axis of confidence interval plot.

xlim

(Optional) Modify x-axis limits of confidence interval plot.

...

(Optional) Additional arguments passed to plot function.

Value

Returns a data frame that gives the lower bound, point estimate, and upper bounds of each value of x variable.

RCPA3 Package Tutorial Videos

Textbook References

Online Resources

Examples

 
  library(RCPA3)

  CIprop(nes$lifex.knowimmig)
  
  
  # using optional w and data arguments
  CIprop(x=nes$lifex.knowimmig, w=nes$wt)
  CIprop(x=lifex.knowimmig, w=wt, data=nes)
  

[Package RCPA3 version 1.2.1 Index]