meanTable: Mean table.

Description Usage Arguments Value Examples

View source: R/meanTable.R

Description

Produces a 2- or 1-dimensional table of means (and a measure of variation) regarding a variable and one or two factors.

Usage

1
meanTable(value, ver.factor, hor.factor = NA, variation="se")

Arguments

value

numeric vector, for which the table should be created.

ver.factor

factor constituting the rows of the table.

hor.factor

factor constituting the columns of the table.

variation

can be either "se" or "sd". variation="se" computes the standard errors and variation="sd" the standard deviation.

Value

A mean table.

Examples

1
2
3
4
5
6
7
8
data(mydata)
mydata.sumscore <- rowSums(mydata[,c("item1", "item2", "item3", "item4")])
meanTable(mydata.sumscore, mydata$age_group7)
meanTable(mydata.sumscore, mydata$age_group7, mydata$sex)
meanTable(mydata.sumscore, mydata$sex, mydata$age_group7)
(tab <- meanTable(mydata.sumscore, mydata$age_group7, mydata$sex, variation="sd"))

#saveTable(tab, "meanTable.rtf")

psytabs documentation built on May 29, 2017, 10:52 p.m.