# Chapter 11 Descriptives

## 11.1 Intro

The term ‘descriptives’ is typically used to refer to a set of measures summarizing a distribution, such as central tendency and spread measures.

### 11.1.1 Example dataset

This example uses the Rosetta Stats example dataset “pp15” (see Chapter 1 for information about the datasets and Chapter 3 for an explanation of how to load datasets).

### 11.1.2 Variable(s)

From this dataset, this example uses variables xtcUseDoseHigh, highDose_intention, highDose_attitude (all three numeric variables) and hasJob_bi (a dichotomous factor, i.e. a categorical variable).

## 11.2 Input: jamovi Figure 11.1: Opening the “Exploration” menu in jamovi.

## 11.3 Input: R

### 11.3.1 R: base

Use the following command:

summary(
dat[,
c(
"xtcUseDoseHigh",
"highDose_intention",
"highDose_attitude",
"hasJob_bi"
)
]
);

### 11.3.2 R: Rosetta

Use the following command:

rosetta::descr(
dat,
items = c(
"xtcUseDoseHigh",
"highDose_intention",
"highDose_attitude",
"hasJob_bi"
),
histogram = TRUE,
boxplot = TRUE
);

When ordering descriptives for a single variable (and in version 0.3.2 of the rosetta package, also for multiple variables), you can finetune which descriptives you get by passing TRUE or FALSE for arguments mean, meanCI, median, mode, var, sd, se, min, max, q1, q3, IQR, skewness, kurtosis, dip, totalN, missingN, and validN.

In addition, you can order histograms (or bar charts, for factors) and box plots (for numeric variables only) by passing histogram=TRUE and boxplot=TRUE, respectively.

If you omit the items argument, you get descriptives for all variables in the dataframe; and if you don’t pass a dataframe, but a single variable, you will just get the descriptives for that variable.

## 11.4 Input: SPSS

### 11.4.1 SPSS: GUI

First activate the pp15 dataset by clicking on it (see 2.4.1). Figure 11.2: Opening the “descriptives menu” in SPSS

Then select the variables of interest. Figure 11.3: Selection of variables of interest

### 11.4.2 SPSS: Syntax

Use the following command (this requires the dat dataset to be the active dataset, see 2.4.1):

DESCRIPTIVES VARIABLES=xtcUseDoseHigh highDose_intention highDose_attitude hasJob_bi
/STATISTICS=MEAN STDDEV MIN MAX.

## 11.5 Output: jamovi Figure 11.4: The produced descriptives output in jamovi

## 11.6 Output: R

### 11.6.1 R: rosetta

## Warning: ggrepel: 11 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

#### 11.6.1.1 Descriptives for variables in data frame pp15

mean meanCI median mode var sd min max skewness kurtosis dip totalN missingN validN
xtcUseDoseHigh 208.35 [193.2; 223.5] 180.0 200 17000.69 130.39 25.0 880.0 1.84 4.74 0.06 829 542 287
highDose_intention 2.37 [2.22; 2.51] 2.0 2 2.17 1.47 0.5 15.0 3.14 18.41 0.09 829 431 398
highDose_attitude 3.64 [3.52; 3.76] 3.8 4 1.16 1.08 1.0 6.4 -0.43 -0.05 0.04 829 525 304
##### 11.6.1.1.1 Frequencies for hasJob_bi
Frequencies Perc.Total Perc.Valid Cumulative
No 81 9.8 21.1 21.1
Yes 302 36.4 78.9 100.0
Total valid 383 46.2 100.0
NA (missing) 446 53.8
Total 829 100.0
##### 11.6.1.1.2 Histograms for variables in data frame pp15
## Warning: The dot-dot notation (..scaled..) was deprecated in ggplot2 3.4.0.
## ℹ Please use after_stat(scaled) instead.
## ℹ The deprecated feature was likely used in the ufs package.
##   Please report the issue at <https://gitlab.com/r-packages/ufs/-/issues>. Figure 11.5: Histograms for variables in data frame pp15

##### 11.6.1.1.3 Boxplots for variables in data frame pp15
## Warning: ggrepel: 11 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps Figure 11.6: Boxplots for variables in data frame pp15

## 11.7 Output: SPSS Figure 11.7: The descriptives produced in SPSS.