Summarize a Variable in a Long Dataset by ID
Arguments
- data
A data.table object, long format
- var
A character string, the name of the variable to summarize
- idvar
A character string, the name of the grouping variable
- CI
A numeric value, the confidence interval to use. Default is .95.
- robust
A logical. Default is
FALSE
. IfTRUE
, the function will use the median as the estimate. IfFALSE
, the function will use the mean as the estimate.