I reshaped long and now there are more categories in my encoded variables!
Hi
I reshaped my dataset and now my encoded variables have more categories than they had. What may be the cause? (PERS_ID is the identifier for the person while STU_ID identifies the identification number and then change if the student switches between majors in the university system of my country)
Re: I reshaped long and now there are more categories in my encoded variables!
Hi Bukharin, thanks for your answer
Before reshaping I had six variables, that is one for each year (iscr_en_2006-iscr_en_2011) while after i get one (iscr_en_). The problem is that I get a 15% of 3, which is a new category that seems to me to come out of nothing.
Re: I reshaped long and now there are more categories in my encoded variables!
NOW I see it! Thanks!! In iscr_en_2007 (label list iscr_en_2007) IC is 3 because of the 999 that is 1! Then that 3 is nothing but the IC of 2007.
\(◎o◎)/!
Many thanks Bukharin!!
Re: I reshaped long and now there are more categories in my encoded variables!
Hi
yesterday I realized that I had the same problem with the whole set of variables and I've found this solution that seems to work just fine for the entire dataset
I used this syntax before reshaping in order to copy all the labels.
foreach v of var * {
local l`v' : variable label `v'
}
Then I used this one, after reshaping, to retrieve them.
foreach v of var * {
local L`v' : variable label `v'
if `"`L`v''"' == "" & `"`l`v''"' != "" {
label var `v' `"`l`v''"'
}
}