describeC | R Documentation |
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.
describeC(x, w, data, digits = 3, printC = FALSE)
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) |
Table of descriptive statistics
Generate Descriptive Statistics with RCPA3 Package's describeC Function 17:40
Complete Playlist of RCPA3 Package Tutorial Videos, includes video for this function and many more.
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.
Tutorials & Resources for Descriptive Statistics, Compiled by Barry C. Edwards
Sage Edge Resources for Political Analysis Series, for streaming videos, flashcards, and more student resources for textbooks by Pollock and Edwards, from Sage Publications.
Political Science Data Web Site: Find datasets for your own research and resources to help with the analysis.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.