experiment: Do the specified analysis of the impact of the variables on...

Description Usage Arguments Value Examples

View source: R/experiments.R

Description

Performs the analysis specified on the variables (X) and measures (Y).

Usage

1
2
experiment(person, variables, measures, analysis = c("plot", "correlation",
  "anova", "compare_groups", "regression"), time_var)

Arguments

person

an instantiated Person object

variables

list of variables in person of interest, with structure list(source1 = c(var1, var2), source2 = c(var3, var4)) where source is a source of data as defined in a Person object, and var1 and var2 are variables from source1, while var3 and var4 are variables from source2

measures

list of measures in person of interest, with structure list(source1 = c(var1, var2), source2 = c(var3, var4)) where source is a source of data as defined in a Person object, and var1 and var2 are variables from source1, while var3 and var4 are variables from source2

analysis

list of ways in which to analyze the relationship between each variable and each measure - options are "plot", "correlation", "anova", "compare_groups", "regression"

time_var

the time variable that variables and measures are observed in (time, date, or datetime)

Value

NULL - results of analysis chosen are printed

Examples

1
2
3
4
5
6
data(EX)
experiment(person = EX, variables = list("fitbit_daily" = c("sleepDuration"),
                                         "util" = c("day_of_week")),
                        measures = list("fitbit_daily" = 
                                          c("restingHeartRate")),
                        analysis = c("plot"), time_var = c("date"))

lifelogr documentation built on May 2, 2019, 6:11 a.m.