I have been given a dataset containing the following setup and the following data. Two prospective tenants, one black and one white are looking for apartments across various neighbourhoods. The average incomes of the neighbourhoods are given as well as race of the landlords(1 for black, 0 for white). Both tenants ask at the same houses and their successes(1) and failures(0) are recorded.

How do I relate success of the black and white tenants with income in the neighbourhood?

How do I relate success of the black and white tenants by race of the landlord?

Can I do anything more with the given data?

Stata pointers would also be highly appreciated. I've tried both logit Black(and White) NbdIncm and probit, but I'm not sure which is more appropriate etc. since I have zero experience with such datasets and I'm completely lost. github link here raceexample.dta https://github.com/RT1234-cmd/Data

• Have you tried Probit regression? – LostInNumbers May 27 at 2:13
• Also, this sounds suspiciously like school work since people rarely accept data donations of data from strangers with predefined questions. If that is the case, please add the homework tag. – Dimitriy V. Masterov May 27 at 3:38
• This is quite a poor answer. Consider revising. – StatsStudent May 27 at 3:50
• It sounds like you have data from an audit study, where a white and a black applicant apply to the same set of preselected houses. If a landlord accepts the first applicant, does that mean he rejects the second one automatically since the apartment is off the market? – Dimitriy V. Masterov May 27 at 4:01
• @RT1234, have you tried reading this in the help section here on how to ask good questions and tell us what you've tried? stats.stackexchange.com/help/on-topic Especially important and relevant for you will be to read the section on homework questions. They are welcome but you should tell us what you've tried and where you're getting stuck. – StatsStudent May 27 at 4:41

This code takes a stab at your questions using an OLS model to calculate some means and then plots various kinds of counterfactual predictions from that model. A causal interpretation of this model presumes that you in fact have a decent audit study. Some of your variable labels are inconsistent with the info in the question, so I used the assumption from the questions in cleaning the data. You could make the model richer/different if you had a bigger sample or additional data (including logit/probit). There are comments in the code that explain what each piece does to help you. It assumes that you are familiar with basic linear regression with interactions and prediction.

/* (1) Transform the data into long form suitable for modeling */
use "raceexample.dta", clear
gen apt_id = _n
order apt_id NbdIncm LandlordRace
rename (White Black) success_=
reshape long success_, i(apt_id LandlordRace NbdIncm) j(ApplicantRace, string)
rename success_ rented
sencode ApplicantRace, replace
lab define LandlordRace 0 "White" 1 "Black"
lab val LandlordRace LandlordRace
labvarch, trim(0)

/* (2a) Summary statistics & plot the data to get a sense of sample size and shape */
table ApplicantRace LandlordRace , c(mean rented N rented)
tw lowess rented NbdIncm , by(ApplicantRace LandlordRace) ylab(#10, angle(0)) xlab(,grid) adjust name(lowess, replace)

xtile income_half = ln(NbdIncm), nq(2)
lab define income_half 1 "Bottom Half" 2 "Top Half"
lab val income_half income_half
table income_half, c(min NbdIncm  p50 NbdIncm mean NbdIncm max NbdIncm N NbdIncm)

/* (3) Fit a saturated OLS model: analogous to calculating the mean of rented in each cell */
reg rented ib2.ApplicantRace##ib0.LandlordRace##ib1.income_half

/* (4) Plot Predictions with 95% CIs */
/* These corresponds to changing one X, leaving the others as they are */
margins ApplicantRace
marginsplot, ylab(#10, angle(0)) xlab(,grid) name(ar, replace)

margins LandlordRace
marginsplot, ylab(#10, angle(0)) xlab(,grid) name(lr, replace)

margins, at(income_half = (1 2))
marginsplot, ylab(#10, angle(0)) xlab(,grid) name(inc, replace)

/* (5) Consider predictions changing all the variables simultaneously */
margins ApplicantRace#LandlordRace, at(income_half = (1 2))
marginsplot, ylab(#10, angle(0)) xlab(,grid) name(all, replace)

• Thank you so much for your answer and taking your time! I really appreciate this. – RT1234 May 27 at 9:36
• @RT1234 If this helped, please select it as the answer. If something is not clear, I can clarify in the comments. – Dimitriy V. Masterov May 27 at 15:21
• @DimitriyV.Masterov You should probably avoid providing students with solutions to their homework problems. You should probably guide students, not give them answers... – StatsStudent May 27 at 22:45
• @StatsStudent The OP says this was not homework, and I usually take people at their word unless there's a pattern. – Dimitriy V. Masterov Jun 24 at 1:49
• Yes, I didn't see the OP's comments indicating that. No problem here. – StatsStudent Jun 24 at 2:37