aggregate_impute: Aggregate an imputed dataset

Description Usage Arguments Examples

Description

Aggregate an imputed dataset

Usage

1
2
3
4
5
6
7
aggregate_impute(object, grouping, fun)

## S4 method for signature 'ANY'
aggregate_impute(object, grouping, fun)

## S4 method for signature 'rawImputed'
aggregate_impute(object, grouping, fun)

Arguments

object

a rawImputed object

grouping

a vector of variables names to group the aggregation on

fun

the function to aggregate

Examples

1
2
3
4
5
dataset <- generateData(n.year = 10, n.site = 50, n.run = 1)
dataset$Count[sample(nrow(dataset), 50)] <- NA
model <- lm(Count ~ Year + factor(Period) + factor(Site), data = dataset)
imputed <- impute(data = dataset, model = model)
aggregate_impute(imputed, grouping = c("Year", "Period"), fun = sum)

ThierryO/multimput documentation built on May 10, 2017, 4:45 p.m.