Dear all,
I use user written command rifreg (Rios-Avila, F. 2020. Recentered influence functions (RIFs) in Stata: RIF regression and RIF decomposition. Stata Journal, 20(1), 51-94. https://doi.org/10.1177/1536867X20909690.)
I estimate two regressions, separately by gender, and I want to test if coefficients are equal for explanatory variables between males and females. Since I use bootstrap standard errors, I had to write a program. The problem that arise is that standard errors for t test are different then standard errors in regresion.
Here is code for example dataset.
use http://fmwww.bc.edu/RePEc/bocode/o/oaxaca.dta, clear
program dob,eclass
rifreg lnwage educ exper tenure if female==1, q(10)
matrix bf10=_b[educ]
rifreg lnwage educ exper tenure if female==0, q(10)
matrix bm10=_b[educ]
matrix b= bf10, bm10
matrix colname b = bf10 bm10
ereturn post b
end
bootstrap, seed(1): dob if lnwage!=. & educ!=. & exper!=. & tenure!=.
test _b[bf10]==_b[bm10]
bootstrap, seed(1): rifreg lnwage educ exper tenure if female==1, q(10)
bootstrap, seed(1): rifreg lnwage educ exper tenure if female==0, q(10)
Here are the results, I marked standard errors for education that differ.
Bootstrap results Number of obs = 1,434
Replications = 50
------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
bf10 | .0714448 .0322978 2.21 0.027 .0081423 .1347473
bm10 | .0757839 .0153426 4.94 0.000 .0457131 .1058547
------------------------------------------------------------------------------
. test _b[bf10]==_b[bm10]
( 1) bf10 - bm10 = 0
chi2( 1) = 0.01
Prob > chi2 = 0.9036
Thank you very much in advance.
Best,
Aleksandra
I use user written command rifreg (Rios-Avila, F. 2020. Recentered influence functions (RIFs) in Stata: RIF regression and RIF decomposition. Stata Journal, 20(1), 51-94. https://doi.org/10.1177/1536867X20909690.)
I estimate two regressions, separately by gender, and I want to test if coefficients are equal for explanatory variables between males and females. Since I use bootstrap standard errors, I had to write a program. The problem that arise is that standard errors for t test are different then standard errors in regresion.
Here is code for example dataset.
use http://fmwww.bc.edu/RePEc/bocode/o/oaxaca.dta, clear
program dob,eclass
rifreg lnwage educ exper tenure if female==1, q(10)
matrix bf10=_b[educ]
rifreg lnwage educ exper tenure if female==0, q(10)
matrix bm10=_b[educ]
matrix b= bf10, bm10
matrix colname b = bf10 bm10
ereturn post b
end
bootstrap, seed(1): dob if lnwage!=. & educ!=. & exper!=. & tenure!=.
test _b[bf10]==_b[bm10]
bootstrap, seed(1): rifreg lnwage educ exper tenure if female==1, q(10)
bootstrap, seed(1): rifreg lnwage educ exper tenure if female==0, q(10)
Here are the results, I marked standard errors for education that differ.
Bootstrap results Number of obs = 1,434
Replications = 50
------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
bf10 | .0714448 .0322978 2.21 0.027 .0081423 .1347473
bm10 | .0757839 .0153426 4.94 0.000 .0457131 .1058547
------------------------------------------------------------------------------
. test _b[bf10]==_b[bm10]
( 1) bf10 - bm10 = 0
chi2( 1) = 0.01
Prob > chi2 = 0.9036
(1) | (2) | |
VARIABLES | f 10 | m 20 |
educ | 0.0714** | 0.0758*** |
(0.0335) | (0.0126) | |
exper | 0.0172* | 0.0169*** |
(0.0092) | (0.0035) | |
tenure | -0.0037 | 0.0039 |
(0.0074) | (0.0038) | |
Constant | 1.7770*** | 1.8451*** |
(0.5167) | (0.1969) | |
Observations | 683 | 751 |
R-squared | 0.0427 | 0.1221 |
Standard errors in parentheses | ||
*** p<0.01, ** p<0.05, * p<0.1 |
Best,
Aleksandra
Comment