CommencerCommencer gratuitement

Pearson within groups

An A/B design has the benefit of being able to run the Pearson correlation within each group to further assess the relationship based on a potential influence, the grouping.

A company is interested in assessing the relationship between the amount of time spent searching on the website and amount of money spent on items for each ad. You determined a Pearson correlation is fitting given the linearity and normal distribution, and assessed the relationship ignoring groups. Perform the Pearson correlation test within each group, New and Old, stored under the Ad variable.

The SiteSales dataset has been loaded for you.

Cet exercice fait partie du cours

A/B Testing in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Run the Pearson correlation on the New ad
cor.test(___, 
         data = ___, 
         subset = ___,
         method = ___)
Modifier et exécuter le code