plotmeansC: Plots mean comparison

Description Usage Arguments Value Examples

View source: R/plotmeansC.r

Description

Plots the mean values of a dependent variable at different values of nominal or ordinal independent variable. Makes use of survey package's svy

Usage

1
plotmeansC(data, function1 = NULL, function2 = NULL, function3, w = 1, ...)

Arguments

data

A dataset (e.g. gss, nes, states, or world) or design dataset (e.g. gssD, nesD, statesD, or worldD)

function1

A function in the form of ~ depvar

function2

A formula in the form of ~ indepvar

function3

A formula in the form of depvar ~ indepvar

w

Weights, in the form ~ weightvar (optional, not needed if you use a design dataset)

...

Additonal arguments passed to gplots package's plotmeans function

Value

No return

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
   library(poliscidata)
   
   plotmeansC(nesD, ~ft_hclinton, ~pid_x, ft_hclinton~pid_x, 
   xlab="Party Identification", ylab="Ratings of Hillary Clinton", 
   main="Ratings of Hillary Clinton by Party Identification")
   
   plotmeansC(nes,~envir,~pid_3,envir~pid_3,w=~wt,
   xlab="Party Identification",
   ylab="Percent Pro-Environment",
   main="Percentage Favoring Environment over Jobs,\n by Party ID")
   

Example output



poliscidata documentation built on July 8, 2020, 6:23 p.m.