I am supposed to display a graph comparing the results by gender and students of multiple variables. It was a randomized study where certain students and faculty were sent a specific email.

The gender column in my .dta file is categorical. Male is listed as M. Female is listed as F.

I have tried the following code for the regression but it is not working in Stata.

Any help would be greatly appreciated?

tabulate gender, generate(gender)
set more off
foreach var opened_first clicked_first clicked Totalclick survey {
forvalues i=0(1)1 {
di "FEMALE" `var'"
reg `var' social_treatment if gender1==1 & social_treatment_student==`i'
estimates store gender1`i'
di "MALE" `var'"
reg `var' social_treatment if gender2==1 & social_treatment_student==`i'
estimates store gender2`i'
}

-end-