Dear Statalist members,
I have created an example which reflects my data and is reproducing the problems I have. To give you a quick overview: My depended variable is net wealth ("wealth"). The data includes an indicator called "migrant" being equal to 1 in case of migrants and equal to zero otherwise. The same applies for "migrantp", which is the partners immigration status. Based on these two variables I have tried to create four possible family types: native-only(0), immigrant-only(1), mixed with native-born head(2), mixed with foreign-born head(3). The indicator variable "immigstat" should identify immigrant households.
I am trying to figure out how to solve the following two problems, related to this code:
1. Even if I ran a simple regression with reg, two family types are omitted, which should not be the case. The native-only type should be the reference category, which I am trying to ensure by setting this family type equal to zero, whereas the last category should not be omitted. Do you have any suggestions on this issue?
2. Actually I want to do a quantile regression with the rifreg-command (available at: http://faculty.arts.ubc.ca/nfortin/datahead.html). Within this, I have to restrict my estimated coefficients for the family types to sum to zero. As factor variables are not allowed with this command I have included the respective dummy variables. I have already tried to apply the constraint-command which does not seem to work with rifreg. Do you have any recommendation on how to involve this restriction?
(I am using Stata version 14.2)
Many thanks in advance for your support!
Kind regards,
Kathrin
I have created an example which reflects my data and is reproducing the problems I have. To give you a quick overview: My depended variable is net wealth ("wealth"). The data includes an indicator called "migrant" being equal to 1 in case of migrants and equal to zero otherwise. The same applies for "migrantp", which is the partners immigration status. Based on these two variables I have tried to create four possible family types: native-only(0), immigrant-only(1), mixed with native-born head(2), mixed with foreign-born head(3). The indicator variable "immigstat" should identify immigrant households.
Code:
clear set obs 10000 g wealth = rnormal(0,10000) g migrant = rbinomial(1,0.5) g migrantp = rbinomial(1,0.5) gen famtype = . replace famtype = 0 if migrant == 0 & migrantp == 0 //native hh replace famtype = 1 if migrant == 1 & migrantp == 1 //immigrant-only hh replace famtype = 2 if migrant == 0 & migrantp == 1 //mixed with native-born head replace famtype = 3 if migrant == 1 & migrantp == 0 //mixed with foreign-born head tab famtype, gen(d_famtype) gen immigstat =. //dummy = 1 for immigrant hh replace immigstat = 1 if inrange(famtype,1,3) replace immigstat = 0 if famtype == 0 reg wealth immigstat i.famtype rifreg wealth immigstat d_famtype2 d_famtype3 d_famtype4, q(0.5)
1. Even if I ran a simple regression with reg, two family types are omitted, which should not be the case. The native-only type should be the reference category, which I am trying to ensure by setting this family type equal to zero, whereas the last category should not be omitted. Do you have any suggestions on this issue?
2. Actually I want to do a quantile regression with the rifreg-command (available at: http://faculty.arts.ubc.ca/nfortin/datahead.html). Within this, I have to restrict my estimated coefficients for the family types to sum to zero. As factor variables are not allowed with this command I have included the respective dummy variables. I have already tried to apply the constraint-command which does not seem to work with rifreg. Do you have any recommendation on how to involve this restriction?
(I am using Stata version 14.2)
Many thanks in advance for your support!
Kind regards,
Kathrin
Comment