CSR ANALYSIS WITH R
INFLUENCE OF CSR AWARENESS ON BRAND LOYALTY OF CONSUMERS IN
THE PHONE INDUSTRY USING R
The relationship between CSR awareness and brand loyalty appears to be strong and positive. The
Pearson correlation analysis shows a significant positive correlation between CSR awareness and
brand loyalty (r = 0.691, p < 0.001, 95% CI [0.635, 0.741]). This indicates that as CSR awareness
increases, brand loyalty tends to increase as well.
The Structural Equation Modeling (SEM) results provide even stronger evidence of this
relationship. The standardized path coefficient from CSR awareness to brand loyalty is 0.962 (p <
0.001), indicating a very strong positive influence. This suggests that CSR awareness is a powerful
predictor of brand loyalty in the context of the mobile phone industry.
The SEM model also shows good factor loadings for both CSR awareness and brand loyalty items,
further validating the measurement of these constructs. For example, the standardized loadings for
brand loyalty items range from 0.428 to 0.655. The model fit indices (CFI = 0.823, RMSEA =
0.119, SRMR = 0.072) suggest that while the model explains a significant portion of the data.
Fig. 4.1
Fig 4.1 shows how different aspects of a company’s Corporate Social Responsibility (CSR)
initiatives influence customer loyalty to the brand. It focuses on three key ideas: CSR willingness
(csr_w), CSR trust (csr_t), and brand loyalty (b_).
First, CSR willingness represents how much customers know about or are interested in a
company’s CSR activities. CSR trust reflects how much customers trust these initiatives. Brand
loyalty measures how committed customers are to sticking with the brand.
The arrows between these concepts show how they are connected. For example, when customers
have more trust in a company's CSR efforts (csr_t), they tend to be more loyal to the brand (b_),
as indicated by the positive number 0.56 on the arrow. Similarly, when customers are more aware
of or willing to engage with CSR (csr_w), it boosts their trust in CSR (0.39) and directly increases
their brand loyalty (0.43).
In conclusion, the model illustrates that effective communication of CSR initiatives, through
building both willingness to engage with and trust in these initiatives, can significantly enhance
brand loyalty. It shows that companies should focus not only on making customers aware of their
CSR activities but also on building trust to strengthen customer loyalty. This analysis can be
valuable for mobile phone companies seeking to improve their CSR communication strategies to
foster stronger brand loyalty among their customers.
APPENDIX
> data <- read.csv("C:/Users/HP/Desktop/Good1.csv", stringsAsFactors = FALSE)
> View(data)
> csr_awareness_items <- data[, paste0("Q", 1:5)]
> View(csr_awareness_items)
> View(data)
> # Calculate Cronbach's alpha for CSR awareness
> csr_awareness_alpha <- psych::alpha(csr_awareness_items)
> print(csr_awareness_alpha$total$raw_alpha)
> # Factor analysis for CSR awareness
> csr_awareness_fa <- fa(csr_awareness_items, nfactors = 1, rotate =
"varimax")
> print(csr_awareness_fa$loadings, cutoff = 0.3)
> # 2. Brand loyalty items
> loyalty_items <- data[, paste0("Q", 8:12)]
> # Calculate Cronbach's alpha for brand loyalty
> loyalty_alpha <- psych::alpha(loyalty_items)
> print(loyalty_alpha$total$raw_alpha)
> # Factor analysis for brand loyalty
> loyalty_fa <- fa(loyalty_items, nfactors = 1, rotate = "varimax")
> print(loyalty_fa$loadings, cutoff = 0.3)
> # 3. Consumer attitudes towards CSR
> csr_attitude_items <- data[, paste0("Q", 14:18)]
> # Calculate Cronbach's alpha for CSR attitudes
> csr_attitude_alpha <- psych::alpha(csr_attitude_items)
Some items ( Q14 ) were negatively correlated with the first principal
component and
probably should be reversed.
> # 3. Consumer attitudes towards CSR
> csr_attitude_items <- data[, paste0("Q", 14:18)]
> # Assuming the scale is 1-5, use this formula:
> data$Q14_reversed <- 6 - data$Q1
> # Create a new dataframe with the reversed item
> csr_attitude_items_reversed <- data[, c("Q14_reversed", paste0("Q",
15:18))]
> # Recalculate Cronbach's alpha with the reversed item
> csr_attitude_alpha_reversed <- psych::alpha(csr_attitude_items_reversed)
Some items ( Q14_reversed ) were negatively correlated with the first
principal component and
probably should be reversed.
To do this, run the function again with the 'check.keys=TRUE' optionWarning
message:
In psych::alpha(csr_attitude_items_reversed) :
Some items were negatively correlated with the first principal component
and probably
should be reversed.
To do this, run the function again with the 'check.keys=TRUE' option
> csr_attitude_alpha_reversed print(csr_attitude_alpha_reversed$total$raw_alpha)
> # Factor analysis with the reversed item
> csr_attitude_fa_reversed <- fa(csr_attitude_items_reversed, nfactors = 1,
rotate = "varimax")
> print(csr_attitude_fa_reversed$loadings, cutoff = 0.3)
> data$csr_awareness_mean <- rowMeans(data[, paste0("Q", 1:5)], na.rm = TRUE)
> data$brand_loyalty_mean <- rowMeans(data[, paste0("Q", 8:12)], na.rm =
TRUE)
> # Correlation analysis
> correlation <- cor.test(data$csr_awareness_mean, data$brand_loyalty_mean)
> correlation
> # Structural Equation Modeling (SEM) for a more comprehensive
analysis
> sem_model <- '
+ csr_awareness =~ Q1 + Q2 + Q3 + Q4 + Q5
+ brand_loyalty =~ Q8 + Q9 + Q10 + Q11 + Q12
+ brand_loyalty ~ csr_awareness
+ '
> sem_fit <- sem(sem_model, data = data)
> summary(sem_fit, standardized = TRUE, fit.measures = TRUE)
> # Define the mediation model
> mediation_model <- '
+ brand_loyalty_mean ~ c*csr_awareness_mean
+ csr_attitude_mean ~ a*csr_awareness_mean
+ brand_loyalty_mean ~ b*csr_attitude_mean
+ indirect := a*b
+ total := c + (a*b)
+ '
> # Fit the model
> fit <- sem(mediation_model, data = data)
Error: lavaan->lav_lavaan_step02_options():
missing observed variables in dataset: csr_attitude_mean
> if("Q14" %in% names(data)) {
+
data$Q14_reversed <- 6 - data$Q14 # Assuming it's a 5-point scale
+
data$csr_attitude_mean <- rowMeans(data[, c("Q14_reversed", paste0("Q",
15:18))], na.rm = TRUE)
+ } else {
+
# If Q14 doesn't exist, calculate without reversing
+
data$csr_attitude_mean <- rowMeans(data[, paste0("Q", 14:18)], na.rm =
TRUE)
+ }
> required_vars <- c("csr_awareness_mean", "brand_loyalty_mean",
"csr_attitude_mean")
> missing_vars <- required_vars[!required_vars %in% names(data)]
> mediation_model <- '
+
# Direct effect
+
brand_loyalty_mean ~ c*csr_awareness_mean
+
+
# Mediator
+
csr_attitude_mean ~ a*csr_awareness_mean
+
brand_loyalty_mean ~ b*csr_attitude_mean
+
+
# Indirect effect (a*b)
+
indirect := a*b
+
+
# Total effect
+
total := c + (a*b)
+ '
> fit <- sem(mediation_model, data = data)
> # Summary of the model
> summary(fit, standardized = TRUE, ci = TRUE)