descstat {datana}R Documentation

Creates a descriptive statistics table for continuous variables

Description

Function to create a descriptive statistics table for continuous variables from a dataframe.

Usage

descstat(data = data, decnum = 4, full = FALSE)

Arguments

data

a dataframe containing numeric variables as columns.

decnum

the number of decimals to be used in the output.

full

TRUE for a longer output (i.e. more descriptive statistics). The default is to FALSE.

Details

The resulting table offers the main central and dispersion statistics.

Value

This function wraps descriptive statistics into a summarize table having the following descriptive statistics: sample size, minimum, maximum, mean, median, SD, and coefficient of variation. If the full option is set to TRUE, the following statistics are added to the table: 25th and 75th percentiles, the interquartile range, skewness, and kurtosis.

Author(s)

Christian Salas-Eljatib and Tomas Cayul.

Examples


#creating a ficticiuos dataframe
set.seed(1234)
df <- as.data.frame(cbind(variable1=rnorm(5, 0), variable2=rnorm(5, 2)))
## adding one missing value
df[3,1] <- NA
df
#' #using the function
descstat(data=df)
descstat(data=df,decnum=1)
descstat(df,2)

[Package datana version 1.0.5 Index]