Hello together,




I am currently working on my Stata code for my bachelor thesis. I’m quite a beginner and would be super grateful for some help — best would be in as simpel words as possible.




The data set I’m working with is a two-level data set, with the person id as the first level and the household in which they live as second level. Most of my variables differ only within the household. For example I investigate the effect of birth order, so every child in the household has the same fixed effects concerning their household (all children live in the household with one level of assets, with one level of parental education and so on). So I have some sort of panel structure, even if I don’t make observations over time.




Now I have tow questions:
  1. I want to estimate the effect of the childs gender and the family size in one model. The childs gender can have household fixed effects and only varies within the household. But the family size varies between households. I found out, that I somehow have to use the mixed command, but I’m not sure how exactly to implement it.
  2. I have two types of outcome variables: Dummy variables and variables that could take more than just two values. I found out that for the dummy variables I have to use the logit or logistic command. If I type „logit Dummyvaribale sex“ or „logistic Dummyvaribale sex“ I get the following result: outcome does not vary; remember: 0 = negative outcome, all other non-missing values = positive outcome, r(2000). I don’t understand what was wrong here.


Thank you so much for your help - I’m super grateful for any advice!!



Here my not working relevant part of the code
* options:
mixed highest_grade_compleated sex number_siblings|| hh_idn:, mle
mixed highest_grade_compleated sex || hh_idn: number_siblings
*sex allein in nem fixed effects modell hat 0,60 als coeffizineten

reg dummycur number_siblings
reg enrollment_age number_siblings
reg highest_grade_compleated number_siblings age
reg schooling_progression number_siblings

xtset hh_idn
xtlogit current_yn sex, fe
*ODER
clogit current_yn sex, group(hh_idn)