episode_strategy: Define a strategy to merge data of the same episode of a...

View source: R/episode_fusion.R

episode_strategyR Documentation

Define a strategy to merge data of the same episode of a participant

Description

Define a strategy to merge data of the same episode of a participant

Usage

episode_strategy(type, ...)

Arguments

type

name of the strategy to apply

...

variable names in weekly (columns) & parameters to apply (see details)

Details

Parameters:

The parameters will depends on the type of strategy

For a simple strategy (with no parameter attached to each variable), it will be the name of column to apply the strategy to

For a complex strategy it will be the variable name as argument name passed to this function and the parameters for the variables as the argument value

Type of strategies:

Several kind of strategies are useasble:

min

Minimal value of the variable for the episode

max

Maximal value of the variable for the episode

any

Any value TRUE will output TRUE

mean

Average value of variable for the episode

first

Take the first available value (not NA) in each episode surveys of participant

last

Take the last available value (not NA) in each episode surveys of participant

worst

Worst Strategy algorithm, see details

General warning:

You should be very careful by defining strategy on what data it will be applied. Some strategies will depends on how variables has been recoded or not. Some checks are done but they are not perfects.

Worst strategy:

Worst strategy will expect

See Also

Other episodes: episode_build(), episode_compute(), episode_design(), episode_fusion.simple_strategy(), episode_fusion.worst_strategy(), episode_fusion_strategy(), episode_fusion(), episode_prepare_data(), episode_select_participants()

Examples

## Not run: 
# Create an "any" strategy for some columns
episode_strategy("any", "chills", "cough", "fever")

# Define a worst strategy for "take.temp" column in weekly, and give the response order to use

episode_strategy("worst", "take.temp"=c('Yes','DontKnow','No'))

## End(Not run)

cturbelin/ifnBase documentation built on Nov. 5, 2023, 12:54 p.m.