xtp {poliscidata}R Documentation

Cross tabulation Analysis

Description

Generates cross-tabulation of dependent and indendent variables, also creates a mosiac plot. Makes use of the crosstab function in the descr package.

Usage

xtp(
  data,
  y,
  x,
  w = NULL,
  ylab = NULL,
  xlab = NULL,
  main = NULL,
  digits = 2,
  chisq = FALSE
)

Arguments

data

Dataset (like gss, nes, states, or world)

y

Dependent variable

x

Independent variable

w

Weights (optional)

ylab

Y-axis label (optional)

xlab

X-axis label (optional)

main

Main label for plot (optional)

digits

Number of digits to report after decimal place, optional (default = 2)

chisq

Do you want Chi-Squared test reported? (default is FALSE)

Value

A data frame of the cross tabulation results

Examples

   library(poliscidata)
   
   xtp(gss, grass, attend3, wtss)

[Package poliscidata version 2.3.0 Index]