Data

1. What is the demographic profile of the respondents in terms of:


Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Sex

Frequency

The tables above provides the distributions of respondents in terms of sex and frequency. It can be seen that there are 90 females and 10 males; 78 of which used social media for 1-4 hours and 22 used it for 5-6 hours

2. Is there a significant difference on the variables inbound marketing and advertising when grouped according to:

2.1 Sex


Call:
lm(formula = `Inbound Marketing` ~ Advertising, data = Data)

Coefficients:
(Intercept)  Advertising  
     1.0014       0.7137  

From this, we may deduce that the data fail to satisfy two assumptions – Linearity and Homogeneity of Variance.

Loading required package: carData

Attaching package: 'car'
The following object is masked from 'package:dplyr':

    recode
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ forcats   1.0.0     ✔ readr     2.1.5
✔ ggplot2   3.4.4     ✔ stringr   1.5.1
✔ lubridate 1.9.3     ✔ tibble    3.2.1
✔ purrr     1.0.2     ✔ tidyr     1.3.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
✖ car::recode()   masks dplyr::recode()
✖ purrr::some()   masks car::some()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Attaching package: 'rstatix'


The following object is masked from 'package:stats':

    filter

2.1.1 Sex and Inbound Marketing

Normality Test


    Shapiro-Wilk normality test

data:  Data$`Inbound Marketing`
W = 0.89339, p-value = 7.002e-07

Since p-value = 7.002e-07 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.

Equality of Variance

Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
      Df F value  Pr(>F)  
group  1  5.4645 0.02144 *
      98                  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value is less than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is not met.


Attaching package: 'gplots'
The following object is masked from 'package:stats':

    lowess
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter

# A tibble: 2 × 11
  Sex    variable             n   min   max median   iqr  mean    sd    se    ci
  <fct>  <fct>            <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Female Inbound Marketi…    90   2.6   4      3.4   0.8  3.4  0.43  0.045 0.09 
2 Male   Inbound Marketi…    10   2.8   3.8    3     0.2  3.18 0.346 0.109 0.247

The mean of female and male is 3.40 and 3.18, respectively.

Mann Whitney U Test

# A tibble: 1 × 6
  .y.                   n statistic    df     p method        
* <chr>             <int>     <dbl> <int> <dbl> <chr>         
1 Inbound Marketing   100      2.39     1 0.122 Kruskal-Wallis

Based on the p-value, there is no significant difference on the variable Inbound Marketing when grouped according to sex.

2.1.2 Sex and Advertising

Normality Test


    Shapiro-Wilk normality test

data:  Data$Advertising
W = 0.87563, p-value = 1.191e-07

Since p-value = 1.191 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.

Equality of Variance

Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
      Df F value  Pr(>F)  
group  1  4.0405 0.04717 *
      98                  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value is less than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is not met.

Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter

# A tibble: 2 × 11
  Sex    variable        n   min   max median   iqr  mean    sd    se    ci
  <fct>  <fct>       <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Female Advertising    90   2.4   4      3.2  0.75  3.35 0.417 0.044 0.087
2 Male   Advertising    10   3     3.8    3    0.2   3.16 0.263 0.083 0.188

The mean of female and male is 3.349 and 3.160, respectively.

Mann Whitney U Test

# A tibble: 1 × 6
  .y.             n statistic    df     p method        
* <chr>       <int>     <dbl> <int> <dbl> <chr>         
1 Advertising   100      1.93     1 0.165 Kruskal-Wallis

Based on the p-value, there is no significant difference on the variable advertising when grouped according to sex.

2.2 Frequency

2.2.1 Frequency and Inbound Marketing

Normality Test


    Shapiro-Wilk normality test

data:  Data$`Inbound Marketing`
W = 0.89339, p-value = 7.002e-07

Since p-value = 7.002e-07 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.

Equality of Variance

Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  1  0.2675 0.6062
      98               

The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.

Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter

# A tibble: 2 × 11
  Frequency variable          n   min   max median   iqr  mean    sd    se    ci
  <fct>     <fct>         <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-4 hours Inbound Mark…    78   2.8     4    3.4   0.8  3.41 0.409 0.046 0.092
2 5-6 hours Inbound Mark…    22   2.6     4    3.1   0.6  3.26 0.476 0.101 0.211

The mean of 1-4 hours and 5-6 hours is 3.410 and 3.264, respectively.

Mann Whitney U Test

# A tibble: 1 × 6
  .y.                   n statistic    df     p method        
* <chr>             <int>     <dbl> <int> <dbl> <chr>         
1 Inbound Marketing   100      2.09     1 0.149 Kruskal-Wallis

Based on the p-value, there is significant difference was observed between the group pairs.

2.2.1 Frequency and Advertising

Normality Test


    Shapiro-Wilk normality test

data:  Data$Advertising
W = 0.87563, p-value = 1.191e-07

Since p-value = 1.191e-07 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.

Equality of Variance

Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  1    1.34 0.2499
      98               

The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.

Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter

# A tibble: 2 × 11
  Frequency variable        n   min   max median   iqr  mean    sd    se    ci
  <fct>     <fct>       <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-4 hours Advertising    78   2.6     4    3.2  0.75  3.37 0.406 0.046 0.091
2 5-6 hours Advertising    22   2.4     4    3    0.2   3.17 0.382 0.081 0.169

The mean of 1-4 hours and 5-6 hours is 3.374 and 3.173, respectively.

Mann Whitney U Test

# A tibble: 1 × 6
  .y.             n statistic    df      p method        
* <chr>       <int>     <dbl> <int>  <dbl> <chr>         
1 Advertising   100      4.20     1 0.0404 Kruskal-Wallis

Based on the p-value, there is significant difference observed between the group pairs.

3. Is there a significant difference between inbound marketing and advertising?

Normality Test


    Shapiro-Wilk normality test

data:  Data1$Scores
W = 0.88909, p-value = 5.352e-11

Since p-value = 5.352e-11 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.

Equality of Variance

Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
       Df F value Pr(>F)
group   1  1.6175 0.2049
      198               

The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.

Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter

# A tibble: 2 × 11
  Variables      variable     n   min   max median   iqr  mean    sd    se    ci
  <fct>          <fct>    <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Inbound Marke… Scores     100   2.6     4    3.2   0.8  3.38 0.426 0.043 0.085
2 Advertising    Scores     100   2.4     4    3.2   0.6  3.33 0.407 0.041 0.081

The mean of physical health and mental health is 3.378 and 3.330, respectively.

Mann Whitney U Test

# A tibble: 1 × 6
  .y.        n statistic    df     p method        
* <chr>  <int>     <dbl> <int> <dbl> <chr>         
1 Scores   200     0.385     1 0.535 Kruskal-Wallis

Based on the p-value, there is no significant difference between physical health and mental health.

4. On which variable does social media marketing have the most significant impact?

Based on the provided output above, we can say that it is the inbound marketing.