l.describe: Calculate Descriptive Statistics for a Level-1 Variable

Description Usage Arguments Value Author(s) Examples

View source: R/l.describe.R

Description

Calculates several descriptive statistics for a level-1 variable. Can be grouped by time or person id (i.e., level-2 grouping variable).

Usage

1
l.describe(data, user_id, var_id, time_id = NULL, dec = 2)

Arguments

data

dataset stored as dataframe

user_id

the name of the level-2 grouping variable (e.g., person id); can be stored as a factor, numeric, or integer within a dataframe

var_id

the name of the level-1 variable you want to examine; should be stored as numeric or integer within a dataframe

time_id

if longitudinal, the name of the level-1 time variable (i.e., measurement occasion); should be stored as numeric or integer within a dataframe; if ignored, descriptive statistics are calculated by person id

dec

the number of decimals used to display descriptive statistics; defaults to 2

Value

returns a matrix with descriptive statistics for each time point or user

Author(s)

Myles A. Maillet, myles.a.maillet@gmail.com

Examples

1
2
l.describe(data = ds, user_id = 'id', var_id = 'l1_var')
l.describe(data = ds, user_id = 'id', var_id = 'l1_var', time_id = 'time')

myles-maillet/long.tools documentation built on Jan. 3, 2021, 12:37 a.m.