pt_summary: Descriptive statistics

View source: R/pt_summary.R

pt_summaryR Documentation

Descriptive statistics

Description

This function provides basic summary descriptives of the purchase task indicators of the entire sample or by a grouping variable. See details for full list of summary statistics provided.

Usage

pt_summary(pt, pt_vars, group_var = NULL)

Arguments

pt

A data frame consisting of the purchase variables 'pt_vars' to summarize.

pt_vars

The purchase task variables to summarize.

group_var

An optional grouping variable to summarize the purchase task variables by.

Details

This function will return the following descriptives: The number of individuals with a non-missing value ('Ntot'), as well as the number of individuals with a missing value ('Nmiss'); The mean average ('Mean') and mean standard error ('SE'); as well as the minimum ('Min') and maximum ('Max') values of the variable(s).

Value

An object of type data frame

Examples

### --- Example Data
pt <- data.frame("ID" = c(1:36),
"Intensity" = c(10,12,15,0,99,11,7,6,12,7,8,10,5,6,10,0,3,
                7,5,0,2,3,5,6,10,15,12,7,0,9,0,6,7,8,4,5),
"Breakpoint" = c(1,2,5,0,10,3,0.5,0.2,0.3,3,4,5,7.5,0.5,2,0,0.1,
                 0.5,0.5,0,3,2,2,1,2,3,4,1,0,2,0,5,5,7.5,2,3))

### --- Function Example
pt_summary(pt, pt_vars = c("Intensity","Breakpoint"))


PBCAR/PThelper documentation built on May 13, 2024, 3:45 p.m.