Hello,
I am working with a dataset from a Twitter content analysis project and am stuck trying out figure out how to take 8 categorical tweet characteristic variables (resource, news, personal experience, personal opinion, marketing, spam, question, jokes/parody) and create one "tweet characteristic" variable (code below).
The problem I am having is that the categories are not mutually exclusive. The n for JokesParody is 22, but when I run this code it reduces it to 5 since a tweet can have several of these characteristics. Any help you can provide would be very much appreciated.
gen Characteristics=.
replace Characteristics = 0 if JokesParody==1
replace Characteristics = 1 if Resource==1
replace Characteristics = 2 if News==1
replace Characteristics = 3 if PersonalExperience==1
replace Characteristics = 4 if PersonalOpinion==1
replace Characteristics = 5 if Marketing==1
replace Characteristics = 6 if Spam==1
replace Characteristics = 7 if Question==1
label var Characteristics "Tweet Characteristics"
label define Characteristics 0 "Jokes/Parody" 1 "Resource" 2 "News" 3 "Personal Experience" 4 "Personal Opinion" 5 "Marketing" 6 "Spam" 7 "Question"
label val Characteristics Characteristics
Related Posts with Replace command with non-mutually exclusive categorical data
How to import JSON into StataHi, I am using Stata 17 and would need some help in importing JSON into Stata. This is my first tim…
xthybrid and xtlogit produce slightly different resultsDear statalisters, I am studying why people not use contraception in an unbalanced panel of 11 wave…
xthybrid and xtlogit produce slightly different resultsDear statalisters, I am studying why people not use contraception in an unbalanced panel of 11 wave…
Counting amount of times a specific value occurs in a variableHi, I am trying to calculate the number of times a specific value (in this case a string) occurs in …
How do I obtain the predicted survival function for time varying weibull survival regression (streg)?Dear All, Please can anyone help me to solve this simple problem that I cannot solve. I tried to re…
Subscribe to:
Post Comments (Atom)
0 Response to Replace command with non-mutually exclusive categorical data
Post a Comment