Learn R Programming

datarium (version 0.2.0)

properties: Properties Data for Chi-square Test of Independence

Description

Contains the type of properties and the buyer types. Buyer categories are: "single male", "single female", "married couple" and "family".

The type of property these buyers purchased were sorted into four categories: "flat", "bungalow" (i.e., a one-storey home), "detached house" and "terrace" (i.e., a block of adjoining houses).

Chi-square test of independence can be used to assess the association between the type of buyer who purchases a property and the type of property that is purchased.

For a worked tutorial on this analysis, see the Datanovia lesson “Chi-Square Test of Independence in R: Are Two Variables Associated?” (https://www.datanovia.com/learn/biostatistics/categorical/chi-square-test-of-independence-in-r).

Usage

data("properties")

Arguments

Format

A data frame with 333 rows and 2 columns (stored as a tibble).

property_type

the type of property purchased: "flat", "bungalow", "detached house" or "terrace".

buyer_type

the type of buyer: "single male", "single female", "married couple" or "family".

See Also

Examples

Run this code
data("properties")
head(properties)

# Chi-square test of independence between buyer type and property type
chisq.test(table(properties$property_type, properties$buyer_type))

Run the code above in your browser using DataLab