Learn R Programming

datarium (version 0.2.0)

antismoking: Anti-Smoking Emotive Communication Data for McNemar Test

Description

Paired nominal data providing the smoking status 62 individuals before and after emotive video communications showing the danger of smoking. This a demo dataset for McNemar test.

It is the data set used in the Datanovia tutorial “McNemar's Test in R: Compare Paired Proportions (Before/After)” (https://www.datanovia.com/learn/biostatistics/categorical/mcnemar-test-in-r).

Usage

data("antismoking")

Arguments

Format

A data frame with 62 rows and 3 columns (stored as a tibble).

id

participant identifier (1 to 62).

before

the smoking status before the communication, "non.smoker" or "smoker".

after

the smoking status after the communication, "non.smoker" or "smoker".

See Also

Examples

Run this code
data(antismoking)
xtabs(~before + after, data = antismoking)

# McNemar test of the change in smoking status
mcnemar.test(table(antismoking$before, antismoking$after))

Run the code above in your browser using DataLab