estat: Descriptive statistics for continuous variables.

Description Usage Arguments Value See Also Examples

Description

estat calculates descriptives of numerical variables.

Usage

1
estat(object = NULL, formula = NULL, data = NULL, digits = 2, label = NULL)

Arguments

object

When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. See details and examples.

formula

A formula with shape: ~ x or ~ x|z (for groups).

data

A data frame where the variables in the formula can be found.

digits

Number of digits for rounding (default = 2).

label

Label used to display the name of the variable (see examples).

Value

A data frame with descriptive statistics.

See Also

summary, mytable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(kfm, package = "ISwR")
require(sjlabelled, quietly = TRUE)
kfm = kfm %>%
var_labels(
  dl.milk = 'Breast-milk intake (dl/day)',
  sex = 'Sex',
  weight = 'Child weight (kg)',
  ml.suppl = 'Milk substitute (ml/day)',
  mat.weight = 'Maternal weight (kg)',
  mat.height = 'Maternal height (cm)'
 )

kfm %>%
  estat(~ dl.milk)

estat(~ dl.milk|sex, data = kfm)

kfm %>%
  estat(~ weight|sex)

pubh documentation built on Feb. 17, 2021, 1:08 a.m.