Question: --- output: pdf_document: default html_document: default --- --- title: 'Twitter Hashtags Basket Analysis' subtitle: 'BUA684 Module 1' author: - FirstName LastName date: `r format(Sys.time(), '%d
--- output: pdf_document: default html_document: default ---
--- title: 'Twitter Hashtags Basket Analysis' subtitle: 'BUA684 Module 1' author: - FirstName LastName date: "`r format(Sys.time(), '%d %B %Y')`" output: pdf_document ---
### Problem The aim of this assignment is to detect patterns of the use of hashtags associated with LLBean on Twitter. The findings of this analysis are expected to provide some, meaningful, strong and interesting evidences to support the company's better decisions on social media marketing strategy.
*Note: you can always ask your chatGPT programming assistant to explain each of the following R codes.*
### Data ```{r message=FALSE, warning=FALSE} # import data library(readr) LLBean_hashtags <- read_csv("LLBean_hashtags.csv") head(LLBean_hashtags) nrow(LLBean_hashtags)
# wrangle data library(dplyr) library(splitstackshape) LLBean<-LLBean_hashtags%>%filter(language == c('en'))%>% mutate(hashtags = gsub("\\[|\\]|'", "", hashtags))%>% cSplit("hashtags", ",") head(LLBean) LLBean_assoc<-LLBean%>%filter(hashtags_01!=" ")%>%select(-c(language)) head(LLBean_assoc) ncol(LLBean_assoc) nrow(LLBean_assoc) write.csv(LLBean_assoc, "LLBean_assoc.csv") ```
*Problem 1: How many attributes and data records in the raw dataset `LLBean_hashtags` and the wrangled dataset `LLBean_assoc`respectively? Also, what different features of Big Data are reflected in the two datasets respectively?*
**Your answer:( )**
*Problem 2: Based on the display of the first six data records in each of the datasets `LLBean_hashtags` and `LLBean_assoc`, what do the above R commands for data wrangling purpose accomplish?*
**Your answer:( )**
### Analysis ```{r message=FALSE, warning=FALSE, results='hide'} library(arules) # read the dataset "LLBean_assoc" of baskets database format LLBean_tr<-read.transactions("LLBean_assoc.csv", header=TRUE, format='basket', sep=',', rm.duplicates = TRUE) inspect(LLBean_tr[1:5]) ```
*Problem 3: Complete the following R commands to conduct a association rule learning analysis.* ```{r message=FALSE, warning=FALSE, results='hide'} # complete the following R command to generate association rules with minimum support of 0.1 # and minimum confidence of 0.5. Also, all the rules must have the hashtag "llbean" appearing # on the right-hand side. llbean.rhs.rules<-apriori(LLBean_tr,________)
```
```{r message=FALSE, warning=FALSE} # create a scatter plot showing all the learned rules in terms of support, confidence, and lift. library(arulesViz) plot(llbean.rhs.rules, main=" ") ```
*Problem 4: Comment on overall strength (based on confidence) and interestingness (based on lift) of the learned rules?*
**Your answer:( )**
```{r message=FALSE, warning=FALSE} # create a interactive network diagram showing all the generated rules. set.seed(2020) plot(llbean.rhs.rules, method="graph", engine = "htmlwidget") ```
*Problem 5: Set "Select by id" to be "llbean" and select THREE association rules you believe are most meaningful for helping the company in better decision making on social media marketing strategy.*
**Your answer:( )**
### Discussion *Reflect on the ways in which the three chosen association rules could contribute to the development of an enhanced social media marketing strategy for the company. Although this analysis won't be detailed here, you will have the opportunity to collaborate with your project team, allowing you to work together with your teammates to further examine this aspect and devise comprehensive marketing approaches*
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
