I am working on a paper about discrimination in the labour market. I have three variables (among many others): one is race (black/white), the other is callback and the third is advertisement. Race and callback are dummies, the ad variable assigns a number to each job advertisement from 1 to 1200
the dataset is like this
race call ad
b 0 1
w 0 1
b 0 1
w 0 1
Which means that for ad 1, nobody got called back
then I have
race call ad
w 0 216
b 1 216
b 1 216
w 0 216
which means that for ad 216, 2 African-Americans got called back and 0 Whites
or
race call ad
b 0 376
w 1 376
b 0 376
w 1 376
which means that for ad 376 2 whites got called back and no African-Americans
I need to to know the percentage of ads that favored african americans (like ad 216) or they treates the candidates equally (like ad 1) or they favored whites (like other ads where 1 white got called back and no african americans) so I need to discern the advertisement variable to know how many ads called 0 whites and 0 blacks or 1 black and 1 white or 2 whites and 0 blacks and so on.
I am relatively new to Stata so I've tried to use the summarize command, unsuccessfully
sum ad if race=="w" & call==0 & race=="b" & call==1 says "no observations"
I tried to use tabulate race call adid, row and it says "too many variables specified" so I switched to bysort ad: summarize race call yet I got no results.
Related Posts with Sorting a variable by two dummy variables
Dataset merging to maximize number of observationsHi, I would like to merge two datasets. Both datasets have the following columns: Year Gvkey Cusip …
Aggregate data based on two variablesHello Stata Community, I am new to Stata and have a question regarding the aggregation of a dataset…
Dynamic binary panel models with endogeneityHi all, I have a question related to dynamic panel analysis. As we know, xtabond2 is suitable to u…
Sorting VariablesHi I need to create a certain variable by sorting other variables, but I am not sure how to sort t…
Dropping all Observations in a Longitudinal Data Set if Two Conditions are met.Hi Stata users, I am trying to drop entire records of individuals from this set if they had an oppo…
Subscribe to:
Post Comments (Atom)
0 Response to Sorting a variable by two dummy variables
Post a Comment