meanSummary: Make mean summary table

View source: R/meanSummary.R

meanSummaryR Documentation

Make mean summary table

Description

Make mean summary table

Usage

meanSummary(
  data,
  X = NULL,
  Y = NULL,
  M = NULL,
  W = NULL,
  labels = labels,
  digits = 3,
  xlabels = NULL,
  maxylev = 6,
  mode = 1
)

Arguments

data

A data.frame

X

Name of independent variable

Y

Name of dependent variable

M

Name of mediator variable

W

Name of moderator variable

labels

A list of labels

digits

Integer indicating the number of decimal places

xlabels

Optional string vector

maxylev

maximal unique length of categorical variable

mode

integer

Examples

labels=list(X="cond",Y="reaction",M="pmi")
xlabels=c("Front Page","Interior Page")
meanSummary(data=pmi,labels=labels,xlabels=xlabels)
labels=list(X="frame",Y="justify",W="skeptic")
xlabels=c("Natural causes condition","Climate change condition")
meanSummary(data=disaster,labels=labels,xlabels=xlabels)
labels=list(X="protest",Y="liking",M="respappr")
meanSummary(data=protest,labels=labels)
meanSummary(data=protest,labels=labels,maxylev=2)

processR documentation built on Jan. 23, 2023, 5:44 p.m.