A fost dezvoltată o aplicație bazată pe experimente. Urmărim analizarea alegerilor și deciziilor unor indivizi, atât în nume propriu cât și în numele unei firme, atunci când informația de care aceștia dispun devine din ce în ce mai complexă.
Pentru această parte am solicitat răspunsurile a încă 3 persoane, la chestionarul deja creeat:
| ID | vârstă | Sistem | Personalitate | Atitudine | Dependență branduri de lux |
|---|---|---|---|---|---|
| AB | 24 | fast | optimistic, enthusiastic, passionate, spontaneous | risk lover | dependent |
| TPN | 24 | slow | logical, analytical, artistic, curious | averse | not dependent |
| AC | 28 | fast | calm, selfless, intelligent, balanced | risk neutral | little |
*Chestionarul împreună cu răspunsurile, pentru fiecare dintre cei 3, pot fi văzute în Anexa 1.
Răspunsurile celor 3 au fost procesate și adăugate unui set deja existent format din încă 45 de înregistrări. Astfel setul final de date conține răspunsurile a 48 de respondenți și 18 coloane.
head(chestionar)
## Nr Nume ID Varsta Sistem
## 1 1 Lazar_Stefania_Beatrice LSB 23 slow
## 2 2 DAM 23 slow
## 3 3 BAM 23 slow
## 4 4 AV 23 fast
## 5 5 VA 22 fast
## 6 6 GRM 22 slow
## Personalitate Atitudine
## 1 helpful, optimistic, pozitive, kind, respectful risk neutral
## 2 realistic, positive risk neutral
## 3 melancholic, calm, empathetic averse
## 4 ambitious, organized risk neutral
## 5 realistic, kind, stubborn risk neutral
## 6 stubborn, realistic, attentive, analitical, empathic averse
## Dep Reclame Recomandari Fericire Q1.PII Nota_Gucci Nota_Dior
## 1 little 4 8 3 6,9,7 6 9
## 2 not dependent 5 8 8 4,9,5 4 9
## 3 little 4 7 7 3,8,5 3 8
## 4 not dependent 4 6 7 5,6,9 5 6
## 5 little 2 6 5 3,9,4 3 9
## 6 not dependent 2 6 8 6,9,7 6 9
## Nota_Armani Q_1000 Tip_produs Q_firma
## 1 7 Dior perfume Dior
## 2 5 Dior make-up Dior
## 3 5 Dior perfume, make-up Dior
## 4 9 Armani perfume Armani
## 5 4 Dior perfume Dior
## 6 7 Dior clothes Gucci
Respondenții care au dat note mai mici decât 5 pentru Gucci :
#facem un filtru - selectati studentii care au dat note<5 pt gucci ----
chestionar%>%
select(ID, Nota_Gucci)%>%
filter(Nota_Gucci<5, Nota_Gucci!= 0)
## ID Nota_Gucci
## 1 DAM 4
## 2 BAM 3
## 3 VA 3
## 4 MGB 3
## 5 GM 3
## 6 DG 3
## 7 GSM 4
## 8 UDM 3
## 9 GMA 4
## 10 IAI 3
## 11 IP 4
## 12 TPN 3
## 13 AC 4
# dintre cei 3 respondenti, 2 au dat sub 5 pt gucci
Se poate observa că 13 de respondenți au dat note sub 5 pentru Gucci. Dintre cei 3 respondenți prezentați anterior, 2 au au dat note sub 5 pentru Gucci - TPN și AC. Cei doi au dat pentru restul firmelor note peste 5.
În tabelul de mai jos se pot observa studenții care au dat note peste 5 pentru toate brandurile.
#toti studentii care au dat note > 5 pt toate brandurile
chestionar%>%
select(ID, Nota_Gucci, Nota_Armani, Nota_Dior)%>%
filter(Nota_Dior>=5, Nota_Armani>=5, Nota_Gucci>=5)
## ID Nota_Gucci Nota_Armani Nota_Dior
## 1 LSB 6 7 9
## 2 AV 5 9 6
## 3 GRM 6 7 9
## 4 MD 5 8 7
## 5 BD 5 7 9
## 6 AS 8 10 9
## 7 AM 5 10 9
## 8 GIA 5 8 9
## 9 SEA 6 8 9
## 10 GM 6 6 6
## 11 ROG 10 6 10
## 12 HLE 7 7 7
## 13 VFM 5 5 5
## 14 AZ 5 7 7
## 15 EGP 6 9 8
## 16 TDC 5 7 7
## 17 TA 8 6 9
## 18 VI 6 6 8
## 19 CAF 5 8 7
## 20 ID 6 6 8
## 21 BAC 8 5 7
## 22 MP 8 6 9
## 23 BMT 9 7 10
## 24 SCM 7 6 9
## 25 DA 7 8 10
## 26 AB 10 7 8
#dintre cei 3 - doar AB, restul au dat amandoi 3 pt Gucci
Dintre cei 3 respondenți , numai AB a dat nota pentru Gucci peste 5, respectiv 10. Există numai 2 de 10 pentru Gucci. Desi a dat nota 10 pentru Gucci, ar alege să își cumpere parfum Dior. Totuși, dacă ar investi, ar investi în Gucci, dintre cele 3 branduri.
Mai jos am afișat media punctajului acordat pentru fericire, în functie de sistemul de gândire și notele acordate pentru fiecare brand.
# calculati media punctajului acordat pentru fericire, in functie de sistem si afisati notele pt cele 3 branduri
##view(chestionar)
# grupam dupa sistemul de gandire si dupa media fericirii, notele pt branduri
chestionar %>%
group_by(Sistem)%>%
summarise(meanFericire = mean(Fericire), meanDior = mean(Nota_Dior), meanGucci = mean(Nota_Gucci), meanArmani = mean(Nota_Armani))
## # A tibble: 3 x 5
## Sistem meanFericire meanDior meanGucci meanArmani
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 "" 8 9 7 6
## 2 "fast" 5.5 6.5 4.83 5.33
## 3 "slow" 6.77 7.06 4.74 5.94
Cei mai fericiti se pare că sunt sunt cei care nu au completat coloana aceasta. Tot ei sunt cei ce au dat cele mai mari note brandurilor. Se pare că cei cu sistemul de gândire slow sunt mai fericiți și dau note mai mari brandurilor. Totuși în cazul respondenților, AB - sistem fast, cota fericirii a fost mai mică decât in cazul TPN(slow) si AC(fast) - dar a dat cele mai mari note brandurilor, dintre cei trei. Diferența poate proveni din profilul psihologic al persoanei, este la curnt cu toate noutățile firmelor de lux, manechinelor și e în general în pas cu această industrie - fashion (fast fashion, luxury fashion, lifestyle). În condradicție cu ceilalți doi, care nu sunt orientați către această zonă și care au dat în consecință și note mai mici brandurilor deși, indiferent de sistem, au avut note foarte mari pentru fericire (tpn - 9, AC - 8).
Mai jos se poate observa cât de influențați sunt, în medie, respondenții chestionarului de recomandări și reclame.
#afisati media raspunsurilor referitoare la cat de influentati sunteti de reclame si recomandari
chestionar %>%
summarise(meanReclame = mean(Reclame), meanRecomandari = mean(Recomandari))
## meanReclame meanRecomandari
## 1 4.020833 6.6875
# suntem mai influentati de recomandari decat de reclame. Toti cei 3 respondenti au raspuns la fel ca majoritatea.
Se poate observa ca suntem mai influențați de recomandări decât de reclame.
Mai jos se pot vedea mediile notelor acordate și a fericirii în funcție de atitudinea față de risc. # ```{r, echo = FALSE} # #calculati media acordata brandurilor Dior Gucci si Armani precum si media indicatorului de fericire pe grupuri de atitudine fata de risc # chestionar %>% # group_by(Atitudine)%>% # summarise(meanFericire = mean(Fericire), meanDior = mean(Nota_Dior), meanGucci = mean(Nota_Gucci), meanArmani = mean(Nota_Armani)) # #cei neutrii la risc au dat cele mai mici note pt dior - AB e risk lover si a dat 8, restul au dat 7 (TPN aver si AC neutru) # #atitudinea pe care o declara respondentul influenteaza mediile
Mai jos se pot vedea mediile notelor acordate și a fericirii în funcție de atitudinea față de risc și sistem.
chestionar %>%
group_by(Sistem, Atitudine)%>%
summarise(meanFericire = mean(Fericire), meanDior = mean(Nota_Dior), meanGucci = mean(Nota_Gucci), meanArmani = mean(Nota_Armani))
## # A tibble: 7 x 6
## # Groups: Sistem [3]
## Sistem Atitudine meanFericire meanDior meanGucci meanArmani
## <fct> <fct> <dbl> <dbl> <dbl> <dbl>
## 1 "" risk neutral 8 9 7 6
## 2 "fast" averse 5.5 6.25 3.75 5.5
## 3 "fast" risk lover 3 8.5 9 6.5
## 4 "fast" risk neutral 6.33 6 4.17 4.83
## 5 "slow" averse 6.17 7.42 4.17 6.67
## 6 "slow" risk lover 8.5 8 6.5 8.5
## 7 "slow" risk neutral 6.95 6.76 4.90 5.29
#majoritatea notelor pt gucci sunt mai mici decat restul pentru toate gruparile, putem comenta variatia mediei notel in fucntie de atitudinea fata de risc comparat cu sistemul de gandire
# cei care nu au completat fac parte din categoria risk neutral cu cele mai mari note in majoritatea cazurilor.
#Se poate observa ca cea mai mare fericire o au cei slow risk lovers!
Se poate observa că cei mai fericiți sunt risk lovers cu sistemul de gândire slow.Pe de altă parte, cea mai mică medie a fericirii este pentru risk lovers cu sistem de gândire fast ( aici se încadrează și AB)!
Majoritatea notelor pentru Gucci sunt mai mici decât restul notelor pentru toate grupările.
Pentru că cei mai mulți respondenți au spus că și-ar cumpăra Dior, ne vom axa pe acest brand în această parte. Mai jos puteți observa grafice cu frecvențele notelor pentru primele două branduri - Armani și Dior.
# Grafice -----------------------------------------------------------------
#aranjati in ordine crescator respondentii chestionarului (persoana LSB?) dupa notele dior si repr grafic
#Dior
Nota_Dior_Ord <- chestionar%>%
select(ID, Sistem, Reclame, Recomandari, Tip_produs, Nota_Dior, Nota_Gucci)%>%
arrange(Nota_Dior)
##view(Nota_Dior_Ord)
ggplot(Nota_Dior_Ord, aes( x=Nota_Dior)) + geom_bar(color ='#5E4FA2')+labs(title = "Note Dior")
#Armani
Nota_Armani_Ord <- chestionar%>%
select(ID, Sistem, Reclame, Recomandari, Tip_produs, Nota_Armani, Nota_Dior)%>%
arrange(Nota_Dior)
##view(Nota_Armani_Ord)
ggplot(Nota_Armani_Ord, aes( x=Nota_Armani)) + geom_bar(color ='#5E4FA2')+labs(title = "Note Armani")
Se poate vedea că există mult mai multe note mari pentru Dior versus Armani. În continuare vom analiza ce tipuri de produse si-ar cumpăra respondenții.
#mutate - imi permite sa adaug sau sa rescriu o coloana
# adaugati o coloana la datele la chestionar in care calculati media notelor date de fiecare student celor 3 branduri
chestionar1 <- chestionar %>%
mutate(mediaNote = (Nota_Armani+Nota_Dior+Nota_Gucci)/3)
#reprezentati grafic distributia studentilor respondenti dupa sistemul de gandire
sursa <- "Chestionar"
# ce tip de produs sau combinatii din brandul pe care il alegem - TPN si AC - parfum - cel mai frecvent raspuns, AB - geanta - a doua cea mai frecventa optiune
chestionar1%>%
filter(Tip_produs!="")%>%
group_by(Tip_produs)%>%
summarise(n = n())%>%
mutate(TProdFreq = n/ sum(n))%>%
arrange(desc(TProdFreq))%>%
ggplot(aes(x= reorder(Tip_produs,n), y= n))+geom_bar(stat ="identity", fill = '#5E4FA2', width =0.8)+scale_x_discrete(expand = c(0,0)) + labs(x ="Tip_Produs", y= "Respondenti", Caption = sursa) +coord_flip()
Cel mai frecvent răspuns a fost parufmul; și dintre cei 3 respondenți, TPN și AC și-ar cumpăra parfum. Cel puțin în cazul AC - a răspuns că și-ar cumpăra parfum Dior și știu ca parfumul lui preferat este de la Dior - se poate observa cel puțin in acest caz efectul înzestrării.
Mai jos avem grafice cu notele sub medie si peste medie pentru Dior și notele pentru Dior în ordine crescătoare.
#normalizam notele de la dior si adaugam col la df initial
chestionar$Dior_norm <- round((chestionar$Nota_Dior - mean(chestionar$Nota_Dior))/ sd(chestionar$Nota_Dior), 2)
#stabilim cum sa se afiseze ca nota e peste medie sau sub medie
chestionar$Dior_tip <- ifelse(chestionar$Dior_norm < 0, "below", "above")
#sortam dupa valorile normalizate
sem_dior_tdv <- chestionar[order(chestionar$Dior_norm), ]
#reprezentam grafic
ggplot(sem_dior_tdv, aes(x=reorder(ID, Dior_norm), y=Dior_norm, label = Dior_norm))+
geom_bar(stat ="identity", width =0.8, aes(fill = Dior_tip)) +
scale_fill_manual(labels = c("below", "above"), values = c("below" = "red","above" = "green"))+
labs(title = "Valori sub si peste medie pentru Dior")+
coord_flip()
#se identifica persoanele pe care le luam ca referinta si se comenteaza daca se afla sub sau peste medie
#repr grafic notele dior ordonand dupa persoana
#sortam dupa nota dior
chestionar[order(chestionar$ID),]%>%
filter(ID!='GM', Nota_Dior>0)%>%
ggplot( aes(x=reorder(ID, Nota_Dior), y=Nota_Dior))+
geom_bar(stat='identity', width=0.8, fill='#9966FF')
#----
Pe graficele de mai sus se poate observa că aproape 3/4 dintre studenți au dat note peste medie pentru Dior. Printre aceștia se află și AC și TPN cu nota 7, si Ab cu nota 8. Pentru Dior Au existat 4 note de 10.
Toate datele legate de preturile Kering, Hermes, CAC40 [1] sunt pe perioada 2019.
Am făcut o analiză a evoluției rentabilităților zilnice ale acțiunilor Hermes și Kering, pentru anul 2019, cât și a relației acestor rentabilități cu activul fără risc și indicele de piață CAC40 (indicele CAC40 are în componența sa atât Hermes cât și Kering.
După cum se poate observa in graficul de mai jos, pe întreg anul 2019, prețul unei acțiuni Hermes a fost peste o acțiune Kering.
## Index hermes kering
## Min. :2019-01-02 Min. :464.0 Min. :380.7
## 1st Qu.:2019-04-01 1st Qu.:592.1 1st Qu.:455.8
## Median :2019-07-03 Median :618.0 Median :490.5
## Mean :2019-07-01 Mean :607.4 Mean :489.1
## 3rd Qu.:2019-09-30 3rd Qu.:640.9 3rd Qu.:522.6
## Max. :2019-12-31 Max. :680.0 Max. :590.7
În medie, o acțiune Hermes a costat 607.4 Euro, iar o acțiune Kering în medie 489.1 Euro.
Am transformat prețurile zilnice de închidere în rentabilități simple.
table.Stats(stocks, ci=0.95, digits=4)
## RCAC40 RHERMES RKERING rf
## Observations 254.0000 254.0000 254.0000 254.0000
## NAs 0.0000 0.0000 0.0000 0.0000
## Minimum -0.0357 -0.0351 -0.0701 -0.1781
## Quartile 1 -0.0026 -0.0045 -0.0077 -0.0240
## Median 0.0016 0.0020 0.0017 -0.0041
## Arithmetic Mean 0.0010 0.0014 0.0016 -0.0008
## Geometric Mean 0.0010 0.0013 0.0015 -0.0022
## Quartile 3 0.0056 0.0079 0.0102 0.0178
## Maximum 0.0272 0.0340 0.0874 0.3062
## SE Mean 0.0005 0.0007 0.0011 0.0034
## LCL Mean (0.95) 0.0000 0.0000 -0.0005 -0.0074
## UCL Mean (0.95) 0.0020 0.0027 0.0038 0.0059
## Variance 0.0001 0.0001 0.0003 0.0029
## Stdev 0.0083 0.0111 0.0172 0.0538
## Skewness -0.6881 -0.3317 0.0255 0.9088
## Kurtosis 2.4597 0.9771 3.5161 5.9129
Se poate observa că în medie cea mai rentabilă acțiune este Kering, dar tot aceasta este și cea care are o variație mare a valorilor, fapt ce ne poate indica un grad mai mare de risc fată de Hermes.
Se poate observa că indicele de piață este corelat puternic cu ambele active Hermes și Kering, cea mai mare influență asupra pieței având-o Kering. Mai mult, și Hermes are o corelare puternică cu Kering.
În graficul de mai jos se pot observa performanțele rentabilităților Hermes și Kering împreună cu indicele CAC40.
Valorile negative ale rentabilităților au fost următoarele în anul 2019:
Se poate observa că maximul negativ pentru Kering este apropae dublu față de cel al Hermes sau CAC40 - lucru ce are un impact mare având în vedere prețul ridicat al unei acțiuni Kering ~aproximativ 550Euro.
În majoritatea timpului, Hermes și Kering au avut o rentabilitate destul de mare peste piață.
Raportat la CAC40, performanțele Kering și Hermes arată în felul următor:
# 1. Încărcare date ----
sent_text <- read.csv("text_mining.csv", header = T, sep = ",")
dim(sent_text)
## [1] 3 13
##view(sent_text)
#----
# 2. Curatarea datelor----
sent_text<= na.omit(sent_text)
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## Warning in Ops.factor(left, right): '<=' not meaningful for factors
## ID Note notaGucci notaHermes text textGucci textHermes asoc asocGucci
## [1,] NA NA TRUE TRUE NA NA NA NA NA
## [2,] NA NA TRUE TRUE NA NA NA NA NA
## [3,] NA NA TRUE TRUE NA NA NA NA NA
## asocHermes q1brand q1produs q2firma_brand
## [1,] NA NA NA NA
## [2,] NA NA NA NA
## [3,] NA NA NA NA
sent_text1<-data.frame(sent_text)
#view(sent_text)
dim(sent_text)
## [1] 3 13
#----
##Pas3. Citirea lexicoanelor----
##avem 3 tipuri de lexicoane: afinn, bing, loughran, ncr
##comanda get_sentiments = extrage sentmentiele
get_sentiments("afinn")
## # A tibble: 2,477 x 2
## word value
## <chr> <dbl>
## 1 abandon -2
## 2 abandoned -2
## 3 abandons -2
## 4 abducted -2
## 5 abduction -2
## 6 abductions -2
## 7 abhor -3
## 8 abhorred -3
## 9 abhorrent -3
## 10 abhors -3
## # ... with 2,467 more rows
##avem dimensiunea de 2467 de cuvinte pe 2 coloane
get_sentiments("bing")
## # A tibble: 6,786 x 2
## word sentiment
## <chr> <chr>
## 1 2-faces negative
## 2 abnormal negative
## 3 abolish negative
## 4 abominable negative
## 5 abominably negative
## 6 abominate negative
## 7 abomination negative
## 8 abort negative
## 9 aborted negative
## 10 aborts negative
## # ... with 6,776 more rows
##avem 6776 de cuvinte si coloana a doua ne arata sentimentul (pozitiv sau negativ)
##get_sentiments("loughran")
get_sentiments("nrc")
## # A tibble: 13,901 x 2
## word sentiment
## <chr> <chr>
## 1 abacus trust
## 2 abandon fear
## 3 abandon negative
## 4 abandon sadness
## 5 abandoned anger
## 6 abandoned fear
## 7 abandoned negative
## 8 abandoned sadness
## 9 abandonment anger
## 10 abandonment fear
## # ... with 13,891 more rows
##sentimentele pentru acest lexicon sunt mai complexe: trust, fear, anger etc
#----
###Radar chart personalitati
#Folosim col Personalitate chestionar
textPersAACPI <- tibble(ID=chestionar[1:45,3], text=as.character(chestionar[1:45,6]))
textPersResp <- tibble(ID=chestionar[46:48,3], text=as.character(chestionar[46:48,6]))
#despartim un cuv pe linie
tokens_persAACPI<-textPersAACPI %>%
unnest_tokens(word,text)
dim(tokens_persAACPI)
## [1] 130 2
tokens_persResp<-textPersResp %>%
unnest_tokens(word,text)
dim(tokens_persResp)
## [1] 13 2
tokens_persResp <- tokens_persResp %>%
filter(!word %in% c("and"))
#cream col speciala
tokens_persAACPI["tip"]<-c("AACPI")
#view(tokens_persAACPI)
tokens_persResp["tip"]<-c("Respondent")
#view(tokens_persResp)
#unim intr un singur tabel
tokens_pers<- bind_rows(tokens_persAACPI, tokens_persResp)
dim(tokens_pers)
## [1] 142 3
###Radar chart
nrc<-get_sentiments("nrc")
scores_nrc<-tokens_pers %>%
inner_join(nrc, bt=c("word"="word")) %>%
filter(!grepl("positive|negative", sentiment)) %>%
count(tip, sentiment) %>%
spread(tip, n)
## Joining, by = "word"
#view(scores_nrc)
##tabelul arata intensitatea sentimentului pentru brandul respectiv. Unde avem n/a inseamna ca nu exista sentimentul respectiv
###Grafic interactiv
##windows()
chartJSRadar(scores_nrc)
###Sentiment analysis - branduri
#Pas4. Prelucrarea textului (transformam data frameul intr-un tibble)----
#Gucci
text_gucci <- tibble(ID=sent_text[["ID"]], text=as.character(sent_text[["textGucci"]]))
#view(text_gucci)
#Hermes
text_hermes <- tibble(ID=sent_text[["ID"]], text=as.character(sent_text[["textHermes"]]))
#view(text_hermes)
#----
##Pas5. Agregam coloanele text pentru cele 2 firme generand o coloana suplimentra de recunoastere a firmei la care se refera textul----
text_gucci["brand"]<-c("Gucci")
#view(text_gucci)
text_hermes["brand"]<-c("Hermes")
#view(text_hermes)
#----
##Pas6. Impartim fiecare cuvant pe cate un rand ----
#?unnest_tokens()
tokens_gucci<-text_gucci %>%
unnest_tokens(word,text)
dim(tokens_gucci)
## [1] 237 3
tokens_hermes<-text_hermes %>%
unnest_tokens(word,text)
dim(tokens_hermes)
## [1] 211 3
#----
##Pas7. Unim cele 3 df in unul singur----
tokens_brands<- bind_rows(tokens_gucci, tokens_hermes)
dim(tokens_brands)
## [1] 448 3
#----
##Pas8. Eliminam cuvintele care nu exprima sentimente/cuvintele inutile (is, etc, a...) ----
# ##Varianta 1. putem elimina cuvintele folosind tidy text cu stop warns (eliminarea unor cuvinteprestab)
#
# clean_tokens <- tokens_brands %>%
# anti_join(stop_words)
# #view(clean_tokens)
# dim(clean_tokens)
#
# clean_tokens <-clean_tokens %>%
# filter(!word %in% c("brand", "brands", "product", "products", "based", "don't", "dont"))
#
##Varianta 2
clean_tokens <- tokens_brands %>%
filter(!word %in% c("and","on","their","etc","are","of","the","but","about","all",
"more","then","than","a","some","very","so","my","it","is",
"comes","to","for","tend","be","i","although","like","has",
"in","over","maybe","we","can't","can","say","i'm","thinking",
"most","seems","quite","fact","reason","with","not","don't",
"at","by","too","when","me","they","have","or","that",
"everytime","them","without","this","ranked","if","even",
"6","up","as","well","buy","8","think","both","also","make","birthday",
"21st","the","are","i","and","men","things","kills", "an", "its", "itself", "gucci", "brand", "brands", "hermes", "product", "products", "based", "don't", "dont", "overall"))
dim(clean_tokens)
## [1] 195 3
#----
##Pas9. Determinarea celor mai des folosite cuvinte pentru fiecare brand----
clean_tokens %>%
filter(brand =="Gucci") %>%
count(word, sort=TRUE)
## # A tibble: 90 x 2
## word n
## <chr> <int>
## 1 believe 2
## 2 belt 2
## 3 clothes 2
## 4 collections 2
## 5 green 2
## 6 know 2
## 7 patern 2
## 8 quality 2
## 9 red 2
## 10 through 2
## # ... with 80 more rows
clean_tokens %>%
filter(brand =="Hermes") %>%
count(word, sort=TRUE)
## # A tibble: 86 x 2
## word n
## <chr> <int>
## 1 appreciate 2
## 2 classic 2
## 3 find 2
## 4 good 2
## 5 history 2
## 6 luxury 2
## 7 quality 2
## 8 10 1
## 9 alone 1
## 10 anything 1
## # ... with 76 more rows
#----
##Pas10. Grafice pentru cele mai des folosite cuvinte
g1<-clean_tokens %>%
filter(brand == "Gucci") %>%
count(word, sort=TRUE) %>%
filter(n>1) %>%
mutate(word=reorder(word,n)) %>% ##ordonez cuvintele ai sa avem cuvintele ordonate dupa nr de de utilizari/cat de des se intalnesc
ggplot(aes(word,n))+
geom_bar(stat="identity", fill="#9E0142")+
labs(x="Numarul de repetii ale aceluiasi cuvant", y="Cuvantul/Word", titile="Cele mai des folosite cuvinte pt Gucci")+
coord_flip()
g2<-clean_tokens %>%
filter(brand == "Hermes") %>%
count(word, sort=TRUE) %>%
filter(n>1) %>%
mutate(word=reorder(word,n)) %>% ##ordonez cuvintele ai sa avem cuvintele ordonate dupa nr de de utilizari/cat de des se intalnesc
ggplot(aes(word,n))+
geom_bar(stat="identity", fill="#F46D43")+
labs(x="Numarul de repetii ale aceluiasi cuvant", y="Cuvantul/Word", titile="Cele mai des folosite cuvinte pt Dior")+
coord_flip()
##Unim cele 2 grafice
plots_brands<-list(g1,g2)
marrangeGrob(plots_brands, nrow=1, ncol=2)
##Pas11. Generarea de wordclouds pentru fiecare brand in parte ----
clean_tokens %>%
filter(brand =="Gucci") %>%
count(word) %>%
with(wordcloud(word,n,max.words = 100,colors=brewer.pal(8,"Dark2")))
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## way could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## exuberance could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## purchase could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## italian could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## however could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## working could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## makes could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## green could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## consider could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## elegant could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## outside could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## branding could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## presents could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## related could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## years could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## impact could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## belt could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## classic could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## you could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## luxury could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## generally could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## money could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## nothing could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## red could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## believe could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## collections could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## don’t could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## patent could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## presented could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## because could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## same could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## know could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## extravagant could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## come could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## capitalising could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## marketing could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## knowledge could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## appreciate could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## wouldn't could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## history could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## clothes could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## designers could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## colors could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## considering could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## overrated could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## known could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## look could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## symbol could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## unified could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## recent could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## hard could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## doesn't could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## image could not be fit on page. It will not be plotted.
clean_tokens %>%
filter(brand =="Hermes") %>%
count(word) %>%
with(wordcloud(word,n,max.words = 100,colors=brewer.pal(8,"Dark2")))
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## classic could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## influence could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## appreciation could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## weight could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## strength could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## average could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## diverse could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## certain could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## much could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## great could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## such could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## luxury could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## ellegance could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## purchase could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## french could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## strong could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## feelings could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## perfumes could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## bags could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## expansive could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## current could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## good could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## scarves could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## power could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## would could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## birkin could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## lineup could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## trustworthy could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## tasteful could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## worn could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## michele could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## elegant could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## fashion could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## anything could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## something could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## money could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## positive could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## quality could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## however could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## bag could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## knowledge could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## find could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## personally could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## carries could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## one could not be fit on page. It will not be plotted.
## Warning in wordcloud(word, n, max.words = 100, colors = brewer.pal(8, "Dark2")):
## silk could not be fit on page. It will not be plotted.
#----
##Acelasi grafic folosind lexiconul nrc
sent_gucci1<-clean_tokens %>%
filter(brand == "Gucci") %>%
inner_join(get_sentiments("nrc")) %>%
count(word, sentiment,sort=TRUE) %>%
ungroup()
## Joining, by = "word"
sent_gucci1
## # A tibble: 42 x 3
## word sentiment n
## <chr> <chr> <int>
## 1 belt anger 2
## 2 belt fear 2
## 3 belt negative 2
## 4 green joy 2
## 5 green positive 2
## 6 green trust 2
## 7 classic positive 1
## 8 distasteful disgust 1
## 9 distasteful negative 1
## 10 elegant joy 1
## # ... with 32 more rows
sent_gucci1 %>%
group_by(sentiment) %>%
top_n(10) %>%
ungroup() %>%
mutate(word=reorder(word,n)) %>% ##le reordonamn in functie de cat de des intalnite sunt
ggplot(aes(word, n, fill=sentiment))+
geom_col(show.legend = FALSE)+
facet_wrap(~sentiment, scales="free_y")+
labs(x="Word", y="Contributie", title="Gucci")+
coord_flip()
## Selecting by n
sent_hermes1<-clean_tokens %>%
filter(brand == "Hermes") %>%
inner_join(get_sentiments("nrc")) %>%
count(word, sentiment,sort=TRUE) %>%
ungroup()
## Joining, by = "word"
sent_hermes1
## # A tibble: 50 x 3
## word sentiment n
## <chr> <chr> <int>
## 1 classic positive 2
## 2 good anticipation 2
## 3 good joy 2
## 4 good positive 2
## 5 good surprise 2
## 6 good trust 2
## 7 luxury joy 2
## 8 luxury positive 2
## 9 appreciation joy 1
## 10 appreciation positive 1
## # ... with 40 more rows
sent_hermes1 %>%
group_by(sentiment) %>%
top_n(10) %>%
ungroup() %>%
mutate(word=reorder(word,n)) %>% ##le reordonamn in functie de cat de des intalnite sunt
ggplot(aes(word, n, fill=sentiment))+
geom_col(show.legend = FALSE)+
facet_wrap(~sentiment, scales="free_y")+
labs(x="Word", y="Contributie", title="Gucci")+
coord_flip()
## Selecting by n
##Pas11. Generati un grafic de tip rardar chart pentru a evidentia intensitatea sentimentelor generate de un brand
nrc<-get_sentiments("nrc")
scores_nrc<-clean_tokens %>%
inner_join(nrc, bt=c("word"="word")) %>%
filter(!grepl("positive|negative", sentiment)) %>%
count(brand, sentiment) %>%
spread(brand, n)
## Joining, by = "word"
#view(scores_nrc)
##tabelul arata intensitatea sentimentului pentru brandul respectiv. Unde avem n/a inseamna ca nu exista sentimentul respectiv
###Grafic interactiv
#windows()
chartJSRadar(scores_nrc)
[1] http://store.ectap.ro/articole/773_ro.pdf “Testarea eficienţei informaţionale în formă slabă a pieţei de capital româneşti”; Andrei STĂNCULESCU și Eugen MITRICĂ, Academia de Studii Economice, Bucureşti
Chestionar Gucci, Armani, Dior, Hermes - AC
Chestionar Gucci, Armani, Dior, Hermes - AB
Chestionar Gucci, Armani, Dior, Hermes - AC
##Anexa 2 - Alegeri la momentul de timp t1
Chestionar Gucci,Hermes - AC
Chestionar Gucci,Hermes - AC
Chestionar Gucci,Hermes - AC