describeC: Generates table of descriptive statistics for one or more...

View source: R/describeC.r

describeCR Documentation

Generates table of descriptive statistics for one or more variables in a dataset

Description

Prints a table of descriptive statistics for variable(s) specified with x argument. Works with variables measures at any level but output varies with level of measurement (e.g. you won't get standard deviation for a nominal variable). Option for weighting observations.

Usage

describeC(x, w, data, digits = 3, printC = FALSE)

Arguments

x

A variable or list of variables, 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).

printC

(Optional) Do you want to print table of descriptive statistics to .html file in working directory? (default: FALSE)

Value

Table of descriptive statistics

RCPA3 Package Tutorial Videos

Textbook References

  • Philip H. Pollock and Barry C. Edwards, An R Companion to Political Analysis, 3rd Edition (Thousand Oaks, CA: Sage Publications, Forthcoming 2022), Chapter 2.

  • Philip H. Pollock and Barry C. Edwards, The Essentials of Political Analysis, 6th Edition (Thousand Oaks, CA: Sage Publications, 2020), pp. 39-55. ISBN-13: 978-1506379616; ISBN-10: 150637961.

Online Resources

Examples

 
  library(RCPA3)
  
  
  # descriptive statistics for qualitative variables
  describeC(x=world$region)
  
  # descriptive statistics for numeric variable
  describeC(x=world$infant.mortality)
  
  # describe multiple variables in list, with optional w argument
  describeC(x=list(angry.about.things, approve.cong), w=wt, data=nes)
  

RCPA3 documentation built on May 29, 2024, 12:19 p.m.

Related to describeC in RCPA3...