Learn R Programming

sasLM (version 0.6.0)

tsum1: Table Summary 1 independent(x) variable

Description

Summarize a continuous dependent(y) variable with one independent(x) variable.

Usage

tsum1(d, y, u, e=c("mean", "sd", "length"), ou="", 
        repl=list(c("length"), ("n")))

Arguments

d

a data.frame or matrix with colnames

y

y variable name. a continuous variable

u

x variable name, upper side variable

e

a vector of summarize function names

ou

order of levels of upper side x variable

repl

list of strings to replace after summarize. Length of list should be 2, and both should have the same length.

Value

A data.frame of summarized values. Row names are from e names. Column names are from the levels of x variable.

Details

A convenient summarization function for a continuous variable with one x varaible.

See Also

tsum, tsum0, tsum2, tsum3

Examples

Run this code
# NOT RUN {
tsum1(CO2, "uptake", "Treatment")
tsum1(CO2, "uptake", "Treatment", 
      e=c("mean", "median", "sd", "min", "max", "length"), 
      ou=c("chilled", "nonchilled"),
      repl=list(c("median", "length"), c("med", "n")))
# }

Run the code above in your browser using DataLab