Hello Statalist! This is my first ever post, and I am newly learning Stata as a somewhat-competent user of SPSS.
I am hoping to figure out the best way to 'control' for race in a linear regression, where I am trying to predict GPA, with my independent variables being resil, motiv, work, debat, creat (all measures of non-cognitive skills, essentially). I've recoded income and also recoded gender where 0 represents male and 1 represents female.
If someone could please help me with the code for how the best method of handling my race variable (w is white, h is hispanic, and so on), and then for the ensuing regression, I would be eternally grateful! Thank you.
* Example generated by -dataex-. To install: ssc install dataex
clear
input double gpa str1 race byte(resil motiv work debat creat income gender1)
2.07 "B" 3 1 1 1 1 14 0
3.03 "H" 1 1 1 1 1 4 0
3.07 "H" 1 1 5 5 5 5 1
2.66 "H" 5 1 1 3 1 13 0
3.00 "A" 3 4 1 2 1 9 1
3.04 "B" 5 3 1 1 5 14 1
3.02 "A" 1 1 4 1 1 14 1
2.04 "B" 4 1 1 1 1 5 0
3.00 "H" 4 4 1 1 3 14 0
3.02 "W" 4 1 1 1 1 4 0
3.42 "H" 1 4 1 3 5 13 1
3.66 "H" 5 3 1 4 3 7 1
3.02 "W" 4 1 1 1 1 14 0
3.04 "A" 1 2 5 1 1 14 1
3.26 "H" 5 1 1 1 1 8 1
3.45 "A" 5 1 5 1 3 14 1
2.03 "W" 3 1 1 1 4 14 1
3.01 "A" 5 1 4 1 2 9 0
end
[/CODE]
Related Posts with Controlling for gender in linear regression
Implied Cost of Equity, mm_root function skips the results of some observationsHi There, I have used the following codes to calculate the implied cost of equity. While the code c…
Losing Precision with ASEC ID ValuesHi Statalisters, I'm currently working with the 2019 CPS ASEC, trying to match individual responden…
Decomposing regression into within and between effectsConsider the following baseline model: yijk = beta * xijk + errorijk where i indicates a child, j i…
f test following reghdfe for joint significance of individual fixed effectsHi all, I'd like to run a f-test to test joint significance of each fixed effects. For example, I'd…
Flexible parametric modelling, models do not convergeHi, I’m using the -stpm2- command to generate a flexible parametric model (relative survival, >1…
Subscribe to:
Post Comments (Atom)
0 Response to Controlling for gender in linear regression
Post a Comment