E: Expectation

Description Usage Arguments Value Note Examples

View source: R/PE.R

Description

Expectation

Usage

1
E(..., weights = "N", keep_df = FALSE)

Arguments

...

What to compute the expectation of

weights

The name of the column containing sample weights. Set to NULL for no weighting.

keep_df

If TRUE, the resulting data frame is returned (which will contain additional columns for conditioned variables).

Value

A numeric vector containing the computed expectation.

Note

Assumes a data frame named "dat" is defined in the global environment. This will be modified in future versions.

Examples

1
2
3
4
E(Y)
E(Y | A == 0)
E(Y | A)
E(Y | A == 0, C)

tgrimes/PE documentation built on Sept. 2, 2020, 2:49 p.m.