Hi,
currently I am running a imputation via this code:
*declaring the data to be mi data in mariginal long style (mlong)
mi set mlong
*registering variables
mi register imputed learn_s1 educ_s1 learn_s2 educ_s2 learn_s3 educ_s3
mi register regular gpa female migrant num_sib north east west age_birth learn_m ///
only_child_m oldest_m num_sib_m age_11 age_12 age_13 age_14
mi impute chained (pmm, knn(5)) learn_s1 educ_s1 learn_s2 educ_s2 learn_s3 educ_s3 = ///
gpa female migrant num_sib north east west ///
age_birth learn_m only_child_m oldest_m num_sib_m age_11 age_12 age_13 age_14 , add(20) rseed(1234)
*descriptive statistics
mi xeq 0 1 20: sum learn_s1 educ_s1 learn_s2 educ_s2 learn_s3 educ_s3
mi xeq 20: save "$MY_OUT\data_gpa_ss", replace
The impuation worked well for the log(earnings) for sibling 1 to 3 (s1-s3). But issues raise with theimputation of education (in years) for each sibling. The bound hold, so the scale of education ranges from 7 to 18, but in my example you can see that the values are not necessary increasing monotonously:
How can I fix it? Any ideas? I am looking forward to hearing from you!
Best
Vera
currently I am running a imputation via this code:
*declaring the data to be mi data in mariginal long style (mlong)
mi set mlong
*registering variables
mi register imputed learn_s1 educ_s1 learn_s2 educ_s2 learn_s3 educ_s3
mi register regular gpa female migrant num_sib north east west age_birth learn_m ///
only_child_m oldest_m num_sib_m age_11 age_12 age_13 age_14
mi impute chained (pmm, knn(5)) learn_s1 educ_s1 learn_s2 educ_s2 learn_s3 educ_s3 = ///
gpa female migrant num_sib north east west ///
age_birth learn_m only_child_m oldest_m num_sib_m age_11 age_12 age_13 age_14 , add(20) rseed(1234)
*descriptive statistics
mi xeq 0 1 20: sum learn_s1 educ_s1 learn_s2 educ_s2 learn_s3 educ_s3
mi xeq 20: save "$MY_OUT\data_gpa_ss", replace
The impuation worked well for the log(earnings) for sibling 1 to 3 (s1-s3). But issues raise with theimputation of education (in years) for each sibling. The bound hold, so the scale of education ranges from 7 to 18, but in my example you can see that the values are not necessary increasing monotonously:
ID | year | educ |
100 | 2000 | 9 |
100 | 2001 | 10 |
100 | 2002 | 10,5 |
100 | 2003 | 9 |
100 | 2004 | 9 |
How can I fix it? Any ideas? I am looking forward to hearing from you!
Best
Vera
Comment