Create new variable x by selecting the value of a cell in a row conditional on the variable name containing the value of a variable z
I have a dataset of individuals. Each individual is observed across different years and countries. I have two independent variables x2002 and x2010 (see Dataex example: Before). These contain the values of a variable X for each year for a specific country. For example, all individuals observed in 2002 in France have a value of… Read More Create new variable x by selecting the value of a cell in a row conditional on the variable name containing the value of a variable z