// I opened the ObamaExpMturkGeoIP.tab file from the Dataverse (https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/F0NDJP). // I added a "min" column in column AS that is the EndDate minus the StartDate. // This "min" column was placed into the HH:MM:SS time format. // I pasted the ObamaExpMturkGeoIP.tab file into Stata. // I followed the R code from the Datavserse as best I could. tab darklight * The next set of code is from Radu Ban (http://www.stata.com/statalist/archive/2002-12/msg00355.html). gen str8 stime = min gen shours = substr(stime, 1, 1) gen hours = real(shour) gen sminutes = substr(stime, 3, 2) gen minutes = real(sminutes) gen sseconds = substr(stime, 6, 2) gen seconds = real(sseconds) gen totsecs = 3600*hours + 60*minutes + seconds * Create a variable for dropped respondents gen dropped = 0 // Drop non-US IPs tab us_geo replace dropped = 1 if us_geo==0 // Drop non-native English speakers tab areyouanativeenglishspeaker replace dropped = 1 if areyouanativeenglishspeaker==2 tab ourresearchdatavalidityandaccura replace dropped = 1 if ourresearchdatavalidityandaccura==1 tab var7 replace dropped = 1 if var7==2 tab var8 replace dropped = 1 if var8==1 // Drop fastest 5% and slowest 5% sum totsec, de replace dropped = 1 if totsecs<115 | totsecs>496 replace dropped = 1 if totsecs<1.92*60 & totsecs>8.13*60 // Values from the article. // Drop duplicates duplicates tag workerid, gen(dupe) tab dupe replace dropped = 1 if dupe > 0 // Attention check tab anyothercommentsorquestions, mi replace dropped = 1 if anyothercommentsorquestions=="No" | anyothercommentsorquestions=="" | anyothercommentsorquestions=="Any other comments of questions?" | anyothercommentsorquestions=="" | anyothercommentsorquestions=="no" | anyothercommentsorquestions=="I could not think of a word for the las" tab us_geo dropped tab areyouanativeenglishspeaker dropped tab ourresearchdatavalidityandaccura dropped tab var7 dropped tab var8 dropped tab dupe dropped tab anyothercommentsorquestions dropped, mi tab dropped //Code stereotype variables tab x__ce gen race = 0 replace race = 1 if x__ce=="RACE" | x__ce=="race" | x__ce=="Race" tab x__ce race tab la__ gen lazy = 0 replace lazy = 1 if la__=="LAZY" | la__=="lazy" | la__=="Lazy" tab la__ lazy tab x__ack gen black = 0 replace black=1 if x__ack=="BLACK" | x__ack=="black" | x__ack=="Black" tab x__ack black tab x__or gen poor = 0 replace poor =1 if x__or=="POOR" | x__or=="poor" | x__or=="Poor" tab x__or poor tab br_____ gen brother = 0 replace brother = 1 if br_____=="BROTHER" | br_____=="brother" | br_____=="Brother" tab br_____ brother tab mi______ gen minority = 0 replace minority = 1 if mi______=="MINORITY" | mi______=="minority" | mi______=="Minority" tab mi______ minority tab wel____ gen welfare = 0 replace welfare = 1 if wel____=="WELFARE" | wel____=="welfare" | wel____=="Welfare" tab wel____ welfare tab cr___ gen crime = 0 replace crime = 1 if cr___=="CRIME" | cr___=="crime" | cr___=="Crime" tab cr___ crime tab x_ap gen rap=0 replace rap = 1 if x_ap=="RAP" | x_ap=="rap" | x_ap=="Rap" tab x_ap rap tab dr__ gen drug = 0 replace drug = 1 if dr__=="DRUG" | dr__=="drug" | dr__=="Drug" tab dr__ drug tab d___y gen dirty=0 replace dirty=1 if d___y=="DIRTY" | d___y=="dirty" | d___y=="Dirty" tab d___y dirty * t-tests for each stereotype ttest race if dropped==0, by(darklight) unp une ttest lazy if dropped==0, by(darklight) unp une ttest black if dropped==0, by(darklight) unp une ttest poor if dropped==0, by(darklight) unp une ttest brother if dropped==0, by(darklight) unp une ttest minority if dropped==0, by(darklight) unp une ttest welfare if dropped==0, by(darklight) unp une ttest crime if dropped==0, by(darklight) unp une ttest rap if dropped==0, by(darklight) unp une ttest drug if dropped==0, by(darklight) unp une ttest dirty if dropped==0, by(darklight) unp une * Create variables for the stereotypes gen article3 = lazy + dirty + poor // These are the three sterotypes reported on in the article's main text. gen ft16 = lazy + black + poor + welfare + crime + dirty // Footnote 16 gen all = race + lazy + black + poor + brother + minority + welfare + crime + rap + drug + dirty // All stereotypes gen best = lazy + poor + welfare + crime + drug + dirty // This is the list of stereotypes that I think have the most face validity. gen worst = race + black + brother + minority + rap // This is the list of stereotypes that I think have the least face validity. gen bottom3 = race + minority + rap gen bottom4 = race + minority + rap + welfare gen bottom5 = race + minority + rap + welfare + crime gen bottom6 = race + minority + rap + welfare + crime + brother ttest article3 if dropped==0, by(darklight) unp une // The 33% and 45% estimates here match the article. The p-value is a bit different. ttest ft16 if dropped==0, by(darklight) unp une ttest all if dropped==0, by(darklight) unp une ttest best if dropped==0, by(darklight) unp une ttest worst if dropped==0, by(darklight) unp une ttest bottom3 if dropped==0, by(darklight) unp une ttest bottom4 if dropped==0, by(darklight) unp une ttest bottom5 if dropped==0, by(darklight) unp une ttest bottom6 if dropped==0, by(darklight) unp une * The three items about Obama tab howcompetentisbarrackobama tab howtrustworthyisbarrackobama tab onascalefrom0coldestto100warmest * Incompetence ttest howcompetentisbarrackobama if dropped==0, by(darklight) unp une * Untrustworthy ttest howtrustworthyisbarrackobama if dropped==0, by(darklight) unp une * Feeling thermometer (switch sign because this is coded so that higher values are more postive) ttest onascalefrom0coldestto100warmest if dropped==0, by(darklight) unp une egen competent_std = std(howcompetentisbarrackobama) egen trust_std = std(howtrustworthyisbarrackobama) egen ft_std = std(onascalefrom0coldestto100warmest) ttest competent_std if dropped==0, by(darklight) unp une ttest trust_std if dropped==0, by(darklight) unp une ttest ft_std if dropped==0, by(darklight) unp une tab1 howcompetentisbarrackobama howtrustworthyisbarrackobama onascalefrom0coldestto100warmest alpha howcompetentisbarrackobama howtrustworthyisbarrackobama onascalefrom0coldestto100warmest, gen(scale) item min(2) std ttest scale if dropped==0, by(darklight)