Learn R Programming

beezdemand (version 0.2.0)

GetDescriptives: Get Purchase Task Descriptive Summary

Description

Calculates descriptive statistics from purchase task data.

Usage

GetDescriptives(
  dat,
  bwplot = FALSE,
  outdir = "../plots/",
  device = "png",
  filename = "bwplot"
)

Value

Dataframe with descriptive statistics

Arguments

dat

Dataframe (long form)

bwplot

Boolean. If TRUE, a ggplot2 box and whisker plot is saved. Default is FALSE.

outdir

Character. Directory where plot will be saved. Be sure to include trailing '/'. Default location is one level up in "../plots/".

device

Character. Type of file. Default is "png". Can be "pdf".

filename

Character. Specify filename. Defualt is "bwplot".

Author

Brent Kaplan bkaplan.ku@gmail.com

Details

[Superseded]

GetDescriptives() has been superseded by get_descriptive_summary(), which provides a modern S3 interface with standardized methods (print(), summary(), plot()). GetDescriptives() will continue to work but is no longer recommended for new code.

Provides the following descriptive statistics from purchase task data at each price: mean consumption, median consumption, standard deviation of consumption, proportion of 0 values, number of NAs, minimum consumption, and maximum consumption.

See Also

get_descriptive_summary() for the modern interface

Examples

Run this code
GetDescriptives(apt)

Run the code above in your browser using DataLab