skew {psych}R Documentation

Calculate skew for a vector, matrix, or data.frame

Description

Find the skew for each variable in a data.frame or matrix. Unlike skew in e1071, this calculates a different skew for each variable or column of a data.frame/matrix.

Usage

skew(x, na.rm = TRUE)

Arguments

x A data.frame or matrix
na.rm how to treat missing data

Details

given a matrix or data.frame x, find the skew for each column.

Value

if input is a matrix or data.frame, skew is a vector of skews

Note

The mean function supplies means for the columns of a data.frame, but the overall mean for a matrix. Mean will throw a warning for non-numeric data, but colMeans stops with non-numeric data. Thus, the function uses either mean (for data frames) or colMeans (for matrices). This is true for skew and kurtosi as well.

Author(s)

William Revelle

See Also

describe, describe.by, kurtosi

Examples

round(skew(attitude),2)


[Package psych version 1.0-33 Index]